Best to create a package (See: http://office.microsoft.co
Thus even users without the installed libraries will be able to work with your application.
Nic;o)
Main Topics
Browse All TopicsHi,
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
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Best to create a package (See: http://office.microsoft.co
Thus even users without the installed libraries will be able to work with your application.
Nic;o)
Sub loadref()
on error resume next ' add this line
'Office
References.AddFromGuid "{2DF8D04C-5BFA-101B-BDE5-
'CDO for Windows 2000 Library
References.AddFromGuid "{CD000000-8B95-11D1-82DB-
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=<some value> then
err.clear
resume next
end if
Several of the references you have listed cannot be deployed. You cannot deploy the Access, Office or Outlook libraries; the target computer must have those already installed, or you must provide runtime versions of them (if applicable). I'm not sure about the CDO or Exchange reference, but I'd bet that's the same way. There is a runtime version of Access, but I don't believe there is one for Office or Outlook; again, you'll just have to make sure the target machine has these items installed.
In general, you should code to the Lowest Common Denominator. In your example, if you know that your installation will be shipped to endusers with the same configuration, then you have no worries, since the references will re-make (or at least they should). If, however, you ship your application to someone running Outlook 11.0, then your application will fail. You can remake references on startup, but it's a huge headache and very prone to problems (and can cause some serious issues on the target machine, if you incorrectly reference/link a library to the wrong file).
So, in addition to following nico's advice re: using an installer to insure that your target environment is suitable for your application, you should also review your target audience and determine the lowest platform you'll support. If you decide that you will support only Outlook 12.0, then your installer should check for this BEFORE installing the program and alert the user if the condition isn't met.
Note also that Access can re-make references "up" but not "down" ... so if you have a reference to the Outlook 10.0 library, then endusers with Outlook 10.0, 11.0 or 12.0 will be able to use it since Access would "upgrade" the 10.0 reference to the new version. Not so the other way; generally these are not backwards compatible, so Access will not downgrade references for you.
Business Accounts
Answer for Membership
by: capricorn1Posted on 2008-07-19 at 17:24:57ID: 22044024
the first 4 from your list are loaded by default
00AA0044DE 52}", 2, 4 00C04FB162 5D}", 1, 0
to get the GUID values and file path of the references that you need to add
( make sure that you have all the references you listed above before running the codes )
* place this codes in a module
Sub getRef()
Dim ref As Reference
For Each ref In References
Debug.Print ref.Name & " ( Major - " & ref.Major & " ) ( Minor - " & ref.Minor & " )"
Debug.Print vbTab & ref.Guid
Debug.Print vbTab & ref.FullPath
Next
End Sub
* this is the codes to load the references. Shown below are the codes to load Office and CDO
Sub loadref()
'Office
References.AddFromGuid "{2DF8D04C-5BFA-101B-BDE5-
'CDO for Windows 2000 Library
References.AddFromGuid "{CD000000-8B95-11D1-82DB-
End Sub