I have a problem with my log on screen, when i type my username and password on txtuser and txtpass textbox, including a single space after the username/password(no matter how many spaces in txtuser/txtpass), the log on screen accepted it as a correct username/password.
i don't know what was the problem.
sample:
txtuser.text="administrator "
txtpass.text="admin "
the word "administrator" and the word "admin" is the correct username/password, i have already check my database and there was no space on my username/password.
CODE
If txtuser.Text = "" Or txtpass.Text = "" Then
MsgBox "Please Fill The Fields First ", vbInformation + vbOKOnly, "Field Required"
txtuser.SetFocus
Else
CON.Open "provider=microsoft.jet.oledb.4.0; data source=" & App.Path & "\Database\data.mdb"
rs.Open "select * from tbluser where username='" & txtuser.Text & "' and password='" & txtpass.Text & "'", CON, adOpenKeyset, adLockOptimistic
If rs.RecordCount = 1 Then
Load frmtimeanddate
frmtimeanddate.Show
Unload frmlogin
CON.Close
Else
MsgBox "Wrong Username or Password, please try again", vbInformation + vbOKOnly, "Access Denied"
retries = retries - 1
If retries = 0 Then
MsgBox "This system will automatically close after 3 wrong attempts", vbExclamation, "info"
Unload Me
End If
rs.Close
CON.Close
End If
End If
This post has been edited by sastre06: 15 Oct, 2008 - 07:07 AM