Jump to content
Salesforce and other SMB Solutions are coming soon. ×

ODBC driver and MBS SQL Functions in FileMaker


Monkeybreadsoftware
 Share

Recommended Posts

  • Advertiser

We have made a ton of example code in the last decade showing how to connect to Microsoft SQL Server from MacOS or Linux using FreeTDS and our MBS FileMaker Plugin. And there are two ways to do it:

1. With loading driver directly

Set Variable [$result; Value: MBS("SQL.SetClient"; $Connection; "ODBC")]
#Tell plugin where freetds library is
Set Variable [$result; Value: MBS( "SQL.SetConnectionOption"; $Connection; "ODBC.LIBS"; "/Users/cs/Desktop/libtdsodbc.dylib")]
#Connect to database
Set Variable [$result; Value: MBS("SQL.Connect"; $Connection; "DRIVER={FREETDS};Server=192.168.2.32;UId=SA;PWD=test;Database=test;TDS_VERSION=7.2;Port=1433")]

As you see, we point to the dylib as ODBC library, load it and connect through it.

2. With loading iODBC and having driver in connection string

Set Variable [$result; Value: MBS("SQL.SetClient"; $Connection; "ODBC")]
#Tell plugin where freetds library is
Set Variable [$path; Value: "/Users/cs/Desktop/libtdsodbc.dylib" ]
#Connect to database
Set Variable [$result; Value: MBS("SQL.Connect"; $Connection; "DRIVER={" & $path & "};Server=192.168.2.32;UId=SA;PWD=test;Database=test;TDS_VERSION=7.2;Port=1433")]

As you see, we let the plugin load libiodbc.dylib (ODBC manager) and then have it load the library.

What is better?

Both ways do work, so for most customers there is no difference. But the second way is better as the libiodbc does some additional services like text encoding conversations, provide additional functions like a directory of the various database drivers, functions to browser for databases and a way to work with data sources.

So we recommend in general that all customers prefer the second way over the ODBC manager to make sure all things work well. For the next weeks, we'll try to update a couple of blog posts and examples projects.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use