user3463614
user3463614

Reputation: 95

access, OpenDatabase() relative path

Hello I have 2 accdb files in one folder, I need to open second file from first file and I have to use relative path. I tryed everything, but nothing works.

Set db = DBEngine(0).OpenDatabase(ActiveDocument.Path & "\Training.accdb") 
Set db = DBEngine(0).OpenDatabase("..\Training.accdb")

result: error, missing object

Thank you for your help.

Upvotes: 0

Views: 4252

Answers (1)

Renaud Bompuis
Renaud Bompuis

Reputation: 16796

Use this instead:

Set db = DBEngine(0).OpenDatabase(CurrentProject.Path & "\Training.accdb")

The setting ActiveDocument.Path, doesn't exists in Access.

Upvotes: 3

Related Questions