使用 ODBC 连接 Oracle 时出错

发布于 2024-12-08 15:42:21 字数 581 浏览 1 评论 0原文

我正在尝试使用 ODBC 将我的 Visual Studio 2010 应用程序与 Oracle 数据库连接。这是我到目前为止所做的:

  1. 从管理工具 -> ODBC 数据源添加了新的数据源名称。 我在OraClient11g_home1中选择Oracle作为驱动程序。我使用了 TNS 服务名称下拉列表中给出的服务名称。我测试了连接并且成功了。 这是否意味着我能够从系统连接到数据库,或者是否意味着驱动程序工作正常。

  2. 在 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:

  1. 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.

  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忘羡 2024-12-15 15:42:21

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文