登录时明明密码验证一样,但还报错,急
Private Sub CheckPwd()
Dim strSQL As String
Dim strPwd As String
Dim rec As Recordset
'判断原密码是否正确
strSQL = "SELECT * FROM usersdata WHERE [userName]='" & Text1.Text & "'"
Set rec = g_Conn.Execute(strSQL)
If rec.EOF Or Err.Number <> 0 Then
MsgBox "此用户不存在!", 0 + 16, "股票分析系统"
Exit Sub
End If
strPwd = rec("password").Value
Print strPwd
Print Text2.Text
If strPwd <> Text2.Text Then
MsgBox "密码不正确!", 0 + 16, "股票分析系统"
Exit Sub
End If
Unload Me
frmmain.Show
End Sub
问:在"print strpwd"和"pring text2.text"语句中,打出来的是一样的密码,为什么还执行"msgbox"语句