64-bit win7+vs2010, failed to connect to Oracle

Source: Internet
Author: User

Development environment:

Os:⑥4 bit Win7

Development tools: VS2010

Database: Oracle11gr1 (⑥ 4-bit 澲 service end, 32-bit client)

VS2010 error message: The data connection is unsuccessful, please check 澲 to see if the database has started when attempting to load an Oracle client, the BadImageFormatException is raised. This problem occurs if the 32-bit Oracle client component is installed to run in ⑥ 4-bit mode.

Reference to this article, but did not solve the problem, do not know what the reason. But also do a collect zàng, perhaps later can use.

Http://www.cnвlogs.com/creator/archive/2010/11/26/1885657.html

Study of the afternoon, did not fix, finally sǐ horse when live horse medicine, unexpectedly try success, at that time feeling really "no way, Liu Dark Huā Ming another village." The solution fǎ is simple: Continue with the original installed 32-bit instantclient, environment variable path, add "C:\Oracle\product\instantclient_11_2" at the front ; (This is my local 32-bit instantclient directory), after confirmation, reboot , fix. Note that the environment variable must be at the front, at least in Oracle-related path, which should be placed at the front, or it may detect the ⑥ 4-bit directory first, and the program continues to complain.

Learning without thinking is useless, this rookie probably analyze the reason: vs2010 debugging tool WebDev.WebServer20.exe is 32-bit, need to execute the corresponding 32-bit Oracle client program, the most critical is oci.dll. and the original PATH environment variable Oracle Service 澲 server directory, which is the ⑥ 4-bit program, packet hán6*4 bit oci.dll, at this time vs call 6*4 bit dynamic library, execution error. We simply allow vs to detect 32-bit oci.dll, pass 澲 Modify the environment variable path to achieve. After comparison, this machine installed Oracle Service 澲 and client, inside the two oci.dll file size is different, also verified my guess.

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.