Exe Crash At ADODB.Connection with “Class does not

2019-01-24 11:11发布

问题:

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?

回答1:

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.



回答2:

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.



回答3:

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


回答4:

“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



标签: com vb6 ado