无法使用 ODBC 连接到 Oracle 10g Express Edition

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/537845/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 17:48:13  来源:igfitidea点击:

Unable to connect to Oracle 10g Express Edition with ODBC

coracleodbcoracle-xe

提问by A.J.

I am using C to write a DLL that provides basic database connection functionality to a couple of different applications, using ODBC. When I use this DLL to connect to an Oracle database (Oracle 10g Express Edition, specifically) I get the following error message:

我正在使用 C 编写一个 DLL,该 DLL 使用 ODBC 为几个不同的应用程序提供基本的数据库连接功能。当我使用这个 DLL 连接到 Oracle 数据库(特别是 Oracle 10g Express Edition)时,我收到以下错误消息:

Specified driver could not be loaded due to system error 1114 (Oracle in XE).

由于系统错误 1114(XE 中的 Oracle),无法加载指定的驱动程序。

After rebooting my computer, one of the applications that uses this DLL can connect to the database, but the other (more important one) still gets this message.

重新启动计算机后,使用此 DLL 的应用程序之一可以连接到数据库,但另一个(更重要的应用程序)仍然收到此消息。

Does anyone know what may be causing this error and how I can fix it? I've never used Oracle before so I don't really know where to start to fix this problem. Thanks in advance for any ideas anyone out there can give.

有谁知道可能导致此错误的原因以及如何解决?我以前从未使用过 Oracle,所以我真的不知道从哪里开始解决这个问题。预先感谢任何人可以提供的任何想法。

EDIT: I checked the PATH environment variable. It begins with: C:\oraclexe\app\oracle\product\10.2.0\server\bin. That's the correct path to Oracle on my computer.

编辑:我检查了 PATH 环境变量。它以:C:\oraclex\app\oracle\product\10.2.0\server\bin开头。这是我计算机上 Oracle 的正确路径。

采纳答案by DCookie

  1. Setup the windows PATH to first search the ORACLE_HOME\bin related to the Oracle ODBC Driver you're trying to use, or start your application in the ORACLE_HOME\bin directory related to the ODBC driver.
  2. Make sure the version of the ODBC driver matches the version of SQL*Net you have installed.
  1. 设置 Windows PATH 以首先搜索与您尝试使用的 Oracle ODBC 驱动程序相关的 ORACLE_HOME\bin,或者在与 ODBC 驱动程序相关的 ORACLE_HOME\bin 目录中启动您的应用程序。
  2. 确保 ODBC 驱动程序的版本与您安装的 SQL*Net 版本匹配。

回答by zendar

  • Check if tnspingcan get to your database
  • try to connect to Oracle with sqlplus
  • Check ODBC parameters. Is it Microsoft or Oracle driver?
  • Create ODBC DSN through Control panel -> Administrative Tools -> Data Sourcesand try to connect to Oracle
  • 检查是否tnsping可以访问您的数据库
  • 尝试连接到 Oracle sqlplus
  • 检查 ODBC 参数。是 Microsoft 还是 Oracle 驱动程序?
  • 通过创建 ODBC DSNControl panel -> Administrative Tools -> Data Sources并尝试连接到 Oracle