...missing or broken reference to...msado15.dll & msadox.dll

1jet

Registered User.
Local time
Today, 20:38
Joined
Sep 15, 2008
Messages
117
Hi all,

errorswx3.jpg

By f22a at 2008-10-15

I'm sure most have you have seen this error when implementing your project from your system to the client's.
Now before you give me a link to update my MDAC to 2.8 please believe that I've already tried that.
My client's XP machines give the error...
"MDAC 2.8 RTM is incompatible with this version of Windows. All of its features are currently part of Windows."

My machine is Vista with Access 2007.
Client's is XP with Access 2007 (upgraded from 2003 today).

Before I do a clean re-install of Office 2007 (last alternative) on my client's machines I wanted to ask weather my next approach would be viable.

I'll go into each of their VBA Editor and select the references to the below manually.

errorsreferencesac8.jpg

By f22a at 2008-10-15

Would this work?

P.S. for the forum bullies....I've already searched the forum....and guess what? :cool:
 
You think recommending a search is a form of bullying? :rolleyes:
 
So does it work after you have set the references?

I wrote a function at work that will get the list of references and add a reference that I know I need if it's not a default reference. I'll post it tomorrow if you need it does indeed work after you add the reference.
 
Sorry for the Goto in the code, I dont usually use it but I needed to get it done.

This function is not standalone, ahtCommonFileOpenSave() I put in another module. It's a wrapper for the.. you guessed it Common File Open / Save dialog box. This particular one was from a book;

' Code courtesy of:
' Microsoft Access 95 How-To
' Ken Getz and Paul Litwin
' Waite Group Press, 1996


Anyway if this doesn't work for you, maybe you can use the theory.

Code:
Public Function CheckForReference(RefName As String, Optional ByVal RefPath) As Boolean
'Written by William Muterspaugh
'September 10th, 2008
'Feel free to distribute entire code
'Feel free to modify as long as you give credit

'Pass in the name of the reference as produced by
'Access.References.Item().Name
'Optionally you can pass in the path for a reference if known

Dim RefObj As Access.References
On Error GoTo Err

Set RefObj = Access.References

'Check to see if the RefPath value was used
If IsMissing(RefPath) Then
'do nothing
Else
RefObj.AddFromFile RefPath
End If

GoTo LookForRef

LookForRef:
NumReferences = RefObj.Count
refcount = 1
    For i = 1 To NumReferences
        'Debug.Print RefObj.Item(refcount).Name
        If RefObj.Item(refcount).Name = RefName Then
        'reference exists do nothing
        CheckForReference = True
        Exit Function
                              
        End If
        refcount = refcount + 1
    Next i

'We didn't find the reference so....
GoTo AddRefOffice

AddRefOffice:
'Most of the references used in applications are to Word, Outlook, Excel, Powerpoint
'So we will look there for a name match first and attempt to create a reference without
'user intervention
Select Case RefName

    Case "Excel"
    RefLocation = "C:\Program Files\Microsoft Office\Office11\EXCEL.EXE"
    RefObj.AddFromFile RefLocation
    GoTo LookForRef

    Case "Word"
    RefLocation = "C:\Program Files\Microsoft Office\Office11\WINWORD.EXE"
    RefObj.AddFromFile RefLocation
    GoTo LookForRef
    
    Case "PowerPoint"
    RefLocation = "C:\Program Files\Microsoft Office\Office11\POWERPNT.EXE"
    RefObj.AddFromFile RefLocation
    GoTo LookForRef
    
    Case "OutLook"
    RefLocation = "C:\Program Files\Microsoft Office\Office11\OUTLOOK.EXE"
    RefObj.AddFromFile RefLocation
    GoTo LookForRef
    
    Case "Access"
    RefLocation = "C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
    RefObj.AddFromFile RefLocation
    GoTo LookForRef

    Case Else
    GoTo AddRef

End Select
    

AddRef:
'attempt to add a reference
MsgBox "Please show me where your application for " & RefName & " is located." & vbNewLine & _
"Usually a reference is a .exe file in the case of Office." & vbNewLine & _
"But a reference can be a .ocx or a .dll in the case of controls and 3rd party programs.", vbCritical, "Reference not found"

RefLocation = ahtCommonFileOpenSave(, "c:\Program Files\", , , , , "Show me where your reference for " & RefName & " is located.")

If IsNull(RefLocation) Then
    If MsgBox("You didn't pick a file", vbYesNo, "Try again?") = vbYes Then
    GoTo AddRef
    End If
Else
    RefObj.AddFromFile RefLocation
End If
GoTo LookForRef

Err:
If Err.Number = 29060 Then
MsgBox "I couldn't find your reference.  After this I will let you show me where it is.", vbCritical, "Error"
'clear the error and try again
Err.Clear
GoTo AddRef
End If

Debug.Print Err.Number
Debug.Print Err.Description
CheckForReference = False
End Function
 
Last edited:

Users who are viewing this thread

Back
Top Bottom