我正在运行 Oracle 10g 第 2 版,从我的 sqlplus 中,Oracle DB 监听器已启动并正在运行,我可以向数据库发出和执行命令,如下所示
bash-3.00$ sqlplus /nolog SQL*Plus: Release 10.2.0.2.0 - Production on Thu Oct 20 18:33:33 2011 Copyright (c) 1982, 2005, Oracle. All Rights Reserved. SQL> connect system/muzaaya Connected. SQL> create table fruits ( 2 fruit_name VARCHAR(30) PRIMARY KEY, 3 fruit_biological_name VARCHAR2(50), 4 fruit_quantity INT NOT NULL, 5 fruit_location VARCHAR(20) NOT NULL); Table created. SQL>
然后我去这里: http://www.datadirect.com/download.html 为我自己获取 Oracle 的 ODBC 连接器。我下载它并将其安装在 Windows 7 64 位上。然后,我继续使用我的 Windows Windows ODBC Administrator
配置数据源。我创建了一个名为 D1
的 DSN,输入描述、服务器名称、客户端版本、用户名和密码,最后我测试了连接,连接已完美建立!
在此之后,我转到我的 erlang 并启动我们的 odbc 应用程序,这是下面发生的事情:
1> odbc:start(). ok 2> odbc:connect("DSN=D1;UID=system;PWD=muzaaya", []). {error,"[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application SQLSTATE IS: IM014 Connection to database failed."}
这是什么意思?以及如何更正它以便从 Erlang 连接到我的 Oracle 数据库?
有人可以给我任何来自 Erlang 的特定于 Oracle 的 ODBC 连接示例(如果有的话)或其他语言的一些相关经验,以便我可以在这里和那里进行比较和更改吗?
为了连接到 ORACLE,是否需要在我们的 Erlang ODBC 连接中指定更多参数,例如 tnsnames.ora、spfile 或 pfile
,而不是那些我已经在ODBC设置里指定了?
最佳答案
在我看来,这像是“架构不匹配”。我以前从未使用过 odbc,但快速的 Google 搜索返回了以下结果:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms712362(v=vs.85).aspx
你在哪里阅读:
If you use the 64-bit odbcad32.exe to configure or remove a DSN that connects to a 32-bit driver, for example, Driver do Microsoft Access (*.mdb), you will receive the following error message:
The specified DSN contains an architecture mismatch between the Driver and Application
然后提出解决方案:
To resolve this error, use the 32-bit odbcad32.exe to configure or remove the DSN.
关于sql - Erlang ODBC 连接挑战,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7838696/