问题描述
我得到了一些 vba 代码来支持使用以下语法连接到 Oracle 数据库:
I have been given some vba code to support that connects to an Oracle database using the following syntax:
Dim m_dbConn As New ADODB.Connection
With m_dbConn
.ConnectionString = "DRIVER={Oracle in oraI3CL_32};dbq=DWGBP1;Uid=;Pwd=;"
.Properties("Prompt") = adPromptAlways
.CursorLocation = adUseServer
.Mode = adModeRead
.IsolationLevel = adXactIsolated
.CommandTimeout = 120
.Open
End With
通常我们会使用 ODP.net 进行连接,所以我不熟悉这种语法,并且任何 oraI3CL_32 的谷歌搜索都不会返回任何结果.请有人解释一下oraI3CL_32是什么,oraI3CL_32中的Oracle"的语法是什么意思,以及以上是否依赖于系统上预装了Oracle Data Provider/tnsnames.ora?对使用 ADO 和 ODP.net 连接(以及 EZConnect 适合所有这些)之间的区别的任何澄清也将不胜感激.
Normally we would use ODP.net to connect so this syntax is unfamilar to me, and any googling of oraI3CL_32 returns no results. Please can someone explain what oraI3CL_32 is, what the syntax "Oracle in oraI3CL_32" means, and whether the above relies upon having the Oracle Data Provider / tnsnames.ora preinstalled on the system? Any clarification of the difference between using ADO and ODP.net to connect (and where EZConnect fits in all this) would also be greatly appreciated.
推荐答案
您的连接字符串看起来更像是 ODBC 连接.
You connection string looks more like an ODBC connection.
为了使用 ADODB.Connection
,您的连接字符串应如下所示:Provider=OraOLEDB.Oracle;Data Source=DWGBP1;User Id=myUsername;Password=myPassword
In order to use a ADODB.Connection
your connection string should look like this one:
Provider=OraOLEDB.Oracle;Data Source=DWGBP1;User Id=myUsername;Password=myPassword
在此处查看其他示例:OLE DB 提供程序
或这里 Oracle 连接字符串
这篇关于使用 ADO 连接到 Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!