使用 ODBC 连接 Oracle 时出错
我正在尝试使用 ODBC 将我的 Visual Studio 2010 应用程序与 Oracle 数据库连接。这是我到目前为止所做的:
从管理工具 -> ODBC 数据源添加了新的数据源名称。 我在OraClient11g_home1中选择Oracle作为驱动程序。我使用了 TNS 服务名称下拉列表中给出的服务名称。我测试了连接并且成功了。 这是否意味着我能够从系统连接到数据库,或者是否意味着驱动程序工作正常。
在 Visual Studio 的服务器资源管理器中,我选择了添加连接。我选择 Microsoft ODBC 数据源作为数据源,并从下拉列表中选择我的 DSN。给出了用户名和密码。当我尝试测试连接时,出现以下错误:
ORA-12154: TNS: 无法解析指定的连接标识符
[Microsoft][ODBC Driver Manager] 驱动程序的 SQLSetConnectAttr 失败 >
我做错了什么。我需要安装任何新的驱动程序或 dll 吗?请帮我解决这个问题。
I am trying to connect my Visual Studio 2010 application with Oracle database using ODBC. This is what I've done so far:
Added a new Dat Source Name from Administrative tools->ODBC Data Sources.
I selected Oracle in OraClient11g_home1 as the driver. I used the service name given in the TNS Service Name drop down. I tested the connection and it was succesful. Does this mean I was able to connect to my database from my system or does it mean the driver is working correctly.In visual studio's server explorer I selected add connection. I selected Microsoft ODBC Data Source as the Data Source and slected my DSN from the drop down. Gave the User name and password. When I try to test the connection i get the following errors:
ORA-12154: TNS:could not resolve the connect identifier specified
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
What I am doing wrong. Do I need to install any new drivers or dlls? Please do help me out with this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ODBC 为 32 位和 64 位应用程序维护单独的源集。比较 C:\Windows\System32\odbcad32.exe 和 C:\Windows\SysWOW64\odbcad32.exe
ODBC maintains separate sets of sources for 32 and 64bit applications. Compare C:\Windows\System32\odbcad32.exe and C:\Windows\SysWOW64\odbcad32.exe