• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2254
  • Last Modified:

Oracle OleDB error Attempt to load Oracle client libraries threw BadImageFormatException

We have an application that communicates with an Oracle database and uses a MS SQL database to manage the data and present it to a web page. The issue is that whenever we access a page that requires data from SQL via a linked server connected by the OraOLEDB.Oracle provider an error is thrown. "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". This seems strange in that all the drivers have been loaded using the 64bit installation from Oracle for the complete Client (Administrator Tools option).
The Linked server on SQL 2008 R2 enable us to run queries successfully on the Oracle 11gR2 database.
All servers are W2008R2 64 bit (Web, Oracle 11gR2 and MS SQL2008R2)
Any suggestions for fixing this error?
We have tried installing the Oracle 32 bit Client but this does not seem to make any difference.
0
NillumbikSC
Asked:
NillumbikSC
  • 3
  • 2
1 Solution
 
slightwv (䄆 Netminder) Commented:
Something is trying to mix and match drivers.  Tripple check you installed the Oracle 64Bit client.

If you need the 32Bit Oracle drivers:  When you installed the 32Bit Oracle Client did you make sure the app and environment was pointing to it first?

Oracle has a habit of mixing up things like PATH and other variables when mixing and matching different versions on the same machine.
0
 
NillumbikSCAuthor Commented:
Have double check and triple checked that the Oracle drivers 32 bit and 64 bit are installed and have swapped around the path so that 32 and 64 bit have both been at the fron and still the problem persists. I have alos installed ODAC on a third home to see if that woul help but still no joy.
0
 
slightwv (䄆 Netminder) Commented:
Sorry for the delay in responding.  Got tied up this week.

Is this a .Net app?

Here is a reference that talks about web apps being affected by a 'bad' install and how to verify the driver is working.

http://www.codeproject.com/Tips/132649/Attempt-to-load-Oracle-client-libraries-threw-BadI
0
 
NillumbikSCAuthor Commented:
Thanks for your help slightwv the UDL check went fine but the solution was actually the Alternative 2 suggestion which I applied to the Web Application Pool running this app and bingo the error "bad Image" has gone. Thanks for your assist in getting a really long and tedious problem resolved. Should have posted this problem earlier.

The other option to review when you receive this error is to view your Application_Pools setting for the app_pool you are using for your application.
 
Check the "Enable 32-Bit Applications". If this is "False", change it to "True". This may resolve your issue.
0
 
NillumbikSCAuthor Commented:
Yet again the value of the EE world comes through. I had battled with this problem for about 2 weeks off and on and finally a solution. Many thanks guys and gals.

BTW the solution was actually the setting in the web application pool by setting "Enable 32-Bit Applications" (Advanced settings) to false ths forcing the 64 bit conversation.
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now