参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突
Dim ASK As Integer, DLSF As StringDim db As New ADODB.Connection
Dim RS As New ADODB.Recordset
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "你没有填写登录用户名,请填写!", 16, "提示!"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "你没有填写登录用户密码,请填写!", 16, "提示!"
Exit Sub
End If
If DLSF = "" Then
MsgBox "你没有选择用户身份,请选择!", 16, "提示!"
Exit Sub
End If
End Sub
Private Sub Form_Load()
Dim SQLM As String
db.ConnectionString = "DRIVER=Microsoft Access Driver (*.mdb);dbQ=" & App.Path & "\three1.mdb"
db.Open
SQLM = "Select * From Password Where ID='" & Text1.Text & "' And PASSWORD='" & DLSF & "'"
RS.Open strSQL, db, 2, 2
RS.Open
If Not RS.EOF Then
If RS!密码 = Text2.Text Then
MsgBox "祝贺你!你已经成功登录!", 64, "登录成功!"
If DLSF = "管理员" Then
Form2.Show
ElseIf DLSF = "用户" Then
Form5.Show
End If
Unload Me
Else
MsgBox "对不起!你输入的用户密码不正确,请重新输入!", 16, "密码错误!"
ASK = ASK + 1
Text2.Text = ""
Text2.SetFocus
End If
Else
MsgBox "对不起!你输入的用户名不正确,请重新输入!", 16, "用户名错误!"
ASK = ASK + 1
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
RS.Close
db.Close
If ASK >= 3 Then
MsgBox "对不起,你已经连续三次输入错误,不能继续登录,程序就退出!", 16, "登录超次!"
End
End If
End Sub
Private Sub Option1_Click(Index As Integer)
If Option1(0).Value = True Then
DLSF = "管理员"
ElseIf Option1(1).Value = True Then
DLSF = "用户"
End If
End Sub