'ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
We have an ASP.net web-app running in the following environment -
Existing Environment
Operating System : Windows 2003
Framework : .NET Framework : 2.0
IIS : 6.0
Database : Oracle 10g
We wished to upgrade this to the following environment
Present Environment
Operating System : Windows 2008 R2 x64
Framework : .NET Framework : 2.0
IIS : 7.0
Database : Oracle 11g
While doing so, we face the below issue
ODBC Connection Issue on Windows Server 2008 R2 64 bit
ODBC connection could not be established from the ASP.net Web Application in Windows Server 2008 R2.
Application throws an Error : ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
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.
We have tried the following ways to resolve this issue in Windows Server 2008 x64,
1) Enabled the 32-Bit Application in the Application Pool (IIS 7)
2) Executed the ODBC 32 Bit driver with the following command C:\Windows\SysWOW64\odbcad32.exe
3) Installed the oracle 64-bit ODBC driver.
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?
Solution 1:[1]
Set default ODBC driver. From the Windows Start menu, click Control Panel > Administrative Tools > Data Source (ODBC). Open the System DSN tab. Select ODBC_NAME and click Configure.
Normally system use 32 bit ODBC as default. but if you dont have 32bit then configure 64bit and set as default.
For me it's working. I build VS application in 64bit and published on IIS by setting default ODBC driver. O
Solution 2:[2]
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.
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Shailesh |
| Solution 2 | Michał Niklas |
