Unable to Connect SQLState IM004 MS ODBC Driver Manager SQLAllocHandle on SQL_Handle_Env failed

Posted on 2007-10-04
Last Modified: 2008-01-09

We have a Windows 2000 Server that has Oracle 9.2 installed on it. We run an ASP Application on it. This morning users were getting the error - tns could not resolve service name on the ASP pages. When I try to "test" the odbc dsn using ODBC Data Source Administrator I get the following error -

Unable to connect
[ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed

As far as I know nothing has been changed on this server - no updates, no one messed with the tnsnames.ora file, etc. We have another server (similar in configuration) that is hosting the ASP app now and it has no issues connecting with the databases.

I have looked at the following -
System Environment Variables - the oracle home bin directory is there in the path (I have compared it with the other server that's working and they are the same)
Permissions for the Oracle folder - Administrators and Authenticated Users had access and I have now added the IUSR_machinename and IWAM_machinename as well

Is there anything else I can check? Not sure if ths is related  but while rebooting the server I got a message saying one of the services had failed to start - when I looked at the event viewer it had the following - WMI ADAP was unable to process the RemoteAccess performance library due to a time violation in the open function (EventID 61)

Any help would be appreciated. Thanks.
Question by:jkj81
    LVL 18

    Expert Comment


    Author Comment

    Thanks sventhan. However we have tried all the solutions mentioned in the post. I think we've tried numerous solutions dealing with permissions and environment variables. We only have 1 Oracle Home on the server as well.

    We were thinking it could be a damaged/corrupt Oracle Client installation so we tried uninstalling the Client and reinstalling it. Initially it gave a few errors with writing to sqora32.dll but finally the client installed with no errors. But it still didn't fix the problem. We are now trying to install Oracle Instant Client on the server to see if it works. With this we have been able to go one step further as we can now actually get to the Oracle ODBC Driver Connect dialog. But when we try to login we get an error -

    Unable to Connect
    SQLState = s1000
    [Oracle][ODBC] ORA12705 Cannot access NLS Data files or invalid env specified.

    Author Comment

    Update - We added a system variable for NLS_LANG and that enabled us to test the ODBC DSN using the Oracle Instant Client successfully. We tested an asp page and it was able to retrieve the values from the database. However we have not tested the new connections with our main application (as it's running on another server at the moment).

    Still trying to fix the issue with the "SQLAllocHandle on SQL_HANDLE_ENV failed" error we were getting while trying to use the ODBC DSN using the original Oracle Client installation.

    Author Comment

    Issue resolved.
    LVL 1

    Accepted Solution

    PAQed with points refunded (350)

    EE Admin

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    This video shows how to recover a database from a user managed backup
    Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now