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.
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
Thus even users without the installed libraries will be able to work with your application.
Nic;o)