Home » Developer & Programmer » Precompilers, OCI & OCCI » Could not create a connection with OCCI
Could not create a connection with OCCI [message #93500] Thu, 14 March 2002 04:04 Go to next message
Björn Hachmann
Messages: 1
Registered: March 2002
Junior Member
Hello everybody,

I am experiencing problems connecting to a Oracle9i
database using the OCCI. I have started a Visual Studio.Net Project and got the "occiproc" example from the "Oracle C++ Call Interface Programmer's Guide" compiled and linked.

Although I could login to the db using SQL-Plus (with exactly the same user/passwd/connection-string) and execute the SQL-Script for the OCCI Examples, the program crashes when creating the connection.

#include "occi.h"
using namespace oracle::occi;

Environment *env;
Connection *con;

occiproc (string user, string passwd, string db)
{
env = Environment::createEnvironment();
// crash in the next line
con = env->createConnection (user, passwd, db);
}

Unhandled exception at 0x60866ce7 in Proggy.exe: 0xC0000005: Access violation reading location 0x7461726f.

This is no SQLException!

Can anybody help?

Thank you.
Re: Could not create a connection with OCCI [message #93539 is a reply to message #93500] Mon, 20 May 2002 21:37 Go to previous messageGo to next message
Han Ooi
Messages: 7
Registered: May 2002
Junior Member
Ever get it figured out? I am running into the exact same problem right now. Wierd thing is, under Visual Studio 6 it works!

Han
Re: Could not create a connection with OCCI [message #93547 is a reply to message #93539] Thu, 30 May 2002 23:27 Go to previous messageGo to next message
James Liu
Messages: 1
Registered: May 2002
Junior Member
I am using Visual Studio 6. I can not even compile it.
Using DOS terminal command CL, I can compile but can not link. I really like JDBC and hope can get this thing working. Some of the header files simply does not exist under ociinclude. for example, occiobjm.h,
wanted by occiobj.cpp, can not be found anywhere.
Re: Could not create a connection with OCCI [message #93549 is a reply to message #93539] Mon, 03 June 2002 13:08 Go to previous messageGo to next message
Han Ooi
Messages: 7
Registered: May 2002
Junior Member
Hi James,

I have gotten OCCI to work with Visual Studio 6.0 and also (sort of) Visual Studio .NET. Getting it to work is a little tricky and I spent a whole day pulling my hair out setting it up. But now it works (as well as Oracle allows anyways).

Drop me a email at han_ooi@hotmail.com and I will be happy to show you how to do it. Only problem right now with OCCI is that it is super buggy. I guess I am the only person in the world right now trying to use it on the Windows platform because I found a ton of bugs with OCCI which Oracle didn't know about. Currently, I am working with Oracle developers to get the OCCI problems resolved.

By the way, OCCI can work with both Oracle 9i and with patch 9.0.2, Oracle 8i as well.

Han
Re: Could not create a connection with OCCI [message #93637 is a reply to message #93549] Wed, 04 September 2002 13:44 Go to previous messageGo to next message
Angelo Ciarlini
Messages: 1
Registered: September 2002
Junior Member
Dear Han,

I am also trying to build a program on the Windows platform to get connected to Oracle 9i using OCCI and Visual Studio .NET. Initially, I faced problems to build the samples, but I was able to resolve them. However, the program crashes whenever it tries to connect the database. I´ve been working on that for some days and tried to find any clue on the internet, but the only thing I found was a lot of people reporting the same problem.

I would be very grateful if you could let me know how you were able to get it to work.

Thank you and all the best!

Angelo
Re: Could not create a connection with OCCI [message #93667 is a reply to message #93549] Mon, 30 September 2002 12:06 Go to previous messageGo to next message
vlad kroz
Messages: 2
Registered: September 2002
Junior Member
Hi all!

I also have headache from OCCI on WIN32 / .NET
Exactly the same problem when establishing connection. The same C++ code that works fine on sun crashes on on win32 with .net.

To Han: would you like to tell how to wok around this bug, please?
Re: Could not create a connection with OCCI [message #93711 is a reply to message #93547] Sun, 27 October 2002 20:01 Go to previous message
Han Ooi
Messages: 7
Registered: May 2002
Junior Member
I have talked to Oracle. They told me that OCCI will not work with Visual Studio .NET.

There is a work around though. Microsoft has provided an Oracle data provider that allows a direct connection into Oracle without going through the awkward ADO interface. Go to MSN to download it. From the benchmark I have seen, it is as fast as Oracle OCCI. It also provides the added benefit of intergrating Oracle to .NET as tightly as it integrates SQL Server 2000.
Previous Topic: database connection
Next Topic: pro*c: sqlca.sqlerrd[4] does not work
Goto Forum:
  


Current Time: Thu Mar 28 14:30:16 CDT 2024