MSSQL driver support for xojo on mac/linux

  1. last year

    Matteo S

    11 Dec 2018 Pre-Release Testers, Xojo Pro Trieste(TS), Italy

    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.

  2. Emile S

    11 Dec 2018 Europe (France, Strasbourg)

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

  3. Massimo V

    11 Dec 2018 Pre-Release Testers, Xojo Pro Europe (Germany, Würzburg)

    ODBC is not MSSQL Emile.

  4. Emile S

    11 Dec 2018 Europe (France, Strasbourg)

    @Matteo S Since quite a while Microsoft ODBC drivers are available

    I seem to misunderstand what you meant there…

    I was thinking you are using ODBC to access MSSQL.

    Sorry.

  5. Matteo S

    11 Dec 2018 Pre-Release Testers, Xojo Pro Trieste(TS), Italy

    @Emile S 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 :)

  6. Emile S

    11 Dec 2018 Europe (France, Strasbourg)

    I am unsure of what to understand…

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

  7. Matteo S

    11 Dec 2018 Pre-Release Testers, Xojo Pro Trieste(TS), Italy
    Edited last year

    @Emile S I am unsure of what to understand…

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

    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.

  8. Emile S

    11 Dec 2018 Europe (France, Strasbourg)

    OK. Thanks Matteo.

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

  9. Matteo S

    11 Dec 2018 Pre-Release Testers, Xojo Pro Trieste(TS), Italy
    Edited last year

    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.

  10. Emile S

    11 Dec 2018 Europe (France, Strasbourg)
    Edited last year

    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.

  11. Terry E

    11 Dec 2018 Pre-Release Testers, Xojo Pro Spokane, WA

    @Massimo V ODBC is not MSSQL Emile.

    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".

  12. Sascha S

    11 Dec 2018 Pre-Release Testers, Xojo Pro Germany, Lower Saxony

    @Matteo S MSSQL databases can be used by xojo ONLY ON WINDOWS, mac and linux require postgres or oracle.

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

  13. Sascha S

    11 Dec 2018 Pre-Release Testers, Xojo Pro Germany, Lower Saxony
    Edited last year

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

    // 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
  14. Christian S

    12 Dec 2018 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany
    Edited last year

    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

  15. Tanner L

    is not verified 12 Dec 2018 Pre-Release Testers to.on.ca

    +1 for MBS SQL Plugin.

or Sign Up to reply!