Hi All,
I upgraded from Access 2002 to Access 2010 and all the user passwords are no longer recognised. It runs well in Access 2002. I ran the debugger and found that code is failing after the highlighted text in the function below, i.e. instead of performing the With qdfLogin, it goes to Errorhandler:
Any ideas what the problem could be?
Private Function PerformLogin(UserName As String, Password As String) As Boolean
Dim rstLogin As Recordset
Dim qdfLogin As QueryDef
On Error GoTo Errorhandler
Set qdfLogin = CurrentDb.QueryDefs("qryLogin")
With qdfLogin
.Parameters("Username:").Value = UserName
.Parameters("Password:").Value = Password
Set rstLogin = .OpenRecordset(Type:=RecordsetTypeEnum.dbOpenForwa rdOnly)
End With
If rstLogin.RecordCount >= 1 Then
PerformLogin = True
Else
PerformLogin = False
End If
ReleaseAll:
If Not rstLogin Is Nothing Then
rstLogin.Close
Set rstLogin = Nothing
End If
Exit Function
Errorhandler:
PerformLogin = False
GoTo ReleaseAll
End Function