Opening Remote Database with Password

the_utmost

Registered User.
Local time
Today, 07:51
Joined
Mar 10, 2005
Messages
40
Hi:

I need to open up a remote database on the S: drive and it needs a password. I can get the required values but I don't know how to send them in. Here is my code so far:

Dim AccessApp As Access.Application
strPath = "S:\Common\Tri.mdb"

'* Create a reference to another database file
Set AccessApp = New Access.Application
AccessApp.OpenCurrentDatabase strpath

This code works for other databases that *don't* need passwords but this one does. Any idea's?
 
Last edited:
You cannot pass the password parameter with the OpenCurrentDatabase method. You may wish to explore the OpenDatabase method instead.
 
I am using DAO and it does not support the OpenDatabase method. It is unrecognized. I have to use DAO since I am passing parameters into a group of reports and this is the only way that supports this idea.
 
the_utmost said:
I am using DAO and it does not support the OpenDatabase method.

This is incorrect. DAO supports the OpenDatabase method. It does NOT support the OpenCurrentDatabase method.

Also, the code in your initial post made absolutely no reference to DAO, only to Access.Application.
 
I think that you might have the 2 methods mixed up. I am currently using DAO and OpenCurrentDatabase is working fine. Thanks anyway.
 
Hmm, let's check our object browser...

OpenDatabase:
Access.AcCommand acCmdOpenDatabase
DAO.DBEngine.OpenDatabase
DAO.Workspace.OpenDatabase

OpenCurrentDatabase:
Access.Application.OpenCurrentDatabase


...nope, no mix-up on my end.
 

Users who are viewing this thread

Back
Top Bottom