OCIEnvCreate failed with return code -1 during using Oracle Client in SharePoint Visual WebPart

Although I have been installed oracle client in my server I got the following error

OCIEnvCreate failed with return code -1

When I tried to use oracle client to access oracle database in SharePoint Visual WebPart.

I investigated this issue by creating a new windows application and also ASP.Net web application then using the same current installed oracle client dll that has been worked properly.

Cause :

The current installed oracle client is 32 bit that not supported with SharePoint.

Solution :

How you can install Oracle Data Provider ?

  • Open Command Prompt.(Run > cmd )
  • Navigate to Oracle Data Provider path at your local server then type

install.bat all c://Path of your installed client  then home name

orcprovinstall

  • Open Visual Studio > Solution Explorer > Right Click Add Reference > Browse the installed client path “C:\app\XXX\product\11.2.0\client_2\odp.net\bin\2.x
  • Select Orcale.DataAccess.dll.
  • Deploy the Visual WebPart that should be now deployed successfully.

Note : To get the installed client path.

  • Go to Run > Type regedit > Navigate  to LOCAL_MACHINE – SOFTWARE – ORACLE > The Oracle client home name.

oraclehome

Enjoy 🙂

Advertisements

One thought on “OCIEnvCreate failed with return code -1 during using Oracle Client in SharePoint Visual WebPart

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s