这是怎么个情况~
Private Sub Command1_Click()Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strcon As String
Dim sql As String
Set conn = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
strcon = "DRIVER={MySQL ODBC 3.51 Driver};" & " Provider=sqloledb;Server=(LOCAL);Database=bookshop;Uid=sa;Pwd=;"
conn.Open strcon
sql = "select * from 普通用户 where user='" & Trim(Text1.Text) & "'and mima='" & Trim(Text2.Text) & "'"
rs.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs.BOF = True And rs.EOF = True Then
MsgBox vbOKOnly + vbExclamation, ""
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
frmMain.yhgl
frmMain.gwtd
frmMain.Show
End If
End Sub
密码正确了 还是显示 "用户名或密码不正确!" 无法登陆界面