ODBC Driver for xBase

Connection String Options - ODBC Driver for xBase

FoxPro, dBase, Clipper ODBC Connection String Options

The following table lists the connection string options for FoxPro2, VisualFoxPro, dBase, Clipper, and other DBF formats.

Option Description
AllFieldsAsNullable Used to open DBF tables with incorrect data (tables that have records with null values in non-nullable columns). The default value is False.

Allow NULL strings

To retrieve metadata, some parameters do not accept NULL values, and an exception is raised if a NULL value is passed. Enable these options for compatibility with those 3rd-party tools that pass NULL values to the parameters.

Empty strings as NULL


Used to specify the folder in which the database files are located.

DBF Format

Used to specify the default database format that will be used when creating new tables and working with indexes. Available values: Auto, dBaseIII, dBaseIV, dBaseV, dBaseVII, FoxPro2, VisualFoxPro, HiPerSix, Codebase and Clipper. Default value is Auto. When using Auto, for each separate table, the format is detected by its DBF file header. For any other values, DBF file header will be ignored. The format from the DBFFormat value will be forced used for all tables in the folder.

Code Page

Used to specify a code page when working with a database. Available values: Default, UnitedStatesOEM, GreekDOS, WesternEuropeanDOS, TurkishDOS, CentralEuropeanDOS, PortugueseDOS, IcelandicDOS, FrenchCanadianDOS, NordicDOS, CyrillicDOS, Thai, Japanese, ChineseSimplified, ChineseTraditional, Korean, CentralEuropeanANSI, CyrillicANSI, WesternEuropeanANSI, GreekANSI, TurkishANSI, HebrewANSI, ArabicANSI and BalticANSI. Default value is Default.

Connect Mode

Used to specify how applications access DBF table files.

Only one application can access the table file at a time. The active application holds read/write lock on the file to prevent other applications from reading or writing to it.

The default value. Multiple applications can concurrently read/write to the same table. The active application holds read/write lock on the table file, but releases the lock once it has finished reading or writing the data.

Multiple applications can concurrently read and write to the table file. This mode should be used with caution because it allows multiple applications to modify the file simultaneously. Since DBF databases do not support transactions, an attempt to change the same file simultaneously by multiple application can cause data corruption in the table file.


If set to True, corrupted tables in the directory will be ignored, and an exception won't be raised. The default value is False.


If set to True, corrupted data errors will be ignored when opening a DBF table, and an exception won't be raised. The default value is False.


If set to True, errors in database indexes will be ignored when opening a DBF table, and an exception won't be raised. The default value is False.


If set to True, metadata errors will be ignored when opening a DBF table, and an exception won't be raised. The default value is False.


Specifies a mechanism of indexing when fetching tables data. Available values: Native and Local. When set to Native, the driver will use standard DBF index (if the one exists) when fetching data. When set to Local, the driver will use its internal data indexing mechanism. Internal indexing has much more performance than native indexes, especially when performing complex queries against many tables. But note, that in this case a native index if it is present for a table, won't be updated when the table data changed (for example, when a UPDATE statement executed). So, it is recommended to use Local indexing only for querying data.

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.


Enables the use of local regional settings when converting numbers to strings.


Enables the use of local regional settings when converting dates and times to strings.

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 SQL_LONGVARCHAR.
  • Unicode - all string types will be returned as SQL_WCHAR, SQL_WVARCHAR and SQL_WLONGVARCHAR.

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

xBase ODBC Connection String sample

DRIVER={Devart ODBC Driver for xBase};Database=C:\MyDatabase\;DBF Format=VisualFoxPro;Code Page=UnitedStatesOEM;Connect Mode=Exlusive

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