Set Adocon = New ADODB.Connection
Adocon.CursorLocation = adUseClient
adocon.Open "Provider=Microsoft.jet.OLeDB.4.0.1;Data Source=" && _
App.Path && " est.mdb;"
cmdok中的代码
Dim sqlstr As String
sqlstr = "select * from usersswheresname='" && Text1.Text && _
"' and pwd='" && Text2.Text && "'"
Set adors = New ADODB.Recordset
Set Adors=Adocon.Execute(sqlstr)
If Adors.Recordcount>0 Then //或If Not Adors.EOF then
....
MsgBox "Pass" //通过验证
Else
...
MsgBox "Fail" //未通过验证
End if
|