Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping ADO references selected in Access 2007

Status
Not open for further replies.

bplenge

Programmer
Oct 5, 2007
2
US
I have a database with forms that use ADO to access data files. In the design stage, I went into Tools/References and checked "Microsoft ActiveX Data Objects 2.1 Library", which made the ADO work.

For each “case” that is run, the application creates a separate database and copies all forms, reports, etc into it. In Access 2003, the forms in the new database still have "Microsoft ActiveX Data Objects 2.1 Library" checked, but when I run the application in Access 2007, the forms do not have "Microsoft ActiveX Data Objects 2.1 Library" checked, and the ADO will not work until I go in and manually check it myself.

Is there a way to select the ADO objects programatically, or to keep the ADO set as a default property in Acces 2007?

Thanks so much.
 
Search the Windows Registry for the GUID of the object library under HKEY_CLASSES_ROOT\Typelib - the text description will give it away, then use:

CurrentProject.Application.References.AddFromGuid "your guid"

You can loop them beforehand just to check its not in there already.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top