Please help me how will i solve my problem with login. The requirement is to terminate/lock the system, if after 3 attempts, the user failed to entered a right password. I used a some codes (indicated below). When i enter a correct username & password, it shows the next form. Here's the problem, when i try to enter an incorrect password, it doesnt lock. what it does, it overwrites the saved password on the database (access) and it still enters the next form. :-| ALSO, if i enter an incorrect username and password, here's the error:
Run-time error '-2147217887 (80040e21)':
Multiple-step operation generated errors. Check each status value.
PLEASE HELP ME!! I have no other sources. Only this site!!
In advance, Thanks for your reply!!
Here's the code i used:
Private Sub cmdOK_Click()
With Adodc1
.Recordset.Find "username ='" & txtUserName.Text & "'"
.Recordset.Find "password = '" & txtPassword.Text & "'"
If Adodc1.Recordset.EOF Then
MsgBox "Invalid Password and Username, try again!", vbOKOnly + vbInformation, "Admin"
Label1.Caption = Val(Label1.Caption) + 1
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
If Label1.Caption = 2 Then
MsgBox "This is now your last attempt, try again!", vbOKOnly + vbCritical, "Warning"
ElseIf Label1.Caption = 3 Then
MsgBox "System Locked", vbCritical, "System Administrator"
frmLogin.Enabled = False
End If
Else
LMPMain.Show
Unload Me
End If
End With
End Sub
Respectfully,
purplestar86