運行時錯誤'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