VB6应用oracle 12 64bit连接
我们有许多用 VB6(不是 .NET)编写的应用程序,它们已经运行了近 20 年.这些应用程序在 Windows 2007 64 位服务器上运行,并使用 32 位客户端连接到 Oracle-11.连接字符串包含Provider=OraOLEDB.Oracle"到目前为止,一切都很好.
We have a number of applications written in VB6 (not .NET) that have been running for almost 20 years. These applications are running on Windows 2007 64bit servers and connecting to Oracle-11 with a 32bit client. The connection string contains "Provider=OraOLEDB.Oracle" So far, so good.
问题是我们需要转换,出于超出本线程范围的原因)到 Oracle-12 64 位.在安装了 Oracle 12 客户端(并卸载了 Oracle 11 客户端)后,我们在尝试打开连接时收到以下错误:找不到提供程序.它可能没有正确安装."
The problem is that we need to convert, for reasons that go beyond the scope of this thread) to Oracle-12 64bit. After having installed the Oracle 12-client (and disinstalled the Oracle-11 client), we get the following error when trying to open the connection: "Provider cannot be found. It may not be properly installed."
我确定我们确实安装了客户端,因此担心 VB6 无法使用 64 位客户端连接到 Oracle.
I'm sure we did install the client and am therefore afraid that VB6 cannot connect to Oracle using the 64bit client.
不幸的是,显然简单的解决方案是不可能的:
- 转换为 .NET 或任何格式并在 64 位下编译
- 保留 32 位 oracle 客户端.
Apparently easy solutions are unfortunately out of the question:
- Convert to .NET or whatsoever and compile under 64 bit
- Keep the 32bit oracle client.
知道如何解决这个问题吗?
Any idea how to risolve this?
推荐答案
OLE-DB
好消息和坏消息;因为 Visual Basic 6.0 是没有 64 位编译器的 32 位程序,所以必须安装 32 位 Oracle Data Access Components
软件,即使数据库本身是在 64 位服务器上运行的Oracle 数据库安装,特别是您需要 32 位 Oracle Provider for OLE DB
而不是整个客户端.
OLE-DB
Good news and bad; because Visual Basic 6.0 is a 32 bit program with no 64 bit compiler, the 32 bit Oracle Data Access Components
software must be installed, even if the database itself is running on a 64 bit server in a 64 bit Oracle Database install, specifically you need the 32 bit Oracle Provider for OLE DB
rather than the whole client.
可以在此处找到驱动程序(下载 ODAC XCopy 版本):http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html
The driver can be found here (Download the ODAC XCopy version): http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html
以下主题描述了您的确切问题和修复说明:https://hoopercharles.wordpress.com/2012/11/25/connecting-to-an-oracle-database-with-visual-basic-6-0-on-windows-8-64位/
The following thread describes your exact problem and instructions on fixing it: https://hoopercharles.wordpress.com/2012/11/25/connecting-to-an-oracle-database-with-visual-basic-6-0-on-windows-8-64-bit/
另一种连接方式是改用 ODBC 驱动程序,每种方法各有利弊,因此请谷歌查找.
Another way to connect is to use ODBC drivers instead, there are pros and cons to each method so google to find them.
首先,您需要安装 64 位客户端或上面链接的 ODAC 附带的 SQORA32 ODBC 驱动程序
.
First you'll need to install the SQORA32 ODBC driver
which comes with the 64 bit client or with the ODAC linked above.
接下来,您需要创建一个 ODBC 连接,说明可以在这里找到:https://tensix.com/2012/06/setting-up-an-oracle-odbc-driver-and-data-source/
Next, you'll need to create an ODBC connection, instructions can be found here: https://tensix.com/2012/06/setting-up-an-oracle-odbc-driver-and-data-source/
最后,您需要更改 VB6 中的连接字符串以使用新创建的 ODBC 连接.以下内容应该可以很好地工作(显然 nameOfDatabase 是您的 odbc 连接的名称):
Finally you need to change your connections strings in VB6 to use the newly created ODBC connections. Something along the lines of the following should work nicely (obviously nameOfDatabase is the name given to your odbc connection):
Provider=MSDASQL;Dsn=nameOfDatabase;Uid=usernameHere;Pwd=passwordHere
设置 DSN 时要小心,确保使用 32 位 ODBC 连接管理器,可在以下位置找到:
Be careful when you set up your DSN, make sure you use the 32 bit ODBC connection manager which can be found in the following location:
c:windowssysWOW64odbcad32.exe
可以在 system32
文件夹中找到相同的程序,但这是 64 位版本....一点也不混乱!
The same program can be found in the system32
folder but that's the 64 bit version....not confusing at all!
相关文章