生物制药相关事件:在VB程序调试中提示 :对象变量或with变量未设置

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 19:25:39
txtSQL = "select * from user_Form where user_ID = '" & txtUserName.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = True Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
If Trim(mrc.Fields(1)) = Trim(txtPassword.Text) Then
OK = True
mrc.Close
Me.Hide
UserName = Trim(txtUserName.Text)
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
End If
MyCount = MyCount + 1
If MyCount = 3 Then
Me.Hide
End If
frmMain.Show
'Unload Me
Exit Sub
End Sub

Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
EnterToTab KeyCode
End Sub