Access to Access ODBC Connection

S

szymon_k

How to connect one MS Access database to another password protected
(database password) database so that to have an access to the tables
only from VBA. I don't want them to be linked and visible in the
database, but i would like to get data from this external tables only
from the code.
Szymon.
 
G

Guest

It's been a while, but try the following.

....
Dim strDatabase as String
Dim strPassword as String

Dim dbData As DAO.Database
Dim ws As DAO.Workspace

strDatabase = "c:\my folder\database.mdb"
strPassword = "MyPassword"

Set ws = DBEngine.Workspaces(0)
Set dbData = ws.OpenDatabase(strDatabase, , , ";Pwd=" & strPassword)
....

Hope this helps.
 
G

Guest

Try it with:

Set dbData = ws.OpenDatabase(strDatabase, True, False, ";PWD=" & strPassword)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top