首页 > 技术文章 > 运行时错误'430': 类不支持自动化或不支持期望的接口。New ADODB.Connection问题

dabaixiong 2016-06-03 11:32 原文

运行时错误'430': 类不支持自动化或不支持期望的接口。

 

 

问题:

 经调试发现,是运行到下面语句时出错:
Set MyConn = New ADODB.Connection  运行到这里是提示本错误


        这个MyConn在通用里是这么声明的:
    Dim MyConn As ADODB.Connection

你引用 2.8 版的试试。

定位: C:\Program Files \Common Files\Sysem\ADO\msado15.dll   (用2.8解决问题)

===

nstalling ADO also copies the following type libraries of earlier versions:

•msado27.tlb, ADO 2.7 Type Library

•msado26.tlb, ADO 2.6 Type Library

•msado25.tlb, ADO 2.5 Type Library

•msado21.tlb, ADO 2.1 Type Library

•msado20.tlb, ADO 2.0 Type Library

===

在64位Windows下:
64位exe和dll在目录c:\windows\system32目录下;
32位exe和dll在目录c:\windows\syswow64目录下;
所以要注意:
    在win64位系统下注册32位ocx或dll需要将32位ocx或dll拷贝到c:\windows\syswow64\目录下。
    且注册要用c:\windows\syswow64\regsvr32 xxxxxxx.ocx或dll
设置32位DSN要用c:\windows\syswow64\odbcad32.exe
设置32位alias要用c:\windows\syswow64\cliconfg.exe

推荐阅读