Library database with password

Library database with password

am 15.11.2007 11:52:46 von Alan

Does anyone know how to add a reference to an access database (db2)
programmatically to a main database (db1) if the library database
(db2) has a database password, please? Using References.AddFromFile
has only one argument, i.e. the location of the database being added
and does not seem to allow for a database password in the database
being added as a library (db2). If this is tried, it prompts for the
password and, if you enter that password correctly, the reference is
added OK. The problem is that whenever the main database (db1) is then
opened, the user gets prompted for the database password of db2. I am
hoping it is possible to add the reference to db2 programmatically
once db1 is open to get round this, but can't add the reference
programmatically without getting the prompt.

I have tried opening a connection to db2 before using
References.AddFromFile (using Set
MyPublicDatabaseVariable=OpenDatabase(db2location,false,fals e,";Pwd=db2password"),
but had no success.

Many thanks,

Alan Cossey