7

One machine having MSVBVM60.dll ver 6.0.97.82, say OLD. Other machine having MSVBVM60.dll ver 6.0.98.15, say NEW. Exe created from NEW machine crashes at line new ADODB.Connection on OLD machine giving following error

Run-time error '430': Class does not support Automation or does not support expected interface

How to get rid of this? My prime objective is to run the exe on OLD machine while created on NEW machine. To avoid disturbing config of NEW machine, I tried to unregister older version and register newer version on the OLD machine but no success. Is there any other dll(s) used by ADODB.Connection or i need to do something totally different to get rid of this?

Deanna
  • 23,876
  • 7
  • 71
  • 156
bjan
  • 2,000
  • 7
  • 32
  • 64

4 Answers4

11

This is nothing to do with the VB runtime versions and more to do with the ADO libraries (as the error line alludes to) and was caused by Microsoft breaking compatability in their ADO libraries.

KB article 2517589 explains why and the solution which is essentially to recompile against the compatability typelib.

Deanna
  • 23,876
  • 7
  • 71
  • 156
  • I followed all steps in the given KB article, everything went perfectly fine, i build the exe and it crashed again. Plz refer to my comments under the answer by Jon Egerton – bjan Feb 01 '12 at 12:37
  • Following all the steps on my build machine and recompiling fixed it for me a few days ago. – Deanna Feb 01 '12 at 14:22
  • If your project is still referencing "Microsoft ActiveX Data Objects XXX Library" then it's still building against the incompatable version. You MUST remove that reference and rebuild against the "Microsoft ActiveX Data Objects 6.0 BackCompat Library". – Deanna Feb 01 '12 at 14:26
  • 2
    I only wish I could vote this up a few more times. Keeping up on developments so you understand the symptoms of known issues is important, and why VB6 programmers should work on VB6 programs, not some .Net guy trying to fake it. Good job! – Bob77 Feb 01 '12 at 18:00
  • URRRR!!! One of my project is compiling fine on Data Objects 2.6 but as soon as i change the reference to Data Objects 6.0 BackCompat it does not compile, **Value** property in the following code is missing `For Each myField In myRecordset.Fields Select Case myField.Type Case adBoolean myString = IIf(myField.Value, "1", "0")` – bjan Feb 02 '12 at 05:53
  • Missing how? The TypeLib and class definition of Field contions a (default) Value property. What is myField declared as? – Deanna Feb 02 '12 at 08:58
  • It was declared as `Dim myField as Field`, i changed its declaration as `Dim myField as ADODB.Field` and it worked, thanks – bjan Feb 02 '12 at 10:46
0

The accepted answer didn't work for me. The following steps did.

  1. Tools -> References
  2. Uncheck:
    • Microsoft ActiveX Data Objects 6.1 Library
    • Microsoft ActiveX Data Recordset 6.0 Library
    • Microsoft ADO Ext. 6.0 for DDL and Security
  3. Check:
    • Microsoft ActiveX Data Objects 2.8 Library
    • Microsoft ActiveX Data Recordset 2.8 Library
    • Microsoft ADO Ext. 2.8 for DDL and Security
Chris
  • 186
  • 1
  • 6
0

“Class does not support Automation”. This error gets generated when compiled in vb 6.0 using 64bit version of windows and attempt to run it on a 32bit version of windows. A recompile with 32bit fixed the error

bunkinet
  • 103
  • 7
0

It may be easiest to patch the whole VB6 runtime on the OLD machine - you can get a download from here.

The VB6 runtime distributes as a package so I wouldn't recommend just inserting certain dlls on their own.

I'd also recommend checking that the two machines that you're running are using the same version of MDAC, in particular that the OLD machine has the version installed that is referenced in your project.

Jon Egerton
  • 40,401
  • 11
  • 97
  • 129
  • I dont want to patch OLD machine as these are client machines. Yes, MDAC's versions are different, but, I am running VS6.0 and VS2010 both on NEW machine at the same time. Can both versions of MDAC be installed at the same machine? – bjan Feb 01 '12 at 11:31
  • Yes that's fine to have lots of versions. In VB6 you could have MDAC versions 2.1 through 2.6 that could be installed (all at the same time). The version used by your project has to exist on the client. – Jon Egerton Feb 01 '12 at 11:37
  • 1
    Also note that Vista+ have specific versions of the VB runtimes which you can not replace and MUST NOT install on a previous version of Windows. anything before Vista should use the SP6 runtimes. – Deanna Feb 01 '12 at 12:16
  • 1- CompChecker utility is not working on NEW running windows 7 so i checked the version from HKLM\Software\Microsoft\DataAccess FullInstallVer key which is 6.1 on new and 2.82 on OLD 2- The VB project on NEW references ActiveX Data Objects 2.8 Library, it looks MDAC 2.8 is installed too !!! – bjan Feb 01 '12 at 12:22