Password Validation |
| Timothy Purvis posted at 03-Jul-08 09:18 |
I am slowly getting this to work. My problem now is in combining the two SQL statements: checking for name and password together. I would rather have them checked at the same time. This is the code so far.
Public Sub CheckNameAndPassword()
Call ConnectRS(CN, RS, "SELECT name,password FROM staff where name ='" & txtName.Text & "'") If RS.RecordCount = 0 Then MsgBox "Invalid Name entered", vbCritical txtName.Text = "" CN.Close Call ConnectDB(CN, App.Path & "\users.mdb") Exit Sub End If RS.Close
Call ConnectRS(CN, RS, "SELECT name,password FROM staff where password ='" & txtPwd.Text & "'") If RS.RecordCount = 0 Then MsgBox "Invalid Password entered", vbCritical txtPwd.Text = "" CN.Close Call ConnectDB(CN, App.Path & "\users.mdb") Exit Sub End If RS.Close
End Sub
|
|