ODBC Driver for SQLite

Connection String Options - ODBC Driver for SQLite

SQLite Connection Options

The following table describes the options that you can include in the connection string for SQLite:

Option Description


Used to set the path to the SQLite3 client library. E.g., C:\Windows\System32\sqlite3.dll


Used to specify the name of the database to be used once a connection is open.


Used to connect to the database directly without using SQLite3 client library.


Specifies the encryption algorithm that will be used to connect to an encrypted database. The attribute value has to be one of the following according to supported encryption algorithms: TripleDES, Blowfish, AES128, AES192, AES256, Cast128, RC4.


Specifies the encryption key that will be used to encrypt a previously connected unencrypted database.

Advanced Settings

Option Description

Allow NULL strings

To retrieve metadata, not all parameters according to MSDN can accept a null value. If NULL, the driver should return an error. But some 3rd-party tools pass NULL to the parameters. These options should be enabled for compatibility with such tools.

Empty strings as NULL

Busy Timeout

Used to set the busy timeout duration in milliseconds, or disable busy handlers. A busy handler will sleep for a specified amount of time when a table is locked. After the specified time has elapsed, an exception is raised. Setting the timeout to 0 will disable all busy handlers. The default value is 15.

Cipher License

To use the SQLCipher Commercial Edition library for encrypting SQLite database files, insert your SQLCipher license key into the field. Note that the option is not available in Direct mode.

Enable Shared Cache

Enables multiple connections to the same database to share a single data and schema cache. The shared-cache mode is intended for use in embedded servers. The default value is True.

ODBC Behavior

Used to set the behavior corresponding to the ODBC specification version that a third-party tool expects. The behavior of ODBC driver can be changed by setting a value for the SQL_ATTR_ODBC_VERSION attribute by calling the SQLSetEnvAttr function. But some third-party tools expect the driver to exhibit ODBC 2.x behavior, but forget to call SQLSetEnvAttr with the specified version or pass an incorrect value there. In this case, the required behavior can be explicitly specified in the Connection String by setting the ODBC Behavior parameter. The possible values are:

  • Default - default ODBC behavior determined by a third-party tool.
  • Ver 2.x - ODBC 2.x behavior is explicitly set.
  • Ver 3.x - ODBC 3.x behavior is explicitly set.

String Types

Sets the string value types returned by the driver as Default, Ansi or Unicode.

  • Default - the driver defines the string types.
  • Ansi - all string types will be returned as SQL_CHAR, SQL_VARCHAR and SLQ_LONGVARCHAR.
  • Unicode - all string types will be returned as SQL_WCHAR, SQL_WVARCHAR and SLQ_WLONGVARCHAR.

The option value should be changed if any third-party tool supports only Ansi string types or Unicode ones.


Used to force connection to create a new database before opening a connection, if the database does not exist.


If False, fields of unknown data types (for example, the ifnull function result) are mapped to SQL_LONGVARCHAR. SQL_LONGVARCHAR is used because maximum length of values from such fields is unknown. If True, fields of unknown data types are mapped to SQL_VARCHAR. Size of fields is set to 8192. Values larger than this size are truncated. The default value is False.


Enables using local regional settings when converting numbers to string.


Enables using local regional settings when converting dates and times to string.

Sample SQLite ODBC Connection String in Direct Mode

DRIVER={Devart ODBC Driver for SQLite};Database=D:\test.db3

Sample SQLite ODBC Connection String Using Client Library

DRIVER={Devart ODBC Driver for SQLite}; Direct=False; Database=D:\test.db3; Client Library=D:\SQLite3.dll

© 2015-2020 Devart. All Rights Reserved. Request Support ODBC Forum Provide Feedback