Link to home
Start Free TrialLog in
Avatar of jkj81
jkj81

asked on

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

Hello,

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
SQLState=IM004
[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.
Avatar of sventhan
sventhan
Flag of United States of America image

Avatar of jkj81
jkj81

ASKER

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.
Avatar of jkj81

ASKER

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.
Avatar of jkj81

ASKER

Issue resolved.
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial