比如我在一个文本框中输入"1983-10-1",按一个按钮之后,在页面上显示搜索到的记录,下面是我的思路:
temp="select Name form Student where Birthday where " & Cdate(text1.text) & " order by ID"
conn.execute temp
不过有错误,提示"提示标准表达式有类型不匹配",这是怎么回事啊?郁闷.....,请高手帮忙!我是一个初学者!^-^

解决方案 »

  1.   

    改成这样temp="select Name form Student where Birthday where '" & text1.text & "' order by ID"
    conn.execute temp
      

  2.   

    如果是ACCESS可以用你的 CDATE()或#  #来限制
      

  3.   

    temp="select Name form Student where Birthday =#" & Cdate(text1.text) & "# order by ID"
    conn.execute temp
    时间用#括起来
      

  4.   

    temp="select Name form Student where Birthday ='" & Cdate(text1.text) & "' order by ID"
    conn.execute temp
      

  5.   

    If SQL Server Then    "select Name form Student where Birthday ='" & text1.text & "'order by ID"ElseIf Access Then    "select Name form Student where Birthday =#" & text1.text & "# order by ID"End If