Question

I'm using Visual Studio to develop a C++ program that uses OCCI to query an Oracle 11g database. It's a pretty simple program at this point, and only makes a single query, but I keep running into runtime errors. I first tried to develop this in VS2010, downloading the 11.2.0.3 OCCI files, and I got an error related to the entry point for a heap-alloc procedure not located in oci.dll. I get the impression this error might be due to the fact that my Oracle client is 11.2.0.1.

Since I'm unable for support reasons to upgrade my client to a higher version, I decided to fall back to using Visual Studio 2005, since I read in Oracle's OCCI documentation that the vc8 versions of OCCI libs and DLLs come installed already in the 11g client. So I moved my C++/OCCI program over to VS 2005 and now I get a different debug runtime error: An error message box saying "The application failed to initialize properly", and a message from the loader in the VS Output window saying" ldrpWalkImportDescriptor() failed to probe [ORACLE CLIENT DIR]\oci\lib\msvc\vc8\oraocci11d.dll for its manifest, ntstatus 0xc0150002" I don't see a manifest file for the oraocci11d.dll, so I'm at a loss for how to resolve this. Can anyone more versed in VS setup for OCCI make a suggestion? Thanks in advance...

Sheldon

Was it helpful?

Solution

I notice that a number of OCCI questions here are left unanswered, so I feel obligated to explain how I got past my issue :) As is often mentioned in OCCI threads, the key is to download the appropriate version of the Oracle Instant Client. I had tried to use files from my runtime client that I already had installed, but the version number for that client is 11.2.0.1, and the OCCI for VS2010 requires a version of 11.2.0.2 or 11.2.0.3 . So I ended up downloading version 11.2.0.2 for both the OCCI and the Instant Client, since the version numbers have to match for things to work...

After that, it was simply a matter of setting the PATH environmental variable and configuring the Visual Studio project to point to the directories that contain the OCCI DLLs, libraries and include files, and also setting the TNS_ADMIN environmental variable to point to the directory containing the TNSNAMES.ORA file that defines the database to which I'm trying to connect. For a step-by-step description of this setup, refer to this blog post by Mark Williams. Even though this post was written for Visual Studio 2008, the procedure is still the same for 2010, just with different version #s...

Sheldon

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top