
vba reference in extraction of a database ??
I assume you're using Access 2000 or newer, which defaults to ADO, rather
than DAO.
Something like the following untested aircode should work:
Dim appCurr As Access.Application
Dim refCurr As Reference
Set appCurr = New Access.Application
appCurr.OpenCurrentDatabase "C:\My Documents\Test.mdb"
Set refCurr = appCurr.References.AddFromFile("C:\PROGRAM FILES\COMMON
FILES\MICROSOFT SHARED\DAO\DAO350.DLL")
HTH
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
Quote:
> Hi,
> From within my vba code, i create a new
> database. I transfer some tables, forms, reports
> and modules form the CurrentDb to the new DB.
> The meaning of the new create db is to distribute
> it to my different users(they will get different data).
> I also set the startup properties for the new created db.
> Everything works fine, except that when running the new
> db-project it misses the DAO library.
> How can i automaticly(with vba code) tell that new db must
> have a reference to the DAO library ??
> Thanks in advance
> Frederik.