Click to See Complete Forum and Search --> : accessing Access


ThomasB
August 17th, 2001, 01:42 AM
Hi all Gurus,

I hope you can help me...

I have two Access-DBs.
One with the program modules, the other with the data.
The one with the data has a password, and all tables are linked to the one with the modules.
This should be a Client-Server-Connection, so the position of the DBs could theoretically move.
I want to re-link the tables in the module-DB, so I use this code:

DoCmd.TransferDatabase acLink, "Microsoft Access", "C:\QMS\data.mdb", acTable, Tables(I), Tables(I)



The Problem: in the data-DB are around 30 tables, and for each one he asks for a password.

my question: how can i set the password in the program code?

thx,
Tom

Sephozzy
August 17th, 2001, 05:08 AM
I'm not that experienced but have you tried supplying a user name and password at the workspace level? It works for my ODBC connection and according to MSDN should work for other databases as well.


set wrkMyWorkspace = CreateWorkspace("workspace", "uid", "password", dbUseJet")




Please correct me if I'm wrong, I'm just learning VB



If anything in this post makes sense it was written by me, if not I don't know who wrote it