SQL Database Drivers Client Usage

When using SQL database drivers, every workstation connecting to the SQL Database must have a database client installed.

In general it is recommended to use the same client and server versions.  Using older client with newer server versions may work, but in some situations (for example when newer server data types are used) not all features are supported.

The DataFlex SQL Drivers provide configuration options to ensure the correct database client is used.

Microsoft SQL Server Clients

When using the DataFlex SQL Server Driver to connect to Microsoft SQL Server, the following applies:

The table below lists the available Microsoft SQL Server client versions:

Client Name

SQL Server Version

Version Number

SQL Server

SQL Server 2000 Client

8

SQL Native Client

SQL Server 2005 Client

9

SQL Server Native Client 10.0

SQL Server 2008 Client

10

SQL Server Native Client 11.0

SQL Server 2012 Client

11

ODBC Driver 11 for SQL Server

SQL Server 2014 Client

12

ODBC Driver 13 for SQL Server

SQL Server 2016 Client

13

ODBC Driver 17 for SQL Server

SQL Server 2017 Client

17

It is possible to have multiple client versions installed on a workstation. In the Windows ODBC administrator program (32-bit version!) all installed clients can be viewed on the “Drivers” tab page.

The DataFlex SQL Server driver will always use the highest installed SQL Server client version. The highest installed SQL Server client is displayed in the Help/About/System info.

The highest installed SQL Server client can be queried in a program with DF_DRIVER_SQLSERVER_CLIENT_VERSION attribute. The attribute returns the version number from the table above. The cMSSQLHandler class in Mssqldrv.pkg contains constant definitions for supported clients.

Use of an older client with a newer SQL Server version can in some situations cause problems. One known issue is the use of the SQL Server ‘date’ type. This type was introduced in SQL Server 2008 and is not recognized by older clients. An older client will return SQL dates as string (DF_ASCII), which can cause incorrect date values in the database.

On most Windows systems the “SQL Server (SQL Server 2000 client)” is installed as part of Windows. If no newer client is explicitly installed, that is the client that will be used. This may lead to a situation where a too old client is used.

The "SQL Server Native Client 11.0" is the last "Native Client" version. There is no native client version for SQL server 2014 and higher (but they are still provided with SQL Native Client 11.0). The successors for SQL Native Client are:

When downloading and installing SQL Server clients on 64-bit systems, choose the x64 version. This will install both 64-bit and 32-bit ODBC drivers. The DataFlex SQL Server driver will use the 32-bit version.

Minimum Client Version

The DataFlex SQL Drivers can be configured to check for a minimum client version to be installed. This can be specified with the Minimum_Client_Version setting in driver configuration file (mssqldrv.int, db2_drv.int, odbc_drv.int), or at runtime with the DF_Driver_Minimum_Client_Version attribute.

The minimum client version check will be performed during login. This could be an explicit login command in the program, or a login that occurs as part of the first open. If the minimum client version is not installed on the workstation, a fatal error will be raised.

Match Client Server Version

The  DataFlex SQL drivers can be configured to check for matching database server and client versions. This can be specified with the Match_Client_Server_Version setting in driver configuration file (mssqldrv.int, db2_drv.int, odbc_drv.int), or at runtime with the DF_DRIVER_MATCH_CLIENT_SERVER_VERSION  attribute.  

The match_client_server_version setting can be set to True (1) or False (0). By default the setting is False. In that case no check is performed.

The match_client_server_version check will be performed during login. This could be an explicit login command in the program, or a login that occurs as part of the first open. If the client version is less than the server version, an error will be raised when connecting to the server.