What we do is turn off all but essential references when
clossing down the database (so each time it starts up it
is forced to find the libraries). We leave on VBA,
Access, Office and MS-ADO 2.1
When it is starting up (ie the first function the
database runs) does the following (just included one
reference here). Of course there are easier ways of
doing this but I need to be able to deal with
English/French (Windows and/or Office) and versions from
Windows 98 to Windows XP. So far it is fairly bullet
proof. Someone else might make it more elegant though
On Error GoTo ErrorReferences
boolAdd = False
'check for reference
Set ref = Application.References("adodb")
'if missing change the flag ( in xxx_Err)
If boolAdd Then
'need to deal with if the computer is english or french
'then set the reference
If fs.folderexists(strDriveLetter & cstrRoot &
cstrComFilFr) Then
Set ref = Application.References.AddFromFile
(strDriveLetter & cstrRoot & cstrComFilFr & cstrSysADO &
cstrADO)
Else
Set ref = Application.References.AddFromFile
(strDriveLetter & cstrRoot & cstrComFil & cstrSysADO &
cstrADO)
End If
boolAdd = False
End If
ErrorReferences:
Select Case Err.Number
Case 9
boolAdd = True
Resume Next
Case Else
MsgBox Err.Description & " " & Err.Number
Resume ExitReferences
End Select