ODBC Driver for xBase

Connection String Parameters - ODBC Driver for xBase



FoxPro, dBase, Clipper ODBC Connection String Parameters

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

Parameter Description

AllFieldsAsNullable

Used to open DBF tables with incorrect data (tables having 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

Database

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. The 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.

Exclusive
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.

Shared
This is a 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.

Unsafe
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.

IgnoreBrokenTables

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

IgnoreDataErrors

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.

IgnoreIndexErrors

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.

IgnoreMetadataErrors

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.

IndexOnReading

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

Sets the behavior corresponding to the ODBC specification version expected by a third-party tool. The behavior of the ODBC driver can be changed by calling the SQLSetEnvAttr function to set the SQL_ATTR_ODBC_VERSION environment attribute. Some third-party tools expect the driver to exhibit ODBC 2.x behavior, but forget to call SQLSetEnvAttr with the needed version, or pass the incorrect value. In this case, the behavior can be explicitly set in the Connection String.
  • Default - This is a default value. The ODBC behavior is 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.

RegionalNumberSettings

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

RegionalDateTimeSettings

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 parameter value should be changed if any third-party tool supports only Ansi string types or Unicode ones.

Sample xBase ODBC Connection String

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

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