出现对象关闭时不允许操作,看了很多帖子,因为水平有限希望能有大神就此程序详细解释一下,感激不尽
Private Sub cmdOK_Click()
Dim txtSQL As String
'Dim mrc As ADODB.Recordset
'Set mrc = New ADODB.Recordset
Dim mrc As New ADODB.Recordset
Dim MsgText As String
'ToDo: create test for correct password
'check for correct password
UserName = ""
If Trim(txt_usersID.Text = "") Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txt_usersID.SetFocus
Else
txtSQL = "select * from user_If where user_ID = '" & txt_usersID.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
------〉If mrc.EOF = True Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txt_usersID.SetFocus
Else
If Trim(mrc.Fields(1)) = Trim(txt_password.Text) Then
OK = True
Unload Me
UserName = Trim(txt_usersID.Text)
mrc.Close
Set mrc = Nothing
frmmanage.Show
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
txt_password.SetFocus
txt_password.Text = ""
End If
End If
End If
------------------------------
这是个常见的登录窗体代码 报错行以标出
[解决办法]
嗯行啊,最好还能给下数据表的结构