使用 ADO 连接到 Oracle

Connecting to Oracle using ADO(使用 ADO 连接到 Oracle)
本文介绍了使用 ADO 连接到 Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我得到了一些 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
Creating a flattened table/view of a hierarchically-defined set of data(创建分层定义的数据集的扁平表/视图)
MySQL: how to do row-level security (like Oracle#39;s Virtual Private Database)?(MySQL:如何做到行级安全(如 Oracle 的 Virtual Private Database)?)
What is the best way to enforce a #39;subset#39; relationship with integrity constraints(强制执行具有完整性约束的“子集关系的最佳方法是什么)
Split String by delimiter position using oracle SQL(使用 oracle SQL 按分隔符位置拆分字符串)
How to unfold the results of an Oracle query based on the value of a column(如何根据列的值展开Oracle查询的结果)