SQL.SetClient
-------------

Assigns an DBMS client for the connection.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SQL](component_SQL.md) | [2.6](newinversion26.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SQL.SetClient"; Connection; Client ) 

**MBS**( **"SQL.SetClient";** /\* Assigns an DBMS client for the connection. \*/  
**$Connection**; /\* The connection reference number gained with [SQL.NewConnection](SQLNewConnection.md). \*/   
**$Client**) /\* The name of the database client to use.e.g. "SQLite" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Connection | The connection reference number gained with [SQL.NewConnection](SQLNewConnection.md). | $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](SQLSetConnectionOption.md) first.  
  
You don't need SQL.SetClient when you pass client to [SQL.Connect](SQLConnect.md) and you should call [SQL.SetConnectionOption](SQLSetConnectionOption.md) 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](FMSQLInsertRecordsToSQL.md)
- [SQL.ClientVersion](SQLClientVersion.md)
- [SQL.Connect](SQLConnect.md)
- [SQL.Execute](SQLExecute.md)
- [SQL.NewCommand](SQLNewCommand.md)
- [SQL.NewConnection](SQLNewConnection.md)
- [SQL.SetConnectionOption](SQLSetConnectionOption.md)
- [SSH.Tunnel.Run](SSHTunnelRun.md)

### Release notes

- **Version 15.4**
    - Added OLEDB for the client types in [SQL.SetClient](https://www.mbsplugins.eu/SQLSetClient.shtml).
- **Version 12.3**
    - Added MariaDB as option for [SQL.SetClient](https://www.mbsplugins.eu/SQLSetClient.shtml) function.

### Example Databases

- [SQL in FileMaker/Insert or Update Tests](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20in%20FileMaker/Insert%20or%20Update%20Tests.shtml#14ScriptAnchor_)
- [SQL to other databases/Firebird Query](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/Firebird%20Query.shtml#1ScriptAnchor_)
- [SQL to other databases/Microsoft SQL Execute](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/Microsoft%20SQL%20Execute.shtml#1ScriptAnchor_)
- [SQL to other databases/Microsoft SQL Server Connect](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/Microsoft%20SQL%20Server%20Connect.shtml#1ScriptAnchor_)
- [SQL to other databases/Microsoft SQL Server Query](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/Microsoft%20SQL%20Server%20Query.shtml#1ScriptAnchor_)
- [SQL to other databases/MySQL example](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/MySQL%20example.shtml#6ScriptAnchor_)
- [SQL to other databases/ODBC Query](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/ODBC%20Query.shtml#1ScriptAnchor_)
- [SQL to other databases/SQLite blob](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/SQLite%20blob.shtml#4ScriptAnchor_)
- [SQL to other databases/SQLite fun](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/SQLite%20fun.shtml#4ScriptAnchor_)
- [Third Party/FileMaker Snippet Storage](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Third%20Party/FileMaker%20Snippet%20Storage.shtml#38CustomFunctionAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 15.4pr5](https://www.mbsplugins.de/archive/2025-09-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.3pr5](https://www.mbsplugins.de/archive/2022-06-27/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Using TLS when connecting to MySQL server](https://www.mbsplugins.de/archive/2020-08-20/Using_TLS_when_connecting_to_M/monkeybreadsoftware_blog_filemaker)
- [ODBC driver and MBS SQL Functions in FileMaker](https://www.mbsplugins.de/archive/2020-04-23/ODBC_driver_and_MBS_SQL_Functi/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2016, Seite 28](https://filemaker-magazin.de/neuigkeit/3876-Appetithappen-FMM_201604)
- [Ausgabe 3/2016, Seite 29](https://filemaker-magazin.de/neuigkeit/3883-Appetithappen-FMM_201603)
- [Ausgabe 1/2016, Seite 28](https://filemaker-magazin.de/neuigkeit/3870-Appetithappen-FMM_201601)
- [Ausgabe 4/2015, Seite 15](https://filemaker-magazin.de/neuigkeit/3822-Appetithappen-FMM_201504)

This function is free to use.

Created 18th August 2014 , last changed 31st August 2025

  
[SQL.SetAutoCommit](SQLSetAutoCommit.md) - [SQL.SetCommandOption](SQLSetCommandOption.md)

[HTML Version](SQLSetClient.shtml)