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


Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  Password Validation - Timothy Purvis  03-Jul-08 09:18 9:18:00 PM
      Try this - sri sri  03-Jul-08 11:25 11:25:41 PM
      Password Validation - Swapnil Salunke  04-Jul-08 12:15 12:15:54 AM
          parssword vali - Umapathy Kaliaperumal  04-Jul-08 12:26 12:26:49 AM
              Its not advisable to use both validation at once - Arjun Priyananth  04-Jul-08 12:52 12:52:19 AM
      Filter - sundar k  04-Jul-08 04:21 4:21:25 AM
      Password Validation - Sanjay Verma  04-Jul-08 05:21 5:21:59 AM
View Posts