无法通过VBA连接到Oracle - 驱动程序的SQLSetConnectAttr失败 [英] Can not connect to Oracle via VBA - Driver's SQLSetConnectAttr Failed

查看:522
本文介绍了无法通过VBA连接到Oracle - 驱动程序的SQLSetConnectAttr失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在用户DSN下使用Microsoft ODBC for Oracle驱动程序创建了oracle的ODBC连接。
我可以使用SQL开发人员连接到oracle 10g,但是当我尝试通过ODBC连接时,它的说法

I have created an ODBC connection for oracle using "Microsoft ODBC for Oracle" driver under user DSN. I can connect to oracle 10g using SQL developer but when i try to connect via ODBC its saying


[Microsoft ] [ODBC驱动程序管理器]驱动程序的SQLSetConnectAttr失败

[Microsoft][ODBC DRIVER Manager] Driver's SQLSetConnectAttr Failed

我已尝试以下代码连接。

I have tried following code for connecting.

data_src = Oracle
Database = sys
Uid = <my id>
pwd = <my pwd>
Set cn=new ADOBB.Connection
Cn.open "DataSource=" + data_src + ";" + Database + "; persist security Infor = True; UserID= " + Uid + "; Password=" + pwd + "; SessionMode = ANSI;"

我已经使用不同设置的相同代码连接到Teradata。请帮助我从VBA连接Oracle 10g

I have already connected to Teradata using same code with different setting. Please help me to connect Oracle 10g from VBA

推荐答案

已知问题 - 请参阅 IBM支持文章。解决方案 - 使用Oracle驱动程序。

Known issue - see IBM support post. Solution - use the Oracle driver.

另外 - 连接字符串在不同的数据库驱动程序之间是不同的。例如,Microsoft Oracle驱动程序的连接字符串将看起来像

Also - connection strings are different between different database drivers. For example, a connection string for the Microsoft Oracle driver would look like

Driver={Microsoft ODBC for Oracle};Server=myServerAddress;Uid=myUsername;Pwd=myPassword;

而一个用于Oracle自己的驱动程序将类似于

while one for Oracle's own driver would be similar to

Driver={Oracle in OraHome92};Dbq=myTNSServiceName;Uid=myUsername;Pwd=myPassword;

分享享受。

这篇关于无法通过VBA连接到Oracle - 驱动程序的SQLSetConnectAttr失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆