vba reference in extraction of a database ?? 
Author Message
 vba reference in extraction of a database ??

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.



Fri, 02 Apr 2004 21:44:48 GMT  
 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.



Sat, 03 Apr 2004 05:34:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Extraction Data from Task into Database or Excel.

2. data extraction from CD database

3. syntax to reference to subform in vba code????

4. referencing a subform in VBA

5. Variable cross reference for VBA

6. VBA reference setting

7. Use dynamic references to form elements in VBA

8. VBA Reference Book

9. How do I reference a table in VBA code

10. Application.Filename reference in Access vba

11. Excel References from Access (97) VBA

12. Access '97 VBA References failing.

 

 
Powered by phpBB® Forum Software