Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password Problem

Status
Not open for further replies.

newfrontiers

Programmer
Oct 17, 2001
134
0
0
US
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

 

John
Jet OLDEB:Link Provide String is used with code linking table from an external data source.

So either relink the table through code or check the option to retain the password during Link Table Manager.

BTW, concider database password to be a curtain for a wide open window [wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top