問題描述
我得到了一些 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的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!