MSSQL driver support for xojo on mac/linux

Hello,

I’d like to inquiry about mssql support on platforms other than Windows. Since quite a while Microsoft ODBC drivers are available for linux and mac (https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017) so I’d like to know if there are any plan to add linux or mac mssql connectivity to Xojo.

Have-you seen this file (ODBCPlugin.xojo_plugin) in the PlugIns folder ?

ODBC is not MSSQL Emile.

I seem to misunderstand what you meant there…

I was thinking you are using ODBC to access MSSQL.

Sorry.

@Emile Schwarz The Microsoft ODBC driver is used by c++/c# apps running on linux/mac to access mssql databases, which is something xojo is not currently able to. Microsoft has moved that package into stable not that long ago but enough to warrant investigation IMHO :slight_smile:

I am unsure of what to understand…

So, Xojo ODBC Plugin is not able to deal with mssql databases ?

[quote=417526:@Emile Schwarz]I am unsure of what to understand…

So, Xojo ODBC Plugin is not able to deal with mssql databases ?[/quote]

MSSQL databases can be used by xojo ONLY ON WINDOWS, mac and linux require postgres or oracle. Until a few years back there was no option to use MSSQL on linux and no options to connect a linux/mac software to mssql beside java or paid for drivers. Microsoft has released both a mssql build for linux and drivers for linux(compatible with brew to be ran on mac) so there shouldn’t be any blockers for support.

OK. Thanks Matteo.

I am on MacOS and I have that Plugin thus what I wrote above…

Last time i attempted to use mssql on mac(and the Microsoft driver wasn’t yet stable) that plugin was an empty placeholder that didn’t do anything. It was just to make sure cross platform build didn’t crash due to the missing file.

Maybe.

The file is in fact a zip archive. It holds a “Build Resources” folder with these folders:

Linux ARM
Linux X86
Linux x86-64
Mac Carbon Mach-O
Mac Cocoa
Windows
Windows x86-64

Each one holds a library (dll, dylib, ÷). I do not know what they are for.

You may try it (spend some minutes with it just to know…

Now a Plug in compiled in 2018 with Carbon in its title… and obviously with 32 bits versions ?

A simple search in the blog returns:

http://blog.xojo.com/2013/06/19/database-connectivity-with-xojo/

Edit:
You may read the other MSSQL Forum conversation (today) for more data.

But, ODBC can talk to MS SQL as well as other types of databases.

I have been using the ODBCPlugin for many years (circa 2007) to talk through a DSN / ODBC connection for MS SQL Server, successfully talking to SQL Server 2005 and above. So, I don’t know what you mean by “not stable”.

I use MBSPlugins to access a selectLine MSSQL Database just like any other SQL Database.

The essential Code looks like this (not my current code, but what i started with using @Christian Schmitz examples):

[code]// WaWi_DB_MBS is a SQLDatabaseMBS

#If TargetWindows Then

WaWi_DB_MBS.Option(“UseAPI”) = “OLEDB”
WaWi_DB_MBS.Option(“SQLNCLI10.LIBS”) = “sqlsrv32.dll” // Library included in Windows Vista and newer
WaWi_DB_MBS.UserName = WaWi_Login
WaWi_DB_MBS.Password = WaWi_Password
WaWiConnection.ConnectMT(WaWi_ServersAddress + “@SL_DATABASE_NAME”, WaWi_Login, WaWi_Password, SQLConnectionMBS.kSQLServerClient) // PcName\SqlServerInstanceName@DatabaseName

#ElseIf TargetMacOS

dim libtdsodbc as FolderItem
libtdsodbc = App.ExecutableFile.Parent.Parent.Child(“Resources”).Child(“libtdsodbc.dylib”) // A copy into Resources Step in the Build Settings

Dim s As New SoftDeclareMBS
Call s.LoadLibrary(libtdsodbc.NativePath)

Dim cs As String = “Driver={FREETDS};Server=” + WaWi_ServersAddress + “;UId=” + WaWi_Login + “;PWD=” + WaWi_Password + “;Database= SL_DATABASE_NAME;TDS_VERSION=7.2;Port=1433”

WaWiConnection.SetFileOption WaWiConnection.kOptionLibraryODBC, libtdsodbc
WaWiConnection.Option(“UseAPI”) = “ODBC”
WaWiConnection.ConnectMT(cs, “”, “”, SQLConnectionMBS.kODBCClient)
WaWiConnection.Option(“ODBCAddLongTextBufferSpace”) = “false”

#EndIf[/code]

Here is a blog article about conning to MS SQL cross-platform with MBS Xojo SQL Plugin:

Crossplatform connection to Microsoft SQL Server in Xojo

+1 for MBS SQL Plugin.