表达式不匹配,什么表达式是SQL吗?还是什么?能说清楚点吗?

解决方案 »

  1.   

    "ygbh ='" & txtUserName.Text & "' and nbmm = '" & txtPassword.Text & "'"这样可以查询吗?
      

  2.   

    strquery = "ygbh ='" & txtUserName.Text & "' and nbmm = '" & txtPassword.Text & "'"
    rs.recordset.find strquery
      

  3.   

    首先你要清楚find方法的语法,其次你要确信你的条件值与数据库中的类型一致,最后检查SQL中值的引用符是否正确,比如数字类型就不需要用单引号了:
    number=123 ,而不是number='123'
    相反
    string1='123',而不是string1=123
      

  4.   

    Find 方法不能匹配多个列,你可以用 Filter 属性进行多条件组合过滤
      

  5.   

    先问你一下;RS是什么?
       rs.recordset又是什么?
       '========================================
       example:
       ADO:
       dim Conn As ADODB.Connection
       ...
       Conn.open
       Dim  rs As New ADODB.Recordset
       rs.open "Select AA from tAddress",conn
       rs.Find "AA= '" & 文本条件  & "'"    
       '//rs.Find "AA= " & 数字条件
       If rs.EOF or rs.BOF then
       ......