PDA

View Full Version : Solved: Error in loading dll - ADO / MDAC



denon
03-12-2009, 05:23 AM
I got a situation yesterday which took me ages to find a fix for so I thought I would post what worked for me just in case anyone else stumbles into this weird one.

The background:

After copying a front-end database to 7 seemingly indentical Windows XP SP 3 machines there was 1 which refused to compile.

This one machine was giving the error

"Error in loading DLL"

on a bit of code similar to:

Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open "tblTable", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
I did all the obvious MISSING reference checks but all was showing ok.

I had my suspicions it was a problem with the 'ActiveX Data Objects 2.8' reference as it was in this area it was giving the compile error.

However, upon trying to reinstall the MDAC 2.8 object library from MSDN I was told I already had it installed.

This is how to repair MDAC 2.8 on WinXP with SP2/3 installed:
Right Click "c:\windows\inf\mdac.inf" > Choose "install"
When prompted for a location, Choose "c:\windows\servicepackfiles\i386"
XP will ask for the XP CD, Use the location "c:\i386" (or the original CD). This will re-install the MDAC that came with Windows XP, SP2/3.
After this process was completed my app. compiled. I assume part of the MDAC must have got corrupted - I wouldn't have bothered making a thread but I found the solution so convoluted that it definately did not seem an obvious one!

I hope this will maybe help someone one day.

:)