实时错误91,对象变量或with变量未设置
vb吧
全部回复
仅看楼主
level 1
笑傲心扬 楼主
Private Sub cmdOK_Click() Dim txtSQL As String Dim mrc As ADODB.Recordset Dim MsgText As String 'ToDo: create test for correct password 'check for correct password UserName = "" If Trim(txtUserName.Text = "") Then MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告" txtUserName.SetFocus Else txtSQL = "select * from user_Info 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 End If miCount = miCount + 1 If miCount = 3 Then Me.Hide End If Exit SubEnd Sub这是一个密码登录的窗口,我输入
正确的
密码,却出现了那个错误,为什么。。。还是我什么没配置好么。。。
2007年12月16日 08点12分 1
1