My Computer: Mac Mini M2 Pro with macOS 14.6.1
iODBC Administrator has Version 3.52.16 (latest Version)
ODBC Driver 18 for SQL Server has Version 18.4.1.1 (latest Version)
And after pressing OK I get a popup with the following content:
[iODBC][Driver Manager]dlopen(/opt/homebrew/Cellar/msodbcsql18/18.4.1.1/lib/libmsodbcsql.18.dylib, 0x0006): tried: ‘/opt/homebrew/Cellar/msodbcsql18/18.4.1.1/lib/libmsodbcsql.18.dylib’ (mach-o file, but is an incompatible architecture (have ‘arm64’, need ‘x86_64’)), ‘/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/msodbcsql18/18.4.1.1/lib/libmsodbcsql.18.dylib’ (no such file), ‘/opt/homebrew/Cellar/msodbcsql18/18.4.1.1/lib/libmsodbcsql.18.dylib’ (mach-o file, but is an incompatible architecture (have ‘arm64’, need ‘x86_64’))
I thought I was doing the right thing by installing the ARM64 drivers on my MacMini M2 Pro. This was done automatically with the Microsoft installer.
Now it looks to me that the ODBC Driver Manager has X86_64 and can’t do anything with an ARM64 driver.
Microsoft says that it will install the X86_64 driver if the command prompt is running in X64 emulation mode. How do you do that? This is a mystery to me.
The Microsoft-provided ODBC driver for Mac is compiled using the unixODBC library standard (used by most of the Linux world). Most Mac ODBC-enabled applications (including the Xojo plugin, MS Excel, FileMaker, etc) are compiled using the competing iODBC library standard. Because of this, nearly all ODBC drivers on the Mac are compiled using iODBC. An iODBC application cannot use a unixODBC driver.
Finally decided to try the Monkey Bread plugin MS SQL Plugin as an alternative to using the Microsoft driver and XOJO SQL plugin.
It works as soon as I matched the architecture of the MACOS build setting to the architecture of FreeTDS driver that you need to install.
Christian provides a sample app that I started with and I just changed the architecture to “ARM 64-bit” and then copied the driver file (libtdsodbc.dylib for “Mac 64-bit ARM”) and substituted my connection information for SQL Server and it connected and I was able to select a rowset without any problems.
For $ 149 it’s a steal when you consider how much time I’ve wasted trying to use MS’s driver.
I’m uploading a copy of the sample project with some slight mods that I made. You download the FreeTDS driver from here.
I should one little issue I ran into with the Copy File Step in my build settings. I had to put the libtdsodbc.dylib driver in the MacOS folder of my debug build. It would not load it if I put it in the Resources folder. Just wanted to add that.