Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fix broken references for msadox.dll

Status
Not open for further replies.

cmmrfrds

Programmer
Feb 13, 2000
4,690
US
The computer I am developing on has a newer version of the following file.
C:\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\MSADOX.DLL

The development version is 2.7 and the app is loaded on clients with version 2.5. Even though the reference dll name is the same the reference always shows up missing on the client PC's.

I run this code in the AutoExec macro but the reference does not get fixed.
'Count the number of references in the database
intCount = Access.References.Count

'Loop through each reference in the database
'and determine if the reference is broken.
'If it is broken, remove the Reference and add it back.

For intX = intCount To 1 Step -1
Set loRef = Access.References(intX)
With loRef
Debug.Print " reference = "; .FullPath
blnBroke = .IsBroken
If blnBroke = True Or Err <> 0 Then
strPath = .FullPath
With Access.References
.Remove loRef
.AddFromFile strPath
End With
End If
End With
Next

The reference shows up as broken in the above code.
How can I fix this reference in code????
 
Is the strPath variable pointing to the 2.7 version of MSADOX.DLL? Sounds like the client computer thinks that MSADOX.DLL is still the 2.5 version, but you probably know that already.

You could package your app with the 2.7 version of MSADOX.DLL (or MDAC 2.7, which will update all of the related files to 2.7) or just install MDAC 2.7 locally on the client machine. That should register the 2.7 version of MSADOX.DLL and fix the reference.

Otherwise, you might be able to use your existing code as long as you point it to the 2.7 version of the MSADOX.DLL file.
 
Yeah, I had a similar issue with newer versions of Excel as references (thread181-635509) Didn't get any bites. I think Access can't remove a broken reference, if that reference is not valid on that specific machine, and refers to a newer version of the object. Hope you get an answer.
 
Thank you for the responses. sfm6s524, it appears to be the same type of problem you have with the later excel reference. I thought a brute force method may work, but it did not. Through VBA code called in the AutoExec Macro, I removed all references then compiled. Next, I added all the references with a hard coded path. They all added correctly except the one reference to the later library. Since the name/location is exactly the same C:\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\MSADOX.DLL on the client PC's for the older version 2.5, in theory this should have worked. It still shows a missing reference on the client PC's to version 2.7. I am starting to get annoyed with Microsoft for the aggravation this is causing.

I may need to down grade my PC to the older version of the MDAC library 2.5. I do not have control/security/politics to upgrade the clients.

Any other ideas?????
 
The versions of the .dll file in the application and on the client have to be the same, so even if the location of the file is the same, if they are different versions (2.5 vs. 2.7), you'll continue to get this error.

Unfortunately, that means that you'll have to either upgrade the client machines' msadox.dll file to 2.7 (which isn't an option in your case) or downgrade the reference in the development app to 2.5. If you previously had 2.5 installed on your dev machine (and upgraded to 2.7), you should still have the references available and shouldn't have to reinstall the full MDAC 2.5.
 
Thank you boxster87. That appears to be the case. I did upgrade to MDAC 2.7 and the older ADO libraries are available, but not the older ADOX library (msadox.dll). So, it looks like I will need to down grade to MDAC 2.5.

Where does Microsoft keep the version information, since I removed the references before re-adding them pointing to the dll name and path location.
 
In XP, you can right-click the file in Windows Explorer and select Properties. Then, click the Version tab. That should tell you which one you have. There's also an MDAC component checker app available at the URL listed below.

The msadox.dll 2.5 file should be part of the Microsoft ActiveX Data Objects 2.5 Library, so if you choose that option in References, that should include the msadox.dll 2.5 version.

You can also get old MDAC files here:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top