G
Guest
Hi there
I have logon box which when the user enters a username and password a form will open. The code is below. this worked well in AC97, but in Access XP, i am getting a database type mismatch on the following line
Set rstLogon = dbsMaster.OpenRecordset("SELECT * FROM tblLogon WHERE Username = Username AND Password = Password;"
Can anyone help me on this one
Thank you in advance
Private Sub cmdVerify_Click(
'verifies the user name and password are correct. if they are, access is provided to datatables, if not, the
'access is denie
'On Error GoTo click_err
Dim dbsMaster As Databas
Dim rstLogon As Recordse
Set dbsMaster = CurrentDb(
Set rstLogon = dbsMaster.OpenRecordset("SELECT * FROM tblLogon WHERE Username = Username AND Password = Password;"
With rstLogo
If Not rstLogon.RecordCount = 0 The
Do While Not .EO
If rstLogon!Username = Username And rstLogon!Password = Password The
DoCmd.Close acForm, "frmLogon
DoCmd.Close acForm, "frmAdministration
DoCmd.OpenForm "frmDataTableEditable
ElseIf rstLogon!Username <> Username And rstLogon!Password <> Password The
.MoveNex
Els
MsgBox "The Username or Password entered is incorrect.", vbOKOnly, "Logon Error!
DoCmd.Close acForm, "frmLogon
End I
Loo
End I
End Wit
If Username <> rstLogon.RecordCount = -1 The
MsgBox "Sorry! The information you entered is incorrect."
& Chr(13) & Chr(13) & "Please contact your database administrator", vbOKOnly, "Logon Error!
DoCmd.Close acForm, "frmLogon
End I
rstLogon.Clos
'click_err
' Exit Su
End Su
I have logon box which when the user enters a username and password a form will open. The code is below. this worked well in AC97, but in Access XP, i am getting a database type mismatch on the following line
Set rstLogon = dbsMaster.OpenRecordset("SELECT * FROM tblLogon WHERE Username = Username AND Password = Password;"
Can anyone help me on this one
Thank you in advance
Private Sub cmdVerify_Click(
'verifies the user name and password are correct. if they are, access is provided to datatables, if not, the
'access is denie
'On Error GoTo click_err
Dim dbsMaster As Databas
Dim rstLogon As Recordse
Set dbsMaster = CurrentDb(
Set rstLogon = dbsMaster.OpenRecordset("SELECT * FROM tblLogon WHERE Username = Username AND Password = Password;"
With rstLogo
If Not rstLogon.RecordCount = 0 The
Do While Not .EO
If rstLogon!Username = Username And rstLogon!Password = Password The
DoCmd.Close acForm, "frmLogon
DoCmd.Close acForm, "frmAdministration
DoCmd.OpenForm "frmDataTableEditable
ElseIf rstLogon!Username <> Username And rstLogon!Password <> Password The
.MoveNex
Els
MsgBox "The Username or Password entered is incorrect.", vbOKOnly, "Logon Error!
DoCmd.Close acForm, "frmLogon
End I
Loo
End I
End Wit
If Username <> rstLogon.RecordCount = -1 The
MsgBox "Sorry! The information you entered is incorrect."
& Chr(13) & Chr(13) & "Please contact your database administrator", vbOKOnly, "Logon Error!
DoCmd.Close acForm, "frmLogon
End I
rstLogon.Clos
'click_err
' Exit Su
End Su