求助,dawn4640576
Private Sub cmdOK_Click()Dim rs As New ADODB.Recordset
Dim cmd As New
If txtUserName.Text = "" Then
MsgBox "用户名不能为空!"
txtUserName.SetFocus
Exit Sub
Else
Call ConToSQLDB
cmd.ActiveConnection = sqlcon
= "select * from auserlist where id='" & txtUserName.Text & "'"
Set rs = cmd.Execute
If rs.EOF Then
MsgBox "用户不存在!"
rs.Close
sqlcon.Close
txtUserName.SetFocus
Exit Sub
ElseIf rs!pwd <> txtPassword.Text Then
MsgBox "密码不正确!"
rs.Close
sqlcon.Close
txtPassword.SetFocus
Exit Sub
Else
caozuoyuan = txtUserName.Text
rs.Close
Set rs = Nothing
sqlcon.Close
Unload Me
Form1.Show
End If
End If
End Sub
这段代码还是你(dawn4640576),给我的代码,我对 rs!pwd <> txtPassword.Text 这一句不太明白,为什么不能写成 rspwd = txtpassword.text 呢?