By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Could not create an environment: OCIEnvCreate returned -1.

P: 1
I am getting the error while I am trying to connect to Oracle with my code in ASP.NET, this code is working in another machine, but it fails in my laptop, giving the below error.

Could not create an environment: OCIEnvCreate returned -1.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Could not create an environment: OCIEnvCreate returned -1.

Source Error:


Line 71: Dim objCmd As New OracleCommand
Line 72:
Line 73: objConn.Open()
Line 74: objCmd.Connection = objConn
Line 75: objCmd.CommandText = strSQL


Source File: C:\Inetpub\wwwroot\IFB\clsITODatabase.vb Line: 73

Stack Trace:


[Exception: Could not create an environment: OCIEnvCreate returned -1.]
System.Data.OracleClient.DBObjectPool.GetObject(Ob ject owningObject, Boolean& isInTransaction)
System.Data.OracleClient.OracleConnectionPoolManag er.GetPooledConnection(String encryptedConnectionString, OracleConnectionString options, OracleConnection owningObject, Boolean& isInTransaction)
System.Data.OracleClient.OracleConnection.OpenInte rnal(OracleConnectionString parsedConnectionString, Object transact)
System.Data.OracleClient.OracleConnection.Open()
IFB.clsITODatabase.CreateDataReaderOracle(String strSQL) in C:\Inetpub\wwwroot\IFB\clsITODatabase.vb:73
IFB.clsITODatabase.authenticateUser(String strUserID) in C:\Inetpub\wwwroot\IFB\clsITODatabase.vb:162
IFB.Global.Session_Start(Object sender, EventArgs e) in C:\Inetpub\wwwroot\IFB\Global.asax.vb:77
System.Web.SessionState.SessionStateModule.RaiseOn Start(EventArgs e)
System.Web.SessionState.SessionStateModule.OnStart (EventArgs e)
System.Web.SessionState.SessionStateModule.Complet eAcquireState()
System.Web.SessionState.SessionStateModule.BeginAc quireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
System.Web.AsyncEventExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)


---------------------

I am tried all the options given through many resources which I searched in the net, still my problem persists, I have given the permissions to the ASPNET user to the Oracle directory, still I have this problem, any suggestions, even the oracle data provider is installed. Any suggestions please reply to me asap.

Thanks
Mohins
May 8 '07 #1
Share this Question
Share on Google+
1 Reply


RedSon
Expert 5K+
P: 5,000
If it works on one machine but not on the other, that leads me to believe that it is a problem with the setup or permissions on your oracle database. I will move this to the oracle folks to see if they will be better able to help you.
May 8 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.