求各位大神帮我看看这个VB程序出错了
PrivateSubLabel1_Click()Dimrs1AsNewADODB.RecordsetStaticintimeAsIntegerIfText1.text<>...
Private Sub Label1_Click()
Dim rs1 As New ADODB.Recordset
Static intime As Integer
If Text1.text <> "" Then
Adodc1.RecordSource = "select * from 权限信息表 where 操作员='" & Text1.text & "' and 密码 ='" & Text2.text & "' "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
sUser = Text1.text
' qx
MDIFrm_main.Show
Unload Me
Else
rs1.Open "select * from 权限信息表 where 操作员='" & Text1.text & "' ", Cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
MsgBox "密码错误!", 48, "信息提示"
Text2.text = ""
Text2.SetFocus
Else
MsgBox "不存在此操作员!", 48, "信息提示"
Text1.text = ""
Text2.text = ""
Text1.SetFocus
End If
intime = intime + 1
rs1.Close
End If
Else
MsgBox "请输入操作员", 48, "信息提示"
End If
If intime = 3 Then
MsgBox "您无权使用该软件", 48, "信息提示"
End
End If
End Sub
错误提示为 实例错误“-2147217843 (80040e4d)”
用户登录失败 展开
Dim rs1 As New ADODB.Recordset
Static intime As Integer
If Text1.text <> "" Then
Adodc1.RecordSource = "select * from 权限信息表 where 操作员='" & Text1.text & "' and 密码 ='" & Text2.text & "' "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
sUser = Text1.text
' qx
MDIFrm_main.Show
Unload Me
Else
rs1.Open "select * from 权限信息表 where 操作员='" & Text1.text & "' ", Cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
MsgBox "密码错误!", 48, "信息提示"
Text2.text = ""
Text2.SetFocus
Else
MsgBox "不存在此操作员!", 48, "信息提示"
Text1.text = ""
Text2.text = ""
Text1.SetFocus
End If
intime = intime + 1
rs1.Close
End If
Else
MsgBox "请输入操作员", 48, "信息提示"
End If
If intime = 3 Then
MsgBox "您无权使用该软件", 48, "信息提示"
End
End If
End Sub
错误提示为 实例错误“-2147217843 (80040e4d)”
用户登录失败 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询