Connect secured access database as current user with ADO

J

Jiøí Pa¹ek

I have two access databases secured with one workgroup file. In first
database (client) are only forms,reports, ... , in second (data) are only
tables.
When user open and logon in first (client) database i want link all tables
in second db (data) as a logged user with ADO, but i couldn't open
connection to second db because i don't know in code current user's
password.

If i know all table names in second db i can link tables :

Dim Cat As New Catalog, Tbl As New Table
'for each table in second db ...
Cat.ActiveConnection = CurrentProject.Connection
Tbl.Name = LocalTableName
Set Tbl.ParentCatalog = Cat
Tbl.Properties("Jet OLEDB:Create Link") = True
Tbl.Properties("Jet OLEDB:Link Datasource") = DBPath
Tbl.Properties("Jet OLEDB:Remote Table Name") = RemoteTableName
Cat.Tables.Append Tbl
and everything works fine

but if i didn't know table names, couldn't get its list :-((

any suggestions ? thanks
 

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