oracle 错误 [IM002] [Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12036394/
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
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
提问by user1611540
We have an ASP.net web-app running in the following environment -
我们有一个在以下环境中运行的 ASP.net 网络应用程序 -
Existing Environment
现有环境
Operating System : Windows 2003
操作系统:Windows 2003
Framework : .NET Framework : 2.0
框架:.NET 框架:2.0
IIS : 6.0
IIS:6.0
Database : Oracle 10g
数据库:Oracle 10g
We wished to upgrade this to the following environment
我们希望将其升级到以下环境
Present Environment
现在的环境
Operating System : Windows 2008 R2 x64
操作系统:Windows 2008 R2 x64
Framework : .NET Framework : 2.0
框架:.NET 框架:2.0
IIS : 7.0
IIS:7.0
Database : Oracle 11g
数据库:Oracle 11g
While doing so, we face the below issue
这样做时,我们面临以下问题
ODBC Connection Issue on Windows Server 2008 R2 64 bit
Windows Server 2008 R2 64 位上的 ODBC 连接问题
ODBC connection could not be established from the ASP.net Web Application in Windows Server 2008 R2.
无法从 Windows Server 2008 R2 中的 ASP.net Web 应用程序建立 ODBC 连接。
Application throws an Error : ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
应用程序抛出错误: 错误 [IM002] [Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序。
Connection String :
连接字符串:
<add name="ConnectionString" connectionString="Driver=Oracle in XE;Dsn=winerenew;uid=winere;pwd=winere;dbq=XE;dba=W;apa=T;exc=F;fen=T;qto=T;frc=10;fdl=10;lob=T;rst=T;btd=F;bam=IfAllSuccessful;num=NLS;dpm=F;mts=T;mdi=F;csr=F;fwc=F;fbs=64000;tlo=O" providerName="System.Data.Odbc"/>
Application works perfectly in windows 2008 x86.
应用程序在 windows 2008 x86 中完美运行。
We have tried the following ways to resolve this issue in Windows Server 2008 x64,
我们尝试了以下方法来解决 Windows Server 2008 x64 中的此问题,
1) Enabled the 32-Bit Application in the Application Pool (IIS 7)
1) 在应用程序池 (IIS 7) 中启用 32 位应用程序
2) Executed the ODBC 32 Bit driver with the following command C:\Windows\SysWOW64\odbcad32.exe
2) 使用以下命令执行 ODBC 32 位驱动程序 C:\Windows\SysWOW64\odbcad32.exe
3) Installed the oracle 64-bit ODBC driver.
3) 安装了oracle 64 位ODBC 驱动程序。
The above methods doesn't seem to solve this issue. Could anyone tell me the problem behind it and the solution to solve this issue?
上述方法似乎并没有解决这个问题。谁能告诉我它背后的问题以及解决这个问题的方法?
回答by Micha? Niklas
If you have working DNS then you can enable tracing ODBC calls from odbcad32.exe
. Then test Oracle connection from any ODBC editor/tool (I often test it with simple Python program that uses odbc
module). Such tracing will create file with a successful attempt to connect to database. After connecting do database close program, stop tracing and rename trace file.
如果您有可用的 DNS,那么您可以启用从odbcad32.exe
. 然后从任何 ODBC 编辑器/工具测试 Oracle 连接(我经常使用使用odbc
模块的简单 Python 程序对其进行测试)。此类跟踪将创建成功尝试连接到数据库的文件。连接数据库关闭程序后,停止跟踪并重命名跟踪文件。
Now you will have to create such tracing for your application: enable tracing, start your program, try to connect do database, close program, stop tracing. You have two files with attempts to connect to database via ODBC: one successful and one with failure. Compare them.
现在您必须为您的应用程序创建这样的跟踪:启用跟踪,启动您的程序,尝试连接 do 数据库,关闭程序,停止跟踪。您有两个文件试图通过 ODBC 连接到数据库:一个成功,一个失败。比较它们。