紧急求救各位大神!!!VB编程出现91错误 ,对象变量或with未设置
Private Sub cmdOK_Click()Dim txtSQL As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
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
End Sub
光标指在If mrc.EOF= True 这里,那里出错了啊,请教各位大神,方便的话留个qq请教我的qq773735406
Option Explicit
Public OK As Boolean
Dim miCount As Integer 这是前边定义的 --------------------编程问答-------------------- 1,*前后加上空格
txtSQL = "select * from user_Info where user_ID=" ' & txtUserName.Text & "'"
2,检查是否与数据库建立连接 --------------------编程问答--------------------
+1
补充:VB , 数据库(包含打印,安装,报表)