| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
SQL.SetClient
Assigns an DBMS client for the connection.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| SQL | 2.6 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "SQL.SetClient"; Connection; Client ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| Connection | The connection reference number gained with SQL.NewConnection. | $Connection |
| Client | The name of the database client to use. | "SQLite" |
Result
Returns "OK" on success.
Description
Assigns an DBMS client for the connection.You can set a client in Connect method, in this case you don't need to use setClient method. The main destination of this method is to connect to a server with no connection to a database (for example, to check a client availability and version). But if you are calling Connect method with no specified client you have to use setClient method before.
If you are calling setClient method when the connection is set to another client the previous connection will be disconnected and new client will be set.
Pass one of this values: CubeSQL, SQLAnywhere, ODBC, Oracle, SQLServer, Firebird, InterBase, SQLBase, DB2, DuckDB, Informix, Sybase, MySQL, MariaDB, PostgreSQL, OLEDB or SQLite.
Connect to Microsoft Access, FileMaker Server (or Pro), Microsoft Visual FoxPro and others via ODBC.
Be aware that for most database servers, you need to specify client library with SQL.SetConnectionOption first.
You don't need SQL.SetClient when you pass client to SQL.Connect and you should call SQL.SetConnectionOption before those.
Examples
Sets client to be SQLite:
MBS( "SQL.SetClient"; $Connection; "SQLite" )
Sets client to be Oracle:
MBS( "SQL.SetClient"; $Connection; "Oracle" )
See also
- FM.SQL.InsertRecordsToSQL
- SQL.ClientVersion
- SQL.Connect
- SQL.Execute
- SQL.NewCommand
- SQL.NewConnection
- SQL.SetConnectionOption
- SSH.Tunnel.Run
Release notes
- Version 15.4
- Added OLEDB for the client types in SQL.SetClient.
- Version 12.3
- Added MariaDB as option for SQL.SetClient function.
Example Databases
- SQL in FileMaker/Insert or Update Tests
- SQL to other databases/Firebird Query
- SQL to other databases/Microsoft SQL Execute
- SQL to other databases/Microsoft SQL Server Connect
- SQL to other databases/Microsoft SQL Server Query
- SQL to other databases/MySQL example
- SQL to other databases/ODBC Query
- SQL to other databases/SQLite blob
- SQL to other databases/SQLite fun
- Third Party/FileMaker Snippet Storage
Blog Entries
- MBS FileMaker Plugin, version 15.4pr5
- MBS FileMaker Plugin, version 12.3pr5
- Using TLS when connecting to MySQL server
- ODBC driver and MBS SQL Functions in FileMaker
FileMaker Magazin
This function is free to use.
Created 18th August 2014, last changed 31st August 2025