Avatar of d10u4v
d10u4v
Flag 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
Microsoft Access

Avatar of undefined
Last Comment
Scott McDaniel (EE MVE )

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
nico5038

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)
d10u4v

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

Tom
d10u4v

ASKER
If i create a package, do i use the runtime version?
Tom
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Rey Obrero (Capricorn1)



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
nico5038

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Scott McDaniel (EE MVE )

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.