Nate
Nate

Reputation: 837

OCIEnvCreate failed with return code -1 but error message text was not available with ODP.net

I'm trying to study ORP.net and looking over this article on Deploying ODP.NET with Oracle Instant Client. I have downloaded and copied all DLLs in project as the article explains, however on the testing step, when the app is built I get the following error:

OCIEnvCreate failed with return code -1 but error message text was not available

I am using oraclexe and I have an Oracle client. I have given full permission for authenticated users. How can I solve this problem?

Upvotes: 5

Views: 48130

Answers (6)

s-s
s-s

Reputation: 380

In my case I have oracle client on the server but it was 64bit and the application run as 32bit.

Installing also 32bit (+add the folder to the path) fixed the problem.

Upvotes: 0

Charlie
Charlie

Reputation: 1

I also had the same issue when trying to connect Power BI to a Oracle database.

I had 2 versions of the Oracle client installed. 11.2 and 10.2. When I uninstalled the older version, it worked like a charm.

One thing to note is that in Power BI, when connecting to the oracle database it asked me to provide the server. But what is expects me to enter is the name of that connection in my tnsnames.ora file :)

Upvotes: 0

B2K
B2K

Reputation: 2611

I also had to make symbolic directory links for x86 and x64 applications. The steps I had to take were as follows:

  1. Make sure NET MANAGER could connect to Oracle.
  2. mklink /D C:\Windows\System32\orcl
  3. mklink /D C:\Windows\SysWoW64\orcl
  4. set environment variable for ORACLE_HOME to C:\windows\system32\orcl
  5. add C:\windows\system32\orcl\bin to your PATH
  6. It didn't work until after I restarted my computer

Upvotes: 0

MichaelS
MichaelS

Reputation: 7113

What worked for me was setting ORACLE_HOME to oracle\client\your_version\home1 instead of oracle\client\your_version\home1\BIN

Upvotes: 4

jcs
jcs

Reputation: 639

Reinstalling Oracle and updating the ORACLE_HOME environment variable with the new installation folder worked for me. Don't forget to recycle your application pool before trying your application again.

Upvotes: 1

Santiago
Santiago

Reputation: 86

When trying to connect to an Oracle database you receive the following error:

OCIEnvCreate failed with return code -1 but error message text was not available

The causes:

  1. You are using an unsupported version of the Oracle Client (older than 11.2) on Windows 7.

  2. DLLs from a previous installation of Oracle Client have been left on the system, causing a conflict.

The solutions:

  1. Install a supported version of the Oracle Client.

  2. Perform a search for "OCI.DLL" on the local machine. If you find any instances of this file in any location other than your ORACLE_HOME rename or delete it. If in doubt, uninstall the Oracle Client, then perform the search again. Anything that is leftover is the culprit.

Upvotes: 6

Related Questions