高手请帮我看看代码哪里有错,谢谢!
我输入的密码和用户名都是对的,为什么老是报“密码错误”?Private Sub CmdOk_Click()
Dim sql As String
Dim rs As ADODB.Recordset
If txtUserName.Text = "" Then
MsgBox "请输入用户名!", vbExclamation
txtUserName.SetFocus
Exit Sub
End If
sql = "select * from 用户信息表 where 用户名 ='" & txtUserName.Text & "' "
Set rs = ExeSQL(sql)
If rs.EOF = True Then
MsgBox "没有此用户,请重新输入用户名!", vbExclamation
txtUserName.SetFocus
Else
If rs!用户密码 = txtPassword.Text Then
intJobId = rs!权限等级
strUserName = txtUserName.Text
rs.Close
Me.Hide
F人事工资管理系统.Show
Unload Me
Else
MsgBox "密码不正确,请重新输入密码!", vbExclamation
txtPassword.SetFocus
txtPassword.Text = ""
End If
End If
Exit Sub
End Sub