FreeTDS for SQL Server on Mac

I am working on a tool that will connect to an existing SQL Server DB. I have tried various methods of getting FreeTDS to work in Xojo, but I can’t seem to get it working. My closest attempt so far was compiling from source both iODBC and FreeTDS. I can then connect to the db directly with tsql on the command line, but when trying it from Xojo I got an error message that indicated the driver lib was of the wrong type. It said something about Mach-o. That made me think it was a 64 bit / 32 bit thing, but I can’t seem to figure out how to compile it 32 bit or universal.

After getting fed up with FreeTDS myself, I used these drivers before working for Xojo and they worked quite well:

http://www.actualtech.com

I use the MBS SQL Plugin from @Christian Schmitz with these Drivers and i am very satisfied with the performance.

These have workedfine formeas well
https://forum.xojo.com/17600-unable-to-connect-to-mssql-server-2008-r2-database/p1#p145976

So I managed to get it working somewhat. It’s flaky though. I can connect and get a record set once. The second time always kills the app and there is no error message. I just get dumped out with the application off line icon in the browser.

I’m using the ODBC Manager from odbcmanager.net, and the latest freetds and iodbc. I have a DSN set up and I can connect from iodbctest and execute queries without any trouble. I’m not sure what the problem is with Xojo.

In Xojo from a built app this is what’s happening. I’m getting failed assertions.

Assertion failed: (p+1-out <= o_len), function odbc_wide2utf, file odbc_util.c, line 244.
Abort trap: 6

[quote=218052:@Kevin Windham]So I managed to get it working somewhat. It’s flaky though. I can connect and get a record set once. The second time always kills the app and there is no error message. I just get dumped out with the application off line icon in the browser.

I’m using the ODBC Manager from odbcmanager.net, and the latest freetds and iodbc. I have a DSN set up and I can connect from iodbctest and execute queries without any trouble. I’m not sure what the problem is with Xojo.

In Xojo from a built app this is what’s happening. I’m getting failed assertions.

Assertion failed: (p+1-out <= o_len), function odbc_wide2utf, file odbc_util.c, line 244.
Abort trap: 6[/quote]
I remember after having defined and used a variable as record set, I had to set it to Nil before being able to reuse it again. This was for odbc connections only.
Maybe you are running into something like this?

FreeTDS is working well for me on Mac with SQLDatabaseMBS, but can’t get Linux working with it yet (I have Christian’s drivers).

That’s unfortunate. I was planning to deploy this on Linux once I get it all working. Anybody using ODBC on linux successfully?

What does Xojo test with on Linux. Only iODBC or are there others? It would be nice to at least have some idea of what’s known to work. iODBC is the only thing I see mentioned in the language reference.

I filed a feature request to add Mac and Linux support to the SQL Server plugin using FreeTDS. I think FreeTDS is working well and going through it directly from a plugin and bypassing ODBC would make a lot of sense. Probably not going to happen anytime soon, but I can imagine it would save a lot of people who need to connect to SQL Server a lot of trouble.

<https://xojo.com/issue/41033>