DAO and Linked tables

B

Brian Gallagher

I have a database that is linked. The database has a password and I can
refresh the link happily changing the connection string within code.

I need to add a new field to the table on the linked database. I have done
this many times before by opening the database connecting to the tabledef
and then adding the fields and index's by code. However I am struggling
this time as I need to pass the database password through but cannot seem to
find a way to do it.

Here's hoping someone can help!

Brian
 
G

Guest

Maybe this helps:

ODBC;DSN=SOmeDSNName;SERVER=SERVERNAME;UID=Smith;PWD=Sesame;

Or search in the VBA help in access or microsoft search for: ODBCConnectStr Property
 
B

Brian Gallagher

Thanks for this but I am trying to link to an access database and not a
server.
 
B

Bruce M. Thompson

Thanks for this but I am trying to link to an access database and not a

You must use the connect parameter of the OpenDatabase method.

'***EXAMPLE START
Dim db As DAO.Database

Set db = DBEngine.OpenDatabase ("c:\MyData\MyData.mdb", _
False, False, ";pwd=password")

'***EXAMPLE END
 

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