Subscribe to this thread
Home - General / All posts - Excel Manifold ODBC ERROR
davebic24 post(s)
#07-Mar-23 15:51

Please bear with me because I believe this is more of a Excel question than a Manifold question. I'm hoping that someone has has a similar experience.

I am attempting to connect to a Manifold database in Desktop Excel 365 via ODBC. Failed connection, Error message as follows.

Details: "ODBC: ERROR [IM004] [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed"

This error message has been googled and none of the resolution approaches seem to apply.

I know the the ODBC connection works because have have opened the same Manifold dataset in both MS Access and Tibco Spotfire. This suggests the error lies in Excel. I have used this Manifold ODBC many times without issue. Troubleshooting, I have tried different Excel Trust settings and running a repair on SQL_HANDLE_ENV.

Excel will connect to an Access DB with via ODBC but will not connect to a Manifold or a MySQL DB. MySQL throws the same error when attempting to connect to Excel via ODBC.

Specifics: Windows 11, Manifold and Excel are 64 bit & Manifold ODBC driver is installed

I truly appreciate and help or guidance that this community can provide.


10,447 post(s)
#09-Mar-23 08:49

The error suggests that our driver fails to initialize for some reason. We'll try to reproduce the issue.

Thanks for the note, the details really help.

davebic24 post(s)
#12-Mar-23 03:33

Any progress or thoughts on this error? Thanks.


10,447 post(s)
#17-Mar-23 13:42

Well, yes. We have not been able to reproduce the issue so far, but we only tried the most straightforward things plus we did not replicate your configuration exactly, so maybe we will still be able to reproduce it. It does look like something on part of Excel. As in, nothing for us to fix.

Let's try two workarounds:

Try connecting from Excel to Manifold not directly via ODBC, but through OLE DB. That is: Excel -> add OLE DB data source for the following provider: Microsoft OLE DB Provider for ODBC Drivers -> connect to the Manifold ODBC driver.

Try adding a link to Manifold to an Access database (add a couple of pass-through queries), then connect from Excel to that database.

davebic24 post(s)
#17-Mar-23 15:30

Thank you Adam. Just a few more details if you want to continue to work on the issue.

1. I was able to open the Manifold ODBC file smoothly in Power BI in addition to Spotfire and Access

2. I posted on Microsoft's Q&A board, the response to my issue was:

"Based on the error message, the ODBC connected to the GIS databas is not compatible.

I suggest you try to update the ODBC driver and check the result."

3.I was able to recreate the same original error message on a different machine running Excel 365 on Windows 10 rather than 11.

Details: "ODBC: ERROR [IM004] [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed"

4. The Access work around seems quite arduous for what should be a simple ODBC connection.

5. The OLE DB work around produced this error message.

Maybe there are some other members of this forum that would like to try to connect to Excel 365 via ODBC?

Thanks again for your efforts.


10,447 post(s)
#20-Mar-23 11:22

This really helps.

Especially, item 5 -- apparently Excel 365 connects to OLE DB / ODBC via .NET. This is a bit of a surprise, normally apps like that use ODBC through native code (I guess this is why other apps that you mention can connect just fine, they are connecting 'normally'). But this does allow us to test better.

We'll run more tests, thanks.

davebic24 post(s)
#01-Apr-23 18:37

Any luck with this Adam?


10,447 post(s)
#04-Apr-23 13:21


We found the reason for the issue. Excel 365 is calling Manifold from a thread that is using a different COM threading model than we require (likely because when they switched their ODBC code to .NET they didn't bother controlling COM and let .NET set it up - by default .NET goes for the most modern model, not for the most compatible one like we do). We adjusted our code to allow the calling thread to use any model. This applies to both calling Manifold via the ODBC driver as well as calling it via the COM / .NET API.

The change will appear in the next build. The next build is expected either (late) this week or (early) next week.

Thanks for reporting the issue!

607 post(s)
#04-Apr-23 14:51

Interesting. Tableau used to give similar error with Manifold odbc. I haven't tested lately.

davebic24 post(s)
#04-Apr-23 16:26

Thank you Adam.

davebic24 post(s)
#21-May-23 22:09

It does not appear that this issue has been resolved with the latest build. Any fixes on the horizon?



10,447 post(s)
#22-May-23 11:28

We were getting reports from people with similar issues that fixed them. If your issue is not fixed, please contact tech support. (Can it be that after you installed or, you did not re-register the ODBC driver to point to the new build in Help - About?)

davebic24 post(s)
#23-May-23 14:55

Operator error. I works now, thank us.

davebic24 post(s)
#23-May-23 21:32

Now it appears that ODBC works perfect in Excel 365 but no longer works in Power BI. Appears to be a Microsoft glitch.


10,447 post(s)
#27-May-23 09:13

Yes, we have a few ideas as to what this might be about, we'll contact via tech support.

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.