DAO and Linked tables

  • Thread starter Thread starter Brian Gallagher
  • Start date Start date
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
 
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
 
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
 
Back
Top