How to force 32bit app to use a 64bit COM dll in CreateObject?
-
29-09-2019 - |
문제
The following code behaves differently depending on if I use the 32 or 64 bit version of wscript:
Set oSQLServer = CreateObject("SQLDMO.SQLServer")
For Each o in oSQLServer.ListInstalledInstances
MsgBox o
Next
In 32 bit, it will list the instances of my 32bit server (SQL Server 2000), in 64 bit I get the contents of my 64bit server (SQL Server 2008). I need to convert this code to C++ (a 32 bit application). But I need to show the 64bit servers. How do I force the created object to use the 64bit dll and 64bit key in the registry?
해결책 2
I've decided to use ODBC's SQLBrowseConnect with the connection string
"DRIVER={SQL Server Native Client 10.0};".
SQLDMO is well and truely dead, and SQLSMO is rather short-sightedly for managed applications only.
다른 팁
A 32-bit app cannot load a 64-bit DLL, and a 64-bit app cannot load a 32-bit DLL.
제휴하지 않습니다 StackOverflow