Private Sub cmdok_Click()
If Trim(TxtUserName.Text = "") Then
MsgBox "没有输入用户名称,请重新输入!", vbOKOnly + vbExclamation, "警告"
TxtUserName.SetFocus
Else '查询用户
GetConnected
Set rs = New ADODB.Recordset
str = "select * from psw where userID ='" & TxtUserName.Text & "'" '&select * from psw where userPSW='" & txtPassword.Text & "'"
rs.Open str, cn, adOpenDynamic, adLockOptimistic
If rs.EOF = True And rs.BOF = True Then
TxtUserName.Text = ""
txtPassword.Text = ""
MsgBox "没有这个用户,请重新输入!", vbOKOnly + vbExclamation, "警告"
TxtUserName.SetFocus
Else
If txtPassword.Text = rs!userPSW Then
TxtUserName.Text = rs!userID
rs.Close
Me.Hide
gUserName = Trim(TxtUserName.Text) '保存用户名称
Form2.Show '成功登陆修改窗口
Unload Me
Else
MsgBox "无效的密码,请重试!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End If
End If
End Sub
************************************************************************************************
请问老大们上面哪个错误怎么解决?提示错误"标准表达式中数据类型不匹配"