xBase ODBC connection string parameters

The following table describes the key connection string parameters for connecting to xBase via the ODBC driver.

Basic settings

Parameter Description
Database The path to the xBase database files.
DBFFormat The database format to use when creating new tables and working with indexes. Available values: Auto (default), dBaseIII, dBaseIV, dBaseV, dBaseVII, FoxPro2, VisualFoxPro, HiPerSix, Codebase, Clipper. When Auto is used, the driver automatically detects the format of each table based on its DBF file header. With any other value, the DBF file header is ignored, and the specified format is forcefully applied to all DBF files in the folder.

Advanced settings

Parameter Description
AllFieldsasNullable Allows opening DBF tables that contain NULL values in non-nullable columns. The default value is False.
Allow NULL strings Allows NULL values to be passed to metadata retrieval functions, ensuring compatibility with third-party tools that send NULL where the ODBC specification requires a value.
Code Page  Specifies the code page to use when working with the 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.
The default value is Default, which means the system locale.
Connect Mode Specifies how applications access DBF table files. Available values:
  • Shared – (Default) Allows multiple applications to read and write to the same table concurrently. The active application holds the read/write lock on the table file, but releases the lock once it has finished reading or writing data.
  • Exclusive – Allows only one application to access the table file at a time. The active application holds the read/write lock on the file to prevent other applications from reading or writing to it.
  • Unsafe – Allows multiple applications to read and write to the table file simultaneously. Use this mode with caution: because DBF databases do not support transactions, simultaneous modifications by multiple applications can lead to data corruption.
Empty strings as NULL Treats empty strings as NULL values when passed to metadata retrieval functions, ensuring compatibility with third-party tools that pass empty strings instead of NULL.
IgnoreBrokenTables Ignores corrupted tables in the directory without raising an exception. The default value is False.
IgnoreDataErrors Ignores corrupted data errors when opening a DBF table without raising an exception. The default value is False.
IgnoreMetadataErrors Ignores metadata errors when opening a DBF table without raising an exception. The default value is False.
IgnoreIndexErrors Ignores errors in database indexes when opening a DBF table without raising an exception. The default value is False.
IndexonReading Specifies the mechanism of indexing when fetching table data. Available values:
  • Native – (Default) Uses the standard DBF index, if one exists.
  • Local – Uses the driver’s internal data indexing mechanism. Internal indexing is more efficient than native indexes, especially when performing complex queries against many tables. In this case, a native index, if available for a specific table, won’t be updated after the table data has been changed (for example, after executing an UPDATE statement). So, it is recommended to use Local indexing only for querying data.
ODBC Behavior Specifies the ODBC specification version the driver must conform to, based on the expectations of a third-party tool.
Typically, the driver’s behavior is controlled by setting the SQL_ATTR_ODBC_VERSION attribute via the SQLSetEnvAttr function. However, some third-party tools expect the driver to behave according to ODBC 2.x standards, but either fail to set this attribute or pass an incorrect value.
In such cases, you can explicitly define the required behavior in the connection string using the ODBC Behavior parameter. Available values:
  • Default – Uses the default behavior as determined by the third-party tool.
  • Ver 2.x – Forces the driver to use ODBC 2.x behavior.
  • Ver 3.x – Forces the driver to use ODBC 3.x behavior.
RegionalDateTimeSettings Enables local regional settings for converting dates and times to strings. The default value is False.
RegionalNumberSettings Enables local regional settings for converting numbers to strings. The default value is False. The default value is False.
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.

Sample connection string

DRIVER={Devart ODBC Driver for xBase};Database=C:\Users\my_user\Downloads\my_database;DBFFormat=FoxPro2;