This content has been marked as final. Show 9 replies
Although orginally planned to be released around the same time as the 64 bit framework, the 64 bit ODP.NET has been delayed. Currently there is no 64 bit ODP for the 64 bit client.
If you're using AMD 64 bit, you can install the 32 bit client and use the 32 bit ODP.
If you're using Itanium, there is nothing currently available as far as ODP.
gdarling's suggestion didn't work for me. :(
I'm running Windows x64 Professional, I have both the x86 and x64 Oracle client (10.2.0.1) installed. I've test SQL.PLUS on both the x86 and x64 clients and both allow a connection to be established to the Oracle database.
When attempting to use the ODP.NET libary, I receive the following error:
System.BadImageFormatException was unhandled
Message="An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
at Oracle.DataAccess.Client.OpsTrace.GetRegTraceInfo(UInt32& TrcLevel, UInt32& StmtCacheSize)
at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
The above error is generated with the following simple code:
Oracle.DataAccess.Client.OracleConnection oConnection = new Oracle.DataAccess.Client.OracleConnection();
Note: I've also tried running the above code with just the x86 version of the client installed. Same result.
Oddly enough, if I rewrite the code to use the Microsoft Oracle Provider for .NET, it runs without error. The Microsoft Oracle Provider is also a 1.0 .NET product. I'm not sure why the Oracle provider does not work? They've obviously compiled the library is some non-standard format, or the library is making calls to another library which is not x64 compatible?
Due to time constraints on my project, I've got the following options:
1.) Dump Windows XP x64 and go back to Windows XP 32 bit. Honestly if I'm going to have to do that, I'm just going to install a *nix operating system and run Windows XP in a virtual machine session (vmware, etc.).
2.) Rewrite my Oracle data/access libraries...going back to the older Microsoft provided drivers. Grrr....I originally used the Microsoft libraries...switched to the Oracle implementation when they came out...and now I'm having to switch back. If I go this route, I believe I will implement conditional compilation statements...since I'll probably have to switch back...
Neither of the above options sounds like fun. I believe the only solution is to wait for Oracle to release the ODP.NET drivers for .NET 2.0 and hope that it works. The problem of course is how long before that happens and what do I do in the meantime? SIGH
The Decision: Rewrite / modify library or reinstall operating system?!?!? Fun, fun, fun...
Well, the ODP.NET version for ADO.NET 2.0 is out, so you can try that.
I'm not sure why you are hitting this error. You just have to ensure that anything ODP.NET tries to load is also 32-bit. The OS can be 64-bit. Perhaps the 32-bit ODP.NET driver may be trying to call the 64-bit .NET Framework. Using SQL*Plus would work since it doesn't use the .NET Framework.
The 64-bit version of MS .NET provider for Oracle supports ADO.NET 2.0. However, you said you were using the 1.0 version of this provider, so I'm not sure what is happening.
You may want to open up a service request with Oracle Support to investigate further as a 32-bit ODP.NET with x64 or x86 on ADM64/EM64T is supported.
I use vs2005 vc++8.0 oracle client 10.2.0.1
I install the ODAC10202Beta.exe using the latest released odp.net ,but it can not work
my code like this:
Oracle::DataAccess::Client::OracleConnection^ con = gcnew Oracle::DataAccess::Client::OracleConnection();
Additional information: Could not load file or assembly 'Oracle.DataAccess, Version=22.214.171.124, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Did you found a solution to this problem?
We are in phase of migrating our web application on to WINDOWS 2008 64 bit from windows 2003 32 bit and receiving the following error -
InnerException: 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.
Message: DotNetNuke.Services.Exceptions.PageLoadException: 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. ---> 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. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr svchp, IntPtr errhp, IntPtr dst_locp, IntPtr src_locp, UInt64 amount, UInt64 dst_offset, UInt64 src_offset) at System.Data.OracleClient.OCI.DetermineClientVersion() --- End of inner exception stack trace
Thanks in ADVANCE...