SQL 语句写错了str1 = "select * from dl where users='" & (Text1(0).Text) & "'   And keys = '" & (Text1(1).Text) & "'"

解决方案 »

  1.   

    users=" & (Text1(0).Text) & "   And keys = " & (Text1(1).Text)
    这个有问题,users='"& Text1(0).Text & "'   And keys = '"& Text1(1).Text&"'
      

  2.   

    你的Adodc1.ConnectionString,Adodc1.CommandType是否设置了?
      

  3.   

    Adodc1.CommandType = adCmdText
      

  4.   

    实时错误’91‘
    变量对象或with块变量未设置
      

  5.   

    你的数据源设置不正确。
    检查Adodc1.ConnectionString是否连接正常。
      

  6.   

    Dim str1  As String
    str1 = "select * from dl where users='" & trim(Text1(0).Text) & "' And keys ='" & trim(Text1(1).Text) & "'"
    Adodc1.RecordSource = str1
    Adodc1.Refresh
    If Adodc1.Recordset.eof Then
       msgbox "用户名或密码错误!!!"
    else
       msgbox "验证通过!!!"
    end if
      

  7.   

    实时错误’91‘
    变量对象或with块变量未设置那么导至上述错误的原因大都是因为连接字符不正确或你的查询语句中的表的名称不正确你再仔细查一查。
      

  8.   

    Adodc1.ConnectionString已经测通了~!