
How to restore missing reference to mso97.dll?
The easiest way to make sure that your database will re-establish its
references is to use the reflibpaths key in the registry.
In order to find a file to write the correct information you can always use
the SearchTreeForFile API call
'********************Code Start *************
Private Const NO_ERROR& = 0
Declare Function SearchTreeForFile Lib "ImageHlp.dll" (ByVal lpRoot As
String, ByVal lpInPath As String, ByVal lpOutPath As String) As Long
'Recursively searches for a file starting at SearchPath
'Does not return all files matching fName, just first one
'in search path
Function SearchFile(ByVal fName As String, ByVal SearchPath As String) As
String
Dim iNull As Integer
Dim lpBuffer As String
Dim lResult As Long
SearchFile = ""
lpBuffer = String$(1024, 0)
lResult = SearchTreeForFile(SearchPath, fName, lpBuffer)
If lResult <> NO_ERROR Then
If InStr(lpBuffer, vbNullChar) > 0 Then
SearchFile = Left$(lpBuffer, InStr(lpBuffer, vbNullChar) - 1)
End If
End If
End Function
'********************Code Start *************
If you want some more information on the reflibPaths key drop me a line and
I'll forward a database which will show the principle of setting values in
the key.
Quote:
>Hi,
>How can I restore automaticaly (using VBA code) a "broken" reference to a
>particular *.dll file?
>I want to be sure that the computer is searched for the 'missing' file
>before giving an error.
>Is there a possibility of trapping these kind of errors?
>Thanks, Jeroen
>--
>Remove NOSPAM from my email adres!
>J. Ticheler
>Specialist Forestry, GIS and Remote Sensing