Exe Crash At ADODB.Connection with "Class does not support Automation"

23,978

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.

Share:
23,978
bjan
Author by

bjan

Updated on January 07, 2020

Comments

  • bjan
    bjan over 4 years

    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?

  • bjan
    bjan over 12 years
    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?
  • Jon Egerton
    Jon Egerton over 12 years
    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.
  • Deanna
    Deanna over 12 years
    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.
  • bjan
    bjan over 12 years
    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
    bjan over 12 years
    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
  • Deanna
    Deanna over 12 years
    Following all the steps on my build machine and recompiling fixed it for me a few days ago.
  • Deanna
    Deanna over 12 years
    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".
  • Bob77
    Bob77 over 12 years
    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!
  • bjan
    bjan over 12 years
    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")
  • Deanna
    Deanna over 12 years
    Missing how? The TypeLib and class definition of Field contions a (default) Value property. What is myField declared as?
  • bjan
    bjan over 12 years
    It was declared as Dim myField as Field, i changed its declaration as Dim myField as ADODB.Field and it worked, thanks