UniDAC

Using DBF data access provider with UniDAC in Delphi

This article provides a brief overview of the DBF data access provider for UniDAC used to establish a connection to DBF databases from Delphi and Lazarus. You will find the description of some useful features and how to get started quickly.

Overview

Main features of the DBF data access provider are:

The full list of the DBF provider features can be found on the UniDAC features page.

Both Professional and Standard Editions of UniDAC include the DBF provider. Express Edition of UniDAC does not include the DBF provider.

Compatibility

To learn the DBF formats supported by the provider, refer to the Compatibility section.

Requirements

If your application is working in the Direct mode, it is not required to install any additional software on the client. For application that has Direct mode disabled, it is required to install the following components on the client computer:

Deployment

To deploy Win32 applications built with run-time packages, it is required to deploy the dbfproviderXX.bpl, odbcproviderXX.bpl and vqueryXX.bpl files.

For more information about deployment of the UniDAC-based applications, please, refer to the common Deployment topic.

DBF-specific options

TUniConnection

Option name 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.
CodePage Specifies a code page when working with a database. Available values: dpDefault, dpUnitedStatesOEM, dpGreekDOS, dpWesternEuropeanDOS, dpTurkishDOS, dpCentralEuropeanDOS, dpPortugueseDOS, dpIcelandicDOS, dpFrenchCanadianDOS, dpNordicDOS, dpCyrillicDOS, dpThai, dpJapanese, dpChineseSimplified, dpChineseTraditional, dpKorean, dpCentralEuropeanANSI, dpCyrillicANSI, dpWesternEuropeanANSI, dpGreekANSI, dpTurkishANSI, dpHebrewANSI, dpArabicANSI, dpBalticANSI. Default value is dpDefault.
CollatingSequence Specifies the collation sequence. Available values: ASCII and International. Default value is ASCII.
ColumnWiseBinding

If set to True, the option enables Column-Wise Binding mode. The fefault value is False.

Note: Row-Wise Binding mode is enabled by default. However, some ODBC drivers don't support this mode. In such case, set the ColumnWiseBinding option to True.

Connect Mode

Used to specify how connections access DBF table files.

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

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

Unsafe
Multiple concurrent connections can read/write to the same table. The active connection holds read/write lock on the table file, but releases the lock once it has finished reading or writing the data.
ConnectionTimeout The time to wait for a connection to open before raising an exception.
DBFFormat The default database format that will be used when creating new tables and working with indexes. Available values: dfAuto, dfdBaseIII, dfdBaseIV, dfdBaseV, dfdBaseVII, dfFoxPro2, dfVisualFoxPro, dfHiPerSix, dfCodebase and dfClipper. Default value is dfAuto. When using dfAuto, the format is detected by .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 .DBF files in the folder.
Direct If set to True, connection to the database is performed directly, and does not require any additional software on the client side. Otherwise, the provider connects using Microsoft dBase ODBC driver. Default value is False.
IdentifierCase The IdentifierCase property allows you to set the case for field names.

Supported values:

icOriginal
Field names are returned without changing the case.

icLower
Field names are returned in the lowercase.

icUpper
Field names are returned in the uppercase.
IgnoreDataErrors If set to True, corrupted data errors will be ignored when opening a DBF table and an exception will not 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 will not be raised. The default value is False.
IndexOnReading Specifies a mechanism of indexes when fetching tables data. Available values: ikNative and ikLocal. When set to ikNative, UniDAC will use standard DBF indexes. We recommend using it when executing SELECT SQL queries for one table with the WHERE clause. When set to ikLocal, UniDAC will use its internal data indexing mechanism. We recommend using it when the SELECT SQL query is executed for several tables (for example, JOIN) with the WHERE clause.
UseUnicode Enables or disables Unicode support. Affects character data fetched from the database. When set to True, all character data is stored as WideStrings, and TStringField is replaced by TWideStringFiled. Default value is False.

TUniSQL

Option name Description
CommandTimeout The time to wait for a statement to be executed.

TUniQuery, TUniTable, TUniStoredProc

Option name Description
CommandTimeout The time to wait for a statement to be executed.
ExtendedFieldsInfo If True, an additional query is performed to get information about returned fields and tables they belong to. The default value is True.
FetchAll If True, all records of a query are requested from database server when the dataset is being opened.
If False, records are retrieved when a data-aware component or a program requests it. The default value is False.

TUniScript

The TUniDump component has no DBF-specific options.

TUniLoader

The TUniLoader component has no DBF-specific options.

TUniDump

The TUniDump component has no DBF-specific options.

© 1997-2020 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback