Could not create an environment: OCIEnvCreate returned -1.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mohins
    New Member
    • May 2007
    • 1

    Could not create an environment: OCIEnvCreate returned -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.Exceptio n: 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.Connecti on = objConn
    Line 75: objCmd.CommandT ext = strSQL


    Source File: C:\Inetpub\wwwr oot\IFB\clsITOD atabase.vb Line: 73

    Stack Trace:


    [Exception: Could not create an environment: OCIEnvCreate returned -1.]
    System.Data.Ora cleClient.DBObj ectPool.GetObje ct(Object owningObject, Boolean& isInTransaction )
    System.Data.Ora cleClient.Oracl eConnectionPool Manager.GetPool edConnection(St ring encryptedConnec tionString, OracleConnectio nString options, OracleConnectio n owningObject, Boolean& isInTransaction )
    System.Data.Ora cleClient.Oracl eConnection.Ope nInternal(Oracl eConnectionStri ng parsedConnectio nString, Object transact)
    System.Data.Ora cleClient.Oracl eConnection.Ope n()
    IFB.clsITODatab ase.CreateDataR eaderOracle(Str ing strSQL) in C:\Inetpub\wwwr oot\IFB\clsITOD atabase.vb:73
    IFB.clsITODatab ase.authenticat eUser(String strUserID) in C:\Inetpub\wwwr oot\IFB\clsITOD atabase.vb:162
    IFB.Global.Sess ion_Start(Objec t sender, EventArgs e) in C:\Inetpub\wwwr oot\IFB\Global. asax.vb:77
    System.Web.Sess ionState.Sessio nStateModule.Ra iseOnStart(Even tArgs e)
    System.Web.Sess ionState.Sessio nStateModule.On Start(EventArgs e)
    System.Web.Sess ionState.Sessio nStateModule.Co mpleteAcquireSt ate()
    System.Web.Sess ionState.Sessio nStateModule.Be ginAcquireState (Object source, EventArgs e, AsyncCallback cb, Object extraData)
    System.Web.Asyn cEventExecution Step.System.Web .HttpApplicatio n+IExecutionSte p.Execute()
    System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean& completedSynchr onously)


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

    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
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    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.

    Comment

    Working...