[AccessD] Access XP and references in libraries

MartyConnelly martyconnelly at shaw.ca
Mon Mar 24 16:21:51 CST 2003


You might try this code in your MDE at the immediate start to display
and compare proper reference paths .
I got tired of trying to decipher the full path name to a DLL in Tools:
Reference Window. In Access 97 it cuts off the path filename at about 30
chars. To get the a list of the all the filenames and paths for your
external references, run the routine below it places all the references
into a string suitable for dropping into a text box. As an afterthought I
added some code to give the actual version number from the dll or ocx file
etc. This might be useful in an MDE to track if the user has correct
version number of DAO ADO etc. installed. Place in About popup window.
 It only seems to work some of the time if a reference is missing, seems
to depend on installation order. So it might not help in missing 
references.
 Try printing the returned string on immediate opening in a text box or 
debug.print
MsgBox  wont work because it is a member of VBA library and if  a 
reference error occurs you will have a Disambiguation error. Not sure if 
you will get away with calling as VBA.MsgBox

Function ReferencePropertiesList() As String
'list all references in a MDB and place in a string
   Dim ref As Reference
   Dim strList As String
    strList = "Reference Properties:" & vbCrLf & vbCrLf
   For Each ref In References
      ' Check for ActiveX type files
      'Check for Broken Properties
      If ref.IsBroken = False Then
        strList = strList & "  Name: " & ref.Name & vbCrLf
        strList = strList & " FullPath: " & ref.FullPath & vbCrLf
        strList = strList & " Version: " & ref.Major & "." & ref.Minor & _
                   vbCrLf

          'skip these two calls if detail not needed
        '  strList = strList & " Description: " & _
                  GetFileDescription(ref.FullPath) & vbCrLf
         ' strList = strList & " Version No: " & _
                  FileVersionNo(ref.FullPath) & _
                 vbCrLf & vbCrLf
         Else
        strList = strList & " GUIDs of broken references:" & vbCrLf
        strList = strList & " " & ref.Guid & vbCrLf & vbCrLf
       End If
   'MsgBox GetFileDescription(ref.FullPath)
   'MsgBox FileVersionNo(ref.FullPath)
   Next ref
   Debug.Print strList
   ReferencePropertiesList = strList
End Function



More information about the AccessD mailing list