VB做登陆界面的代码出现问题,求高手相助,弄了一上午就是登不进去,快...
发布网友
发布时间:2024-09-27 14:30
我来回答
共2个回答
热心网友
时间:2024-10-06 06:08
Private Sub cmdOK_Click()
Dim r As New ADODB.Recordset
Dim SQL As String
QX = ""
SQL = "select * from users where userid='" & Trim(cmbUserName) & "'"
r.Open SQL, cn
If Not (r.EOF And r.BOF) Then
'检查正确的密码
If txtPassword = DeCode(Trim(r!PassWord & " ")) Then
LoginTure = "1"
UserName = Trim(r!Userid & " ")
QX = Trim(r!menuqx & " ")
Unload Me
Else
MsgBox "无效的密码,请重试!", , "登录"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
Else
MsgBox "无效的用户名,请重试!", , "登录"
End If
r.Close
End Sub
热心网友
时间:2024-10-06 06:13
从数据库读出来的数据中没有“密码”这个字段,你可能叫做“Password”或者什么,但不是叫做“密码”
热心网友
时间:2024-10-06 06:07
Private Sub cmdOK_Click()
Dim r As New ADODB.Recordset
Dim SQL As String
QX = ""
SQL = "select * from users where userid='" & Trim(cmbUserName) & "'"
r.Open SQL, cn
If Not (r.EOF And r.BOF) Then
'检查正确的密码
If txtPassword = DeCode(Trim(r!PassWord & " ")) Then
LoginTure = "1"
UserName = Trim(r!Userid & " ")
QX = Trim(r!menuqx & " ")
Unload Me
Else
MsgBox "无效的密码,请重试!", , "登录"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
Else
MsgBox "无效的用户名,请重试!", , "登录"
End If
r.Close
End Sub
热心网友
时间:2024-10-06 06:08
从数据库读出来的数据中没有“密码”这个字段,你可能叫做“Password”或者什么,但不是叫做“密码”