Link to home
Start Free TrialLog in
Avatar of d10u4v
d10u4vFlag for United Kingdom of Great Britain and Northern Ireland

asked on

set database references at startup

Hi,

I have a database system I'm going to be releasing in my organisation and i need to make sure that certain reference are set at the startup so that certain modules will work correctly. The references are need to set are:

Visual Basic for Application
Microsoft Access 12.0 Object Library
OLE Automation
Microsoft Office 12.0 Access Database Enine
Microsoft Outlook 12.0 Object Library
Microsoft CDO 1.21 Library
Microsoft ActiveX Data Objects Library
Microsoft CDO for Excahnge 2000 Library
Microsoft Office 12.0 Object Library

I knoe some of these are standard reference are are always loaded, but how can i make sure that the rest of them are always loaded at startup.

The CDO 1.21 is installed to the Database Folder when my MSI installs the database on the users computer, this could be stored in the System32 folder if needed.

Any suggestions would be very much appreciated.

Tom
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Best to create a package (See: http://office.microsoft.com/en-us/access/HA102176991033.aspx?pid=CH102209821033)
Thus even users without the installed libraries will be able to work with your application.

Nic;o)
Avatar of d10u4v

ASKER

If the reference is already loaded, how do you stop it from causing an error? Trying to load it again?

Tom
Avatar of d10u4v

ASKER

If i create a package, do i use the runtime version?
Tom


Sub loadref()
on error resume next  ' add this line

'Office
References.AddFromGuid "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}", 2, 4
'CDO for Windows 2000 Library
References.AddFromGuid "{CD000000-8B95-11D1-82DB-00C04FB1625D}", 1, 0
End Sub


if you take note of the error number that you are getting, you can write an error trapping routine

 on error goto refError




refError:
     if err.number= then
        err.clear
        resume next
     end if


SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial