Informix ODBC driver exception in Windows 2008 - asp.net

I have .NET 4.0 project with Informix 64 ODBC driver connection works fine at my local( which is windows 7) but when I deploy the project on server which is windows 2008 (64 bit version) with Informix ODBC driver(64 bit version) then application throws exception
Unable to find an entry point named 'InterlockedIncrement' in DLL 'kernel32.dll'.
I already read thread about the same error but no help.
I would appreciate help in this.

I was actually using 32 bit version instead of 64 and it was working because I set platform target to Any CPU in project settings so it was targetting 32 bit version. When I changed to 64 then exception on server is resolved. Also I added PATH environment variable as %INFORMIXDIR%\bin and
%INFORMIXDIR%\bin\netf20.

Related

Development and Production environment have different behaviour with the same setup

I've developed a web application with asp.net/vb.net using Visual Studio 2012. I've this application locally on my computer and on a server where is accessible from the web. Now, i've just a problem with the ODBC.
In my local version i get this error when i try to access a databace with an odbc:
The specified DSN contains an architecture mismatch between the Driver and Application
And it's ok, because visual studio it's a 32bit application and i don't have the 32bit odbc.
But, in my production environment i don't have the 32bit odbc too but i don't get the error and everything works good.
I really don't understand why.
Someone can help me?
Every Windows x64 architecture has both 32 and 64 bit ODBC. You can manage the ODBC for 64 bit in [Unit]:\Windows\System32\odbcad32.exe and for 32 bit in [Unit]:\Windows\SysWOW64\odbcad32.exe.
Try to create the DSN in the correct ODBC depending on your application based platform. You can check it on Visual Studio > Your Application > Properties > Compile tab > Platform

The provider is not compatible with the version of Oracle client ODP.NET

I landed in a tricky situation. I am working on a legacy .NET application that used ADODB (only 32bit dlls available) in conjunction with Oracle.DataAccess (32/64 bit available) which was running earlier on 2003 server with some version of Oracle (I am not sure on the version number).
Now with minimal changes I need to port this to work on 2012 server (64bit) and Oracle 11g with .NET 4.0. When I use the 64bit of Oracle client, the system is failing at ADODB. When I am using 32bit Oracle client, it says The provider is not compatible with the version of Oracle client.
The environment / tools used are:
Oracle 11g, ODP.NET, ADODB, Windows 2012 (64bit), .NET 4.0
Is there a way to solve this riddle?
Edit :
I tried with System.Data.OracleClient instead of ODP.NET I got the following exception
System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

Cannot connect to FoxPro database due to architecture mismatch between Driver and Application

Getting this error message when attempting to connect to a FoxPro database via a DSN on a Windows 7 x64 PC:
The specified DSN contains an architecture mismatch between the Driver and Application
This project uses Visual Studio 2005. The connection settings point to a 32-bit DSN ODBC configuration correctly. Not using the default x64 ODBC DSN. I even went into the registry (Wow6432Node) to make sure the FoxPro driver was pointing to the driver in the 32-bit location (sysWow64 directory).
Stumped - any ideas?
The Visual Studio 2005 project was configured for "Any CPU", and needed to be set to x86 explicitly. That was the difference, even though the DSN was pointing to the correct 32-bit driver.
Platform target: x86

Error: The 'Provider=Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine

I have developed one 32 bit web application which is using Access database (Microsoft.Jet.OLEDB.4.0).
Now I have converted it into 64 bit.
For this I have changed Target CPU property to x64.
I was getting Error as
The 'Provider=Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.
then I installed Microsoft.ACE.OLEDB.12.0.
But now it is giving error as
The 'Provider=Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Please help me..
There are two versions of Microsoft.ACE.OLEDB.12.0, for 32bit and 64bit. You have to install the 64bit version of it, since your application is of 64bit.
"AccessDatabaseEngine_x64.exe"
Try changing the configuration to x86.

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

Resources