ERROR [IM004] [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_Handle_ENV failed

Can someone help me to resolve this error?

Trying to make connection with Oracle Database 12c Release 2 (12.2.0) on Windows Server 2016 using below connection details.

Connection String: “Driver={Microsoft ODBC for Oracle};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=x.x.x.x)(PORT=1521)));Uid=USERID;Pwd=PASSWORD;”

Provider Name: “System.Data.Odbc”

Hi @naeem.abro

Is it resolved? Please let me know, I am also struck with same problem.


Had the same error when hosting .asp website that was making a connection to an Oracle database using the ODBC driver on Windows 2016 server. Found the below steps on a site. Couldn’t paste the link so I copied the steps.

This can occur if you have an invalid or incorrect PATH variable. To check your PATH variable:

  1. Right-click My Computer
  3. Locate the PATH variable and copy it"s contents to a text editor such as notepad

Once you have done this you should now look for the following:

  1. A missing semicolon between the different application paths. Each application path in the list should be separated by a semicolon.
  2. Look for spaces between the semicolon and the next application path. Remove any spaces.
  3. If you have more than one Oracle installation, make sure the latest version appears in the PATH before any older versions. If you have uninstalled older versions and references still exist in the PATH then remove them.

If the PATH appears fine then the issue may be rights related.

  1. Opened up Windows Explorer
  2. Navigated to Oracle | ora92
  3. Right clicked and selected properties
  4. Clicked on Securities tab
  5. Clicked on Authenticated Users
  6. Unchecked Read and Execute | Click Apply
  7. Rechecked Read and Execute | Click Apply
  8. Clicked ok to close window
  9. Restart server

I had the same issue. But when i ran the UiPath with admin access, it started working.


Hello ,

I have installed Oracle Database Server 12 C 64 bit and Oracle Database Client 12C 64 bit.
I can connect Database with OCBC Driver . But when I opened web site from IIS . Error is showing like that picture and as below.

Microsoft OLE DB Provider for ODBC Drivers error ‘80004005’
[Microsoft][ODBC Driver Manager] Driver’s SQLAllocHandle on SQL_HANDLE_ENV failed
/include/connection.asp, line 64

I have already tried as you advised .But it doesn’t works. Please advise .

Oracle Database client install for 32 bit version

Hope this will resolves the issue


1 Like

Hi, I also installed oracle for 32 bit version. But it is showing this error.

Ok, after installation of 32 bit version, did you reconfigure the new ODBC connection in System DSN?


Hi, I also installed 32 bit and can connect database. But it is still showing the same error.

Can you share me the System DSN screenshot and error screenshot once again


I tried to install with 32 bit. After 32 bit installation , even though I can connect with odbc, I cannot connect with sql plus. So I connect with 64 bit odbc, it works for odbc. But below error is still showing.
Microsoft OLE DB Provider for ODBC Drivers error ‘80004005’

[Microsoft][ODBC Driver Manager] Driver’s SQLAllocHandle on SQL_HANDLE_ENV failed

/include/connection.asp, line 55


It is 32 bit odbc. but still showing below error.
Microsoft OLE DB Provider for ODBC Drivers error ‘80004005’

Specified driver could not be loaded due to system error 5: Access is denied. (Oracle in OraClient12Home1_32bit, C:\app\client\htunaungh\product\12.2.0\client_1\BIN\SQORA32.DLL).

/include/connection.asp, line 55

i have the same problem, how you resolved this problem?