UniDAC

Using ODBC data access provider with UniDAC in Delphi

This article provides a brief overview of the ODBC data access provider for UniDAC that allows ODBC connection to DBMSs from Delphi and Lazarus if a corresponding driver exists. You will find the description of some useful features and how to get started quickly.

Overview

Main features of the ODBC data access provider are:

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

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

Compatibility

ODBC provider supports ODBC 3.x.

Requirements

Applications that use the ODBC provider require ODBC to be installed on the client computer. In the current versions of Microsoft Windows, since Windows 2000, ODBC is already included as a standard package.

To use the ODBC provider with specific DBMS, ODBC driver for the required DBMS must be installed.

Deployment

To deploy Win32 applications built with run-time packages, it is required to deploy the odbcproviderXX.bpl file.

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

ODBC-specific options

TUniConnection

Option name Description
ColumnWiseBinding

If True - enables Column-Wise Binding mode. Default 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.

ConnectionTimeout The time to wait for a connection to open before raising an exception.
DetectFieldsOnPrepare Detects fields on the Prepare command execution.
The default value is True

Note: this functionality is not supported in some ODBC drivers.

DriverManager Specifies the dynamic-link library (DLL) that loads ODBC database drivers on behalf of an application.
DSNType The type of the data source name (DSN) assigned to the Server property.
ntAuto
The default value. Automatically identify the type of DSN.
ntName
User DSN or System DSN (registered with ODBC Administrator).
ntFile
File DSN (a .DSN file containing the data source information).
ntConnectionString
ODBC connection string.
LongVarBinaryAsBlob Specifies that all binary byte strings represented by the LONGVARBINARY type will be retrieved as BLOB fields and handled by the TBlobField class. The default value is True.
UseUnicode Enables or disables Unicode support. Affects character data fetched from the server. When set to True, all character data is stored as WideStrings, and TStringField is replaced by TWideStringFiled.
VarBinaryAsBlob If set to True, all binary byte strings represented by the VARBINARY type will be retrieved as BLOB fields and handled by the TBlobField class. The 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 the returned fields and tables they belong to. The default value is False.
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.
FieldsAsString Used to store all non-BLOB fields as string. The default value is False.
UnknownAsString Used to map fields of unknown data types to TStringField (TWideStringField). The default value is False.
If False, fields of unknown data types (for example the ifnull function result) are mapped to TMemoField or TWideMemoField depending on the value of the UseUnicode option. Memo is used because maximum length of values from such fields is unknown.
If True, fields of unknown data types are mapped to TStringField or TWideStringField depending on the value of the UseUnicode option. Size of fields is set to 8192. Values larger than this size are truncated.

TUniScript

The TUniDump component has no ODBC-specific options.

TUniLoader

The TUniLoader component has no ODBC-specific options.

TUniDump

The TUniDump component has no ODBC-specific options.

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