Remote Query from DB with Password

Eichenbaum

New member
Local time
Today, 09:01
Joined
Jul 22, 2011
Messages
8
Dear all,

I'm trying to retrieve some information from an external database to setup a report. It works fine when the database does not have a password. Below you find an example:

Code:
Private Sub Report_Open(Cancel As Integer)

Me.RecordSource = "SELECT * FROM tblName IN 'M:\Internal\Database.accdb'"

End Sub
When I execute the report Access returns me 'Invalid password'.

How can I inform the password?
I tried something like : "SELECT * FROM tblName IN 'M:\Internal\Database.accdb'[;PWD=xxxxxx]" without success.

Does somebody how is the correct syntax?

Many Thanks in advance.
 
Here, I could get this to connect to a password protected db...
Code:
SELECT * FROM MyTable IN '' [MS Access;PWD=xxxxxx;DATABASE=C:\PathToYour\Database.mdb]
Note that the single quotes are empty after the IN keyword.
Mark
 
Many many Thanks lagbolt!!!

You saved my day! :D
 

Users who are viewing this thread

Back
Top Bottom