Sunday, February 19, 2012

ADO Interop Using MDAC 2.8 On Vista

I am trying to load a project under VS2005 under Windows Vista that references an ADOX wrapper that is looking for version 2.8.0.0. The reference fails because the library is not registered.

I thought maybe installing MDAC 2.8 would solve my problems, but when I run the installer for that, it briefly puts up a dialog that it is extracting files, then it disappears.

Any ideas?

--Bruce

Hi Bruce,

Did you ever get this problem solved? I'm getting a similar problem on a Windows 2000 machine. Whenever we try to do ADOX Interop we get a "Library not registered" exception. We can't replicate this behaviour as it's on a client machine using Terminal Services.

Regards,

Brent

|||

Hi,

Just a note to all, registering the msadox.dll could solve the "Library not registered" problem when trying to use ADOX Interop.

regsvr32 "C:\Program Files\Common Files\System\ado\msadox.dll"

Hope this helps someone.

- Brent

|||

I have found that registering msadox does not help in this case because the msadox version that lives in vista is 6.0, whereas the latest version I have been able to find is 2.8. Does anyone know where the 6.0 version comes from?

Jeff

|||

I have found that MDAC has been replaced by WDAC as this article describes: http://msdn2.microsoft.com/en-us/library/ms692897.aspx That is where the 6.0 version comes from. Now I just need to know how to get 2.8 on the system.

|||

Take a look at this link that talks about Redistributing MDAC 28 : http://msdn2.microsoft.com/en-us/library/ms693148.aspx

Also can you add "Microsoft ActiveX Data Objects 2.8 Library", "Microsoft ADO Ext 6.0 for DDL and Security" to your project references and see if it helps?

msado28.tlb should be there in \Program Files\Common Files\System\ado location

Hope this helps

|||

Okay, so have any of the above lead to a solution? My problem is that I have this new development laptop with Vista. But my code needs to run on Server 2000/2003 and XP. So how do I get my project to build with a reference to ADOX 2.8 on Vista? Or, if I replace my ADOX 2.8 reference with one to ADOX 6.0, will I be able to install my project on an XP machine?

I'm posting this because I'm not sure if any of the above have actually fixed the problem. Please correct me if I'm wrong.

Thanks.

Kenneth.

|||Could you try having your msadox.dll of the lowest version you want create .net metadata dll like:

tlbimp msadox.dll /out:ADOX28.dll

Then put this ADOX28.dll file on your development machine and add reference to it.|||

Okay, so that seems to get me to be able to build if I do this:

using ADOX = ADOX28;

But I don't think that'll help me deploy to XP right?

So I did this on an XP development machine with ADOX installed then moved the resultant output to my Vista development machine:

tlbimp ADOX.dll /namespace:ADOX /asmversion:2.8 /out:ADOX28.dll

So now I can simply do:

using ADOX;

Thanks.

Kenneth.

No comments:

Post a Comment