这是代码:明明字符串相等,VB就是认为不相等:(Private Sub Command1_Click()Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=MSDASQL;DSN=SQL;DATABASE=menkong_db", "zhangqi", "zq226", -1Dim rst As New Recordset
Set rst = New Recordsetrst.Open "select * from 管理员表", db, adOpenDynamic, adLockOptimistic
rst.MoveFirst
For i = 0 To rst.RecordCount - 1
id = rst.Fields("ID")
password = rst.Fields("password")If (id = Text1.Text) Then
myusername = id
mypassword = password
MsgBox "密码已经取出!"
End Ifrst.MoveNext
Next i
rst.Close
Set rst = Nothing
db.Close
If (Text1 = myusername And Text2 = mypassword) Then
    MsgBox "您已经成功登录!"
    Unload Me
    frm_chakanquanxian.Show
Else
    MsgBox "无效的密码,请重试!", , "登录"
    Text2.SetFocus
End If
End Sub