4

I'm trying to move web servers. Our app (be kind) was written back in 1998 (I think) in VB6. I've got it working on our new server (Windows Server 2008 R2 64 bit). However, when I take the source code on my machine (Windows 7 64 Bit), and transfer the exe to the server, the app blows up when it tries to connect to the database with this error: "Error 430 (Class does not support Automation or does not support expected interface)"

The project references Microsoft Activex Data Objects 2.8 Library. The line that errors is

Set conn = New adodb.Connection

So, it's not actually trying to connect to the database, but purely blowing up when trying to create the object.

Anyone have any experience with this kind of error? Or any suggestions for me? Google had several possibilities but none of them panned out. Most of them had to do with Common Controls and using "Project Compatibility" -- but my app runs with "Unattended Execution" and so I can't choose that (it's completely disabled in the project properties.)

C-Pound Guru
  • 15,967
  • 6
  • 46
  • 67
Matt Dawdy
  • 19,247
  • 18
  • 66
  • 91
  • Did you try to make a minimum project sample that crashes? How is your declaration of `conn`? – MicSim Mar 29 '11 at 06:33
  • Sorry MicSim -- I'll try this when I get home tonight (it's not a problem in my 9-5 job, so the code is only on my home machine). But I'm relatively certain that conn is declared as Dim conn as ADODB.Connection (early binding, not late. I'll try late binding tonight). – Matt Dawdy Mar 29 '11 at 14:21
  • Late binding did fix the problem. It's not optimal as far as coding goes, but hey, at least it works. – Matt Dawdy Apr 01 '11 at 15:36

1 Answers1

4

It's a breaking change to MDAC that Microsoft introduced in SP1. Check out this MSDN Forum Thread. It has a few suggestions for work-arounds. As of yet, there is no fix from Microsoft.

I ran into this on 32-bit Windows 7 and ended up rolling back SP1.

One of the suggestions is to replace the updated (broken) mdac dll with one from an un-service packed machine:

  1. Open Regedit and locate the key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\TypeLib\{2A75196C-D9EB-4129-B803-931327F72D5C}

  2. Right click, Permissions, Advanced, Owner, Change owner to Administrators, Click OK, OK

  3. Run C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12 -u "%CommonProgramFiles(x86)%\system\ado\msado28.tlb"

  4. Copy msado28.tlb from Win7 RTM/Win2008R2 RTM to your local machine, note the folder for the next step.

  5. Run C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12 "{path}\msado28.tlb"

These steps are for 64-bit windows. Should be the same for 32-bit with adjustment for the paths.

C-Pound Guru
  • 15,967
  • 6
  • 46
  • 67
  • Thank you for this. I didn't encounter that thread when researching yesterday. I'll give those suggestions a try tonight. – Matt Dawdy Mar 29 '11 at 14:21
  • I did try that solution, and either I didn't do it right, or it doesn't work for the specific problem that I have. However, that article did mention late binding, and that DID fix my problem, so thank you for the link. – Matt Dawdy Apr 01 '11 at 15:36