MSSQL Server and SQLDatabaseMBS

Suddenly I’m not able to connect to a MS SQL from Mac database using the MSB plugin.
This was working great. I’m not sure when it broke, because my solution uses several databases and not all the users are on Mac.

I’m even running the example project and it’s not working.
I get the following error.

IM004 [iODBC][Driver Manager]Driver’s SQLAllocEnv() failed

Anyone know how to get around this?

I had the same issue when I purchased a new Mac with the M2 processor. My Mac with the Intel processor worked perfectly, but when I tried with the new Mac, I got the same error. I finally contacted Christian, and his solution worked perfectly…

ODBC can’t initialize. We need to load the library directly. So we set library automatically:
Option(“ODBC.LIBS”) = “/usr/lib/libiodbc.2.dylib”
You could change it to:
Option(“ODBC.LIBS”) = libtdsodbc.NativePath

I have had no issues since with any of my Macs.



This error means the very early call to allocate memory for the driver fails. We are not sure why this happens.

We adjusted the MBS Xojo SQL Plugin to directly load tdsodbc library as a work around. if you notice anything like an error message that would point to why it fails allocating the data structure, please let us know.

1 Like

That resolved it. Thanks so much!