BadImageFormatException is raised when attempting to load the Oracle client library. This problem occurs if you are running in 64-bit mode with the 32-bit Oracle client component installed.

Source: Internet
Author: User

Starting with 10G, Oracle provides a lighter-weight customer package called Instant client. Once you've installed it, there's no need to install a huge Oracle client.
This way, as long as the client download instant clients, directly decompression, set path is OK.
The settings are as follows:
1. Download 32-bit Oracle Instantclient
2. Extract Oracle Instantclient to a directory
3, open PL/SQL, in the perference set OCI Library and Oracle_home, examples are as follows:
OCI Library=d:\instantclient_11_2\oci.dll (The OCI.DLL file of the extracted directory just instantclient)
Oracle_home=d:\instantclient_11_2 (just Instantclient's extract directory)
4. Set Environment variables (modify Nls_lang and tns_admin environment variables)
For Nls_lang environment variables, it is best to set to the same as the database side, first query the character set information from the database side:
Sql> Select Userenv (' language ') Nls_lang from dual;
Nls_lang
----------------------------------------------------
American_america. Zhs16gbk

Right-click My Computer-Properties-advanced-environment variables-system environment variables:
1> Click "New", the variable name is set to "Tns_admin", the variable value is set to "D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN", click "OK"; (Directory of 64-bit Oracle Tnsname.ora files)
2> Click "New" and the variable name is set to "Nls_lang" and the variable value is set to "American_america.   ZHS16GBK ", click" OK "; (Database field set)
Finally click "OK" to exit.

At this point, re-landing plsql can be used

Good. PL/SQL is possible to log in, but we do not even have an ASP. To Connection.Open (), it says: "BadImageFormatException is raised when attempting to load the Oracle client library. This problem occurs if you are running in 64-bit mode with the 32-bit Oracle client component installed. “。 This probably means that my ASP is not supposed to use 32 of the client to access the 64-bit database, I understand. But I installed 64 of Oracle is not quite a 64-bit client installed? The lightweight 32-bit client is just convenient for PL/SQL to access the ORALCE database. This question gives a lot of answers online. Mostly, the target platform in the Build option in the properties of the project is changed to x86. Consciousness is to run the project as a 32-bit. Every project has been changed, or it doesn't work. Online also said that the site project properties in the Web item in the server changed to IIS does not use the VS comes with the web deleloper ment service, should be a process for its webDe.webServer.exe is a 32-bit process, anyway said a lot. This method is still possible. When you're done, the project can actually run and access the ORACLE64 bit database. But personally I always find this method very troublesome. And that way, your local IIS will have one more project in IIS when you build every project that accesses Oracle data, and it will often report strange errors when it's unstable. At last, I was going to put back the 32-bit system, and then I went on the internet to think about it.
Finally, I found that it was not the lightweight bag. Finally, the 32-bit Oracle Client installation package is executed with the administrator installed and selected at the time of installation. And before I encountered an ASP. NET connection is not Oracle, is the Oracle installation folder permissions problem, so I also netservices the folder Oracle is located in the user Full Control permissions. Restart again, ok! Fix, program incredibly able to connect on .... In fact, I do not know where the problem is, in the end is the lightweight package can not do it! Or is that permission problem ... Anyway, that's good. Record this.

2013-07-07 Note: Today is still the same problem, after another experiment, proved that the lightweight client package does not work, it must be the installation version of the installed version of the directory than the light-weight package after the decompression of the directory in more than a lot of files, thus, The Oci.dll file in the lightweight package solves the problem of PL/SQL with 64-bit Oracle, but the C # program to 64-bit Oracle, or the installation version of the client, you can not install the Administrator option, the default client option is more than 100 trillion.
Client download point here.

BadImageFormatException is raised when attempting to load the Oracle client library. This problem occurs if you are running in 64-bit mode with the 32-bit Oracle client component installed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.