Obtaining Reference List

  • Thread starter Thread starter Richard Krupa
  • Start date Start date
R

Richard Krupa

Hey guys,

Is there a way i can generate a lit of all the references the database is
using including Version and Path? in a runtime environment its very hard to
tell which dll or ocx file is missing or outdated because i obviously cant
get into the reference list. Was wondering if i can get it programically so
i can check it?

Regards,
Richard
 
Richard Krupa said:
Is there a way i can generate a lit of all the references the database is
using including Version and Path? in a runtime environment its very hard to
tell which dll or ocx file is missing or outdated because i obviously cant
get into the reference list. Was wondering if i can get it programically so
i can check it?

See the links at OCX/DLL Version Checker
http://www.granite.ab.ca/access/ocxdllversionchecker.htm Specifically
DLL Heaven A Possible Solution Sample code showing you some means of
fixing things yourself.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
You can....but it has to be the very first routine that runs during start up
and any code it the module must have explicit declarations (see
http://www.trigeminal.com/usenet/usenet026.asp?1033 for additional info).
Example code follows:

Sub CheckReferences()

Dim ref As Access.Reference
Dim intResponse As Integer
Dim blnMissing As Boolean
Dim strURL As String
Dim strBAD As String
Dim strMSG As String

On Error Resume Next

For Each ref In Access.Application.References
If ref.IsBroken Then
strBAD = vbCrLf & vbTab & ref.FullPath & " "
blnMissing = True
End If
Next

If DAO_OK() = False Then
VBA.MsgBox "One or more DAO files is missing, corrupt, or not
registered." _
& vbCrLf & vbCrLf & "This error may result from an
incomplete or failed installation of Microsoft Access and/or its components
and will prevent the software from functioning properly." _
& vbCrLf & vbCrLf & "Please see articles 296205, 319841, or
319844 in Microsoft's Knowledge Base at support.microsoft.com.", _
vbApplicationModal + vbCritical + vbOKOnly, _
"DAO Reference Error"
Access.Application.DoCmd.Quit
End If

If blnMissing Then
strMSG = "The following referenced files are missing or corrupt and
will prevent the software from functioning properly:" _
& vbCrLf & strBAD

Access.Application.DoCmd.Quit

Else
'Refs OK...safe to run other code
Access.Application.Run "NextStartUpRoutine"

End If

End Sub

Function DAO_OK() As Boolean

Dim varDBE As Variant

On Error Resume Next

If Access.Application.SysCmd(acSysCmdAccessVer) = "8.0" Then
Set varDBE = VBA.CreateObject("DAO.DBEngine.35")
Else
Set varDBE = VBA.CreateObject("DAO.DBEngine.36")
End If

DAO_OK = (Err.Number = 0)

End Function
 
Richard Krupa said:
Hey guys,

Is there a way i can generate a lit of all the references the database is
using including Version and Path? in a runtime environment its very hard to
tell which dll or ocx file is missing or outdated because i obviously cant
get into the reference list. Was wondering if i can get it programically so
i can check it?

In a runtime, I put my own copies of the references I need onto the machine.
The following code will tell you what references are called and their paths:

Public Function GetRefs()
'=====================================
' Name: GetRefs
' Purpose: Get a list of the current database references
'
' Author: Arvin Meyer
' Date: April 10, 1999
' Comment:
'
'=====================================
On Error GoTo Err_GetRefs
Dim i As Integer

For i = 1 To Application.References.Count

Debug.Print Application.References(i).FullPath

Next i

Exit_GetRefs:
Exit Function

Err_GetRefs:
MsgBox Err.Number & ": " & Err.Description
Resume Exit_GetRefs

End Function
 
Back
Top