newfrontiers
Programmer
Hello.
I have a fe/be and just added a database password to the be. I connect to the be using ActiveConnection
Here is an example:
Sub Login(empid As String, PW As String)
Dim cmd1 As Command
Dim strSQL As String
Dim Prm1 As ADODB.Parameter
Dim rst1 As ADODB.Recordset
Dim int1 As Integer
On Error GoTo Err_Handle
strSQL = "Select tblUsers.strUser, tblUsers.blnAdmin, tblUsers.strUserName," & _
"tblUsers.Pwd, tblUserTerr.strSTerr FROM tblUsers INNER JOIN tblUserTerr ON " & _
"tblUsers.strUser = tblUserTerr.strUser WHERE tblUsers.strUser= """ & empid & """;"
Debug.Print "Password, Login | empid passed is: " & empid & " and password is: " & PW
Debug.Print "Password, Login| SQLString to authorize: " & strSQL
Set rst1 = New ADODB.Recordset
rst1.ActiveConnection = CurrentProject.Connection
rst1.open strSQL, , adOpenKeyset, adLockPessimistic
Debug.Print "Password, Login | The proper password is: " & rst1.Fields("pwd")
But I keep getting a message -2147467259 Not a valid password.
I read somewhere that you need to set Jet OLDEB:Link Provide String but I am confused.
Any assistance is greatly appreciated.
Thanks,
John
I have a fe/be and just added a database password to the be. I connect to the be using ActiveConnection
Here is an example:
Sub Login(empid As String, PW As String)
Dim cmd1 As Command
Dim strSQL As String
Dim Prm1 As ADODB.Parameter
Dim rst1 As ADODB.Recordset
Dim int1 As Integer
On Error GoTo Err_Handle
strSQL = "Select tblUsers.strUser, tblUsers.blnAdmin, tblUsers.strUserName," & _
"tblUsers.Pwd, tblUserTerr.strSTerr FROM tblUsers INNER JOIN tblUserTerr ON " & _
"tblUsers.strUser = tblUserTerr.strUser WHERE tblUsers.strUser= """ & empid & """;"
Debug.Print "Password, Login | empid passed is: " & empid & " and password is: " & PW
Debug.Print "Password, Login| SQLString to authorize: " & strSQL
Set rst1 = New ADODB.Recordset
rst1.ActiveConnection = CurrentProject.Connection
rst1.open strSQL, , adOpenKeyset, adLockPessimistic
Debug.Print "Password, Login | The proper password is: " & rst1.Fields("pwd")
But I keep getting a message -2147467259 Not a valid password.
I read somewhere that you need to set Jet OLDEB:Link Provide String but I am confused.
Any assistance is greatly appreciated.
Thanks,
John