Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

oracle

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?

like image 570
Nate Avatar asked Oct 15 '12 17:10

Nate


2 Answers

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.

like image 84
Santiago Avatar answered Nov 15 '22 04:11

Santiago


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

like image 34
MichaelS Avatar answered Nov 15 '22 04:11

MichaelS