FireDAC
Topics Symbol Reference Send Feedback

API Reference (V 7.0.1.3111)

created on 26.02.2013.

Embarcadero Technologies, (c) Embarcadero Technologies 2004-2013

If you are the FireDAC beginner, please read "First Steps to use FireDAC" and other "Getting Started" articles.

Topics
Topic | Description
Overview | FireDAC is an unique set of Universal Data Access Components for developing database applications on Delphi, C++Builder and FreePascal. With its powerful common architecture FireDAC enables native high-speed direct access from Delphi to Interbase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, IBM DB2, SQL Anywhere, Access, Firebird, Informix and more.
Getting Started | A set of articles introducing FireDAC to you.
Architecture | A set of articles describing FireDAC architecture, including the components set, supported DBMS, supported tools.
Working with Connections | A set of articles describing how to setup DB drivers and manage database connections with FireDAC.
Working with Commands | A set of articles describing how to execute SQL commands with FireDAC, exchange data and metadata.
Working with DataSets | A set of articles describing how to work with FireDAC dataset classes, including how to edit the dataset content.
Editing the Data | A set of articles describing how to use FireDAC to edit the dataset data, post changes to a database and setup the updates posting.
Working with Metadata | The set of articles describing how to work with database meta data in FireDAC. The metadata contains information about database structure.
Working with DBMS | A set of articles describing how to work with a specific database from an FireDAC application.
x Platform Development | The set of articles describing how to use FireDAC for cross-platform development for Linux, Mac OS X and other environments.
Migrating BDE applications | This article guides you through a series of the steps to migrate the BDE application to the FireDAC.
Debugging | A set of articles explaining how to debug FireDAC application.
Deploying | A set of articles explaining how to deploy a FireDAC application.
Utilities | The list of the FireDAC utilities, their usage details and command line parameters. FireDAC utilities are located in FireDAC\Bin folder.
Database Connectivity | The list of the DBMS's supported by FireDAC and corresponding connection definition parameters.
FAQ | The list of FireDAC related frequently asked questions.
Symbol Reference
Symbol Reference | Description
uADCompClient | Contains core data access components, including TADConnection, TADQuery, TADStoredProc, TADMemTable, etc.
uADCompDataSet | Contains TADDataSet base dataset class and additional utility methods and classes.
uADCompGUIx | Contains most of the UI components, including TADGUIxAsyncExecuteDialog, TADGUIxErrorDialog, TADGUIxLoginDialog, TADGUIxScriptDialog and TADGUIxWaitCursor classes.
uADCompScript | Contains TADScript scripting engine class and additional utility methods and classes.
uADMoniRemoteClient | Contains TADMoniRemoteClientLink class.
uADPhysADS | Contains Advantage Database Server driver and service components.
uADPhysASA | Contains Sybase SQL Anywhere driver and services components.
uADPhysDataSnap | Contains Multi-Tier DataSnap driver for RAD Studio XE2 Enterprise and higher.
uADPhysDB2 | Contains IBM DB2 driver and services components.
uADPhysDBExp | Contains dbExpress v 1-3 bridge driver.
uADPhysIB | Contains Firebird and Interbase driver and services components.
uADPhysManager | Contains FireDAC driver and services base classes.
uADPhysMSAcc | Contains Microsoft Access driver and services components.
uADPhysMSSQL | Contains Microsoft SQL Server driver and services components.
uADPhysMySQL | Contains MySQL Server driver and services components.
uADPhysODBC | Contains ODBC bridge driver.
uADPhysODBCBase | Contains FireDAC driver and services base classes for all ODBC based drivers.
uADPhysOracle | Contains Oracle Database driver and services components.
uADPhysPG | Contains PostgreSQL driver and services components.
uADPhysSQLite | Contains SQLite driver and services components.
uADPhysSQLiteVDataSet | Contains SQLite based Local SQL engine.
uADPhysTDBX | Contains dbExpress v 4 bridge driver.
uADPhysTDBXBase | Contains FireDAC driver base classes for all TDBX based drivers.
uADStanError | Contains error classes - EADException, EADDBEngineException, etc
uADStanOption | Contains option classes - TADFetchOptions, TADUpdateOptions, etc.
Links
Topics, Symbol Reference
What do you think about this topic? Send feedback!


Overview

Overview
FireDAC Send Feedback

FireDAC is an unique set of Universal Data Access Components for developing database applications on Delphi, C++Builder and FreePascal. With its powerful common architecture FireDAC enables native high-speed direct access from Delphi to Interbase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, IBM DB2, SQL Anywhere, Access, Firebird, Informix and more.

Group

FireDAC

Links
FireDAC
Description

Based on 10 years of experience writing native drivers for the database back-ends, FireDAC was built as powerful access layer that supports all that the features needed to build real-world high-load applications. It provides a common API for accessing different database back-ends, without giving up access to unique database-specific features, or compromising on performance.

FireDAC Core Features

Native access

Enterprise:
  • Oracle Database
  • Microsoft SQL Server
  • IBM DB2 Server

Workgroup:
  • Interbase
  • MySQL Server
  • PostgreSQL
  • Sybase SQL Anywhere
  • Advantage Database
  • Firebird

Database in clouds:
  • Microsoft SQL Azure

Desktop:
  • SQLite database
  • Microsoft Access database

Embedded:
  • Interbase ToGo
  • SQLite database
  • MySQL Embedded
  • Firebird Embedded

Multi-Tier:
  • DataSnap server

Generic access

Provided through bridge drivers to:
  • dbExpress data sources
  • ODBC data sources

Enterprise:
  • Informix Dynamic Server
  • Sybase Adaptive Server Everywhere
  • SAP MaxDB
  • Teradata
  • IBM AS/400

Workgroup:
  • Ingres Database
  • Nexus Database

Desktop:
  • Microsoft SQL Server CE
  • Embarcadero Blackfish SQL Server
  • Microsoft Excel

Legacy:
  • MicroFocus Cobol
  • DBase
  • FoxPro
  • Paradox
  • Clarion

Cross Platform support

Including:
  • Delphi Win32, Win64, Mac OS X x86, iOS
  • C++ Builder Win32, Mac OS X
  • FPC / Lazarus Win32, Win64, Linux32, Linux64, Mac OS X x86, iOS
API
  • Fast and Powerful Delphi DataSets
  • ADO.NET-like data engine
  • 50 Delphi VCL Components

Unification
  • Data Types
  • SQL Dialects
  • SQL Script Dialects
  • Data Editing
  • Auto-Incrementing Fields
  • Error Reporting
  • Quoted Identifiers
  • Transaction Support
  • Login and Password Changing
  • Database Event Support
  • Data Moving, Exporting and Importing
  • Metadata Retrieval
  • Records Paging and Counting
  • Master-Detail Relationship

Performance
  • Rowset Fetching
  • Array DML Execution
  • Live Data Window
  • Command Batches
  • Asynchronous Command Execution
  • Command Execution Canceling
  • Metadata Caching
  • Update Commands Caching
  • Connection Pooling
  • DataAbstract Direct mode
  • Faster than dbGo and dbExpress

Advanced
  • Options Inheritance System
  • Automatic Connection Recovery
  • Disconnected Mode
  • Centralized Cached Updates
  • Dataset Persistence
  • International applications
  • DB services (backup, restore, etc)
  • Local SQL Engine

Other
  • BDE Migration
  • Debugging Support
  • Design Time Support
  • Utilities

3d Party Integration
  • DataAbstract
  • DataSnap
  • EhLib
  • FastReport
  • Quantum Grid
  • ReportBuilder
  • TMS Advanced Grid

Clarity
  • 100% source code
  • Help (1500+ topics)
  • FAQ (100+ answers)
  • Demos (80+ projects)

FireDAC Benefits
  • FireDAC is the fruit of 10 years experience in developing real-world database applications.
  • FireDAC enables the developer to concentrate on developing the application – not the complexities of database interaction.
  • FireDAC provides a modern feature-rich set of components to address all major RDBMS environments.
  • FireDAC uses one set of components to address all supported RDBMS types.
  • FireDAC reduces the Total Cost of Ownership by providing:
    • Less initial cost, compared to separate expensive libraries.
    • Reduce time to learn instead of getting to know the unique powerful libraries.
    • Straight ahead application design and development when targeting to different databases.

FireDAC Links
  • FireDAC Home - [image] http://www.embarcadero.com/products/rad-studio/firedac
What do you think about this topic? Send feedback!


Getting Started

Getting Started
FireDAC Topics Send Feedback

A set of articles introducing FireDAC to you.

Group

FireDAC

Topics
Topic | Description
First Steps to use FireDAC | This article guides you through the creation of your first application built using the Delphi edition of FireDAC.
Setting up Connections | This article guides you through the process of defining an FireDAC database connection definition. In this article we will create the connection definition for the Microsoft SQL Server Northwind demo database.
Very High Performance using the Array DML | This article describes the power of the Array DML feature supported by FireDAC. This first article will lead you through an easy example that shows how to insert thousands of records per second by writing just a few lines of code.
Creating Reports with FastReport | This article guides you through the creation of your first report built with FastReport and FireDAC.
Demo Databases | Describes how to install FireDAC demo databases.
Demo Applications | Describes how to use FireDAC demo applications.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


First Steps to use FireDAC

First Steps to use FireDAC
Getting Started Send Feedback

This article guides you through the creation of your first application built using the Delphi edition of FireDAC.

Group

Getting Started

Links
Getting Started
Description
Introduction

This tutorial has three main sections:

  • Establishing the connection to the database: how to use Delphi to create an application that will connect to a database.
  • Selecting rows from the database: hook the data up to a grid and display it at design time.
  • Preparing the application for runtime: describes the necessary steps to make an application run in as standalone execute (runtime).

The screen shots and instructions below relate to Delphi 2007, so there will be minor changes if you use a different Delphi release. And the [image] Ron Grove movie:

Establishing the Connection to the Database

In this article, we use the Microsoft SQL Server's Northwind demo database and a predefined connection definition - MSSQL_Demo. Let's start by creating a new "VCL Forms Application Delphi for Win32".

First, drop a TADConnection component onto the form selected from the "FireDAC" page of the Delphi Tool Palette. This component is responsible to establish and control the database connection.

Next, select MSSQL_Demo from the dropdown list of its ConnectionDefName property. This will associate the connection component with the specified connection definition. By using the predefined definitions you do not need to enter any additional parameters (e.g. the server name or the default database).

After setting the Connected property to True, FireDAC will display a Login Dialog:

Here you can enter your user credentials. Press the OK button to establish the connection to the DB and to create a user session on the DBMS if this DBMS supports this feature.

After the connection is successfully established, the Connected property will still be set to True, otherwise it will be reset to False and FireDAC will display an appropriate error message. By default, you do have three attempts to enter valid credentials. If they all fail, the login process also fails and you will get an error message.

Selecting Rows from the Database

Now drop a TADQuery component from the "FireDAC" palette page onto the form. This component is responsible for the execution of SQL commands, fetching rows from the DB and for posting changed data back to the DB.

Set its Connection property to ADConnection1 to hook the query to a database connection.

Note: If a query component is dropped on a form or datamodule which already contains one or more TADConnections, FireDAC will automatically set the query's Connection property to point to the connection that was created first.

Click on its SQL property and enter the following SQL command into the editor window:

SELECT * FROM Orders

Press the OK button to close the editor. This stores the SQL command text into the TADQuery component's SQL property.

Next, drop a standard Delphi TDataSource component from the "Data Access" palette page onto your form. Set its DataSet property to ADQuery1. Now drop a TDBGrid control onto the form from the "Data Controls" page and set its DataSource property to DataSource1.

Finally, set ADQuery1's Active property to True. This will send the SQL command to the DBMS, which will execute the command and return a result set. This data will be displayed by the DBGrid1 control:

Preparing the Application for Runtime

To allow your application to work at runtime you will need:

  • to drop the TADPhysMSSQLDriverLink component from the "FireDAC Links" palette page;
  • to drop the TADGUIxWaitCursor component from the "FireDAC UI" palette page.

Now your application is ready to run. These components assure that the necessary units get linked into your application execute. For real world applications this components are normally dropped on a main data module.

Summary

This article has provided a tutorial showing how to create a simple client-server application using FireDAC for Delphi. It shows how to use the FireDAC connection and query components to establish a connection to the DB and return rows to the client without actually writing any code.

We suggest that you also read the Setting up Connections article for all the details how to setup the connection definitions.

For other DBMS Getting Started demo applications see FireDAC\Samples\Getting Started folder.

What do you think about this topic? Send feedback!


Setting up Connections

Setting up Connections
Getting Started Send Feedback

This article guides you through the process of defining an FireDAC database connection definition. In this article we will create the connection definition for the Microsoft SQL Server Northwind demo database.

Group

Getting Started

Links
Getting Started
Description
Introduction

This article describes:

  • What is an FireDAC Connection Definition: use an FireDAC connection definition to specify the DBMS connection parameters.
  • Using the ADExplorer Utility: use FireDAC Explorer to create the connection parameter sets saved for system wide usage in a centralized storage file.
  • Using the TADConnection Design Time Editor: use the TADConnection design time editor to set up connection parameters at design time.

What is an FireDAC Connection Definition?

The FireDAC components use the concept of connection definitions to submit all necessary connection parameters, like Server, Database, User_Name to the FireDAC driver level (at run- and design time). Please read the Connection Definition reference to learn all the details about the exact technical definition, like how to create a connection definition at runtime using Delphi code.

FireDAC offers two basic methods to specify the connection definition at design time:

  • Create a shared and centralized persistent connection definition using the ADExplorer. Later, this definition can be assigned to the TADConnection.ConnectionDefName property. For customers who know the CodeGear BDE, the ADExplorer is similar to the BDE Administrator tool.
  • Create a temporary connection definition using the TADConnection design time editor, by filling the TADConnection.Params property within the Delphi design time editor. For customers who know the ADO, this editor is similar to a connection string builder.

Using the ADExplorer Utility

The ADExplorer utility is the main tool to maintain the centralized persistent connection definitions. Please read the ADExplorer reference to understand the detailed usage of this tool.

To run ADExplorer, just click the Delphi IDE menu item Tools -> FireDAC -> Explorer. Then click Ctrl-N to create a new empty connection definition. FireDAC is a multi-DBMS data access engine offering a full set of drivers for each supported DBMS. The DriverID parameter value specifies the driver you decide to use. After setting the DriverID to MSSQL, FireDAC displays the driver specific set of parameters. For the Microsoft SQL Server it includes:

Parameter | Description
Server | The SQL Server server identifier. If the host only has a single default server, then this value is the host address.
Database | The name of the default database.
OSAuthent | If Yes, then FireDAC will use Windows authentication. If No (by default), then MS SQL Server authentication is used.
User_Name | The login user name, if OSAuthent=No.
Password | The login password, if OSAuthent=No.
MetaDefSchema | Default schema name. Design time code will exclude a schema name from an object name, if it is equal to MetaDefSchema.

The next screenshot shows the connection definition setup:

Press Ctrl-A to save the connection definition to the connection definition file.

For testing a new connection definition you just click on the "+" within the tree item. The explorer will show the Login Dialog. After a successful login the tree node will expand and allows to drill down into the DB objects.

Note: If you added a new persistent connection definition using ADExplorer or ADAdministrator while the Delphi IDE is running, it will be not visible to the FireDAC design time code. To refresh the persistent connection definition list, you need to restart the Delphi IDE.

Now the connection definition is ready for usage within Delphi. Just set the the value of the TADConnection.ConnectionDefName property to the name of the newly created connection definition.

Using the TADConnection Design Time Editor

The TADConnection component design time editor is the environment to maintain temporary connection parameters. Double click any TADConnection component at design time. The FireDAC package will display the Connection Editor dialog.

This editor provides a similar functionality to the ADExplorer. Again, you start by setting:

  • the Driver ID, if you want to create a temporary connection definition from scratch (our case);
  • the Connection Definition Name, if you want to create a temporary connection that overrides the parameters of an existing persistent connection.

Again, you fill in the parameters as specified in the chapter above. This dialog offers the following functions:

  • Test button - test the connection definition.
  • Wizard button - call a DBMS specific connection definition wizard, if available.
  • Revert to default button - reset the parameters to their default values.
  • Help button - go to a help page with description of the current driver parameters.
  • Info page - try to connect to a DBMS and obtain information about connection.
  • SQL Script page - execute the SQL script commands in this connection.

After pressing the editor's OK button, FireDAC will load the connection parameters into the TADConnection.Params property and set the TADConnection.DriverName property to the chosen value.

Activate a Connection

After you have assigned a persistent connection definition name to the TADConnection.ConnectionDefName property or filled in temporary connection definition parameters into the TADConnection.Params property, set TADConnection.Connected property to True. If the parameters are specified correctly, the connection will be established.

What do you think about this topic? Send feedback!


Very High Performance using the Array DML

Very High Performance using the Array DML
Getting Started Send Feedback

This article describes the power of the Array DML feature supported by FireDAC. This first article will lead you through an easy example that shows how to insert thousands of records per second by writing just a few lines of code.

Group

Getting Started

Links
Getting Started
Description
Introduction

This tutorial has three main sections:

  • How to prepare your test environment.
  • The main elements of the Array DML commands.
  • The typical results of the Array DML test run.

FireDAC encapsulates all database server specific implementation of the Array DML commands and lets you use identical code for all server types. Obviously, the resulting performance will differ based on the server implementation; especially Oracle, Microsoft SQL Server and IBM DB2 have very powerful support of the Array DML and the resulting performance increase is just amazing.

Please use the sample code to get a feeling for the potential performance increase within your application and network.

Prepare your Test Environment

The following example works with the FireDAC sample database environment. For further details about the installation of this database look into FireDAC Demo Databases. You find the demo projects in your sample directory:

  • This tutorial code - <FireDAC>\Samples\Comp Layer\TADQuery\ExecSQL\AD03-ArrayDML.
  • A basic example code - <FireDAC>\Samples\Comp Layer\TADQuery\ExecSQL\Batch.

How does the Array DML command work?

Imagine a "use case" where you have to INSERT, UPDATE, DELETE or run any other parametrized command N times, typically one command per single record. This means, that each set of input parameters requests to execute a SQL command and is transferred separately between the client and the server. This leads to a heavy load on the network, client and server.

Array DML allows you to transport not only one, but N-sets of data within one transfer. Have a look at the following example:

ADQuery1.SQL.Text:= 'insert into ADQA_Batch_test (tint, tstring) values(:f1, :f2)';

You can speed up your code dramatically by using Array DML commands. Such commands transfer not only one, but N sets of parameters.

ADQuery1.Params.ArraySize := 100;
...
for i := 0 to ADQuery1.Params.ArraySize do begin
  ADQuery1.Params[0].AsIntegers[i] := i;
  ADQuery1.Params[1].AsStrings[i] := 'Test' + IntToStr(i);
end;
ADQuery1.Execute(ADQuery1.Params.ArraySize);

This means the Params property of the query is no more a one- but a two-dimensional array, that allows you to store N sets of parameter values before sending them to the server.

For more details, please see "Array DML" reference chapter.

Usage Hints
  • Can be used for any SQL command that uses parameters (INSERT, UPDATE, DELETE ...).
  • The error handling is supported on record level and described in a separate article.
  • FireDAC unifies the Array DML for different server types (no need for you do dig into the API).

Typical Results of the Array DML Test Run

The attached test code allows you to experiment within your specific environment.

Results of the test example can differ a lot depending on host and network performance. A typical picture of a local Oracle on a rather old laptop will still show > 100'000 records per second as you can see in this screen shot:

A larger Array DML ArraySize results in a higher performance (in our case up to a factor of 2000). We expect that the performance boost in your own environment will surprise you as well.

Performance Hints

Array DML command performance is influenced by:

  • The fact that they are a lot faster on slow networks as these commands create less TCP/IP packages.
  • They reduce the CPU load on the client side, as most of the time the server has to work on the array command.
  • The theoretical speed of > 100'000 rec/sec is not often reached as the server normally has to evaluate triggers and indexes.
  • For real large batch inserts (e.g. > 1'000'000 records), you should consider to drop and recreate non primary key indexes to reach a maximum performance.
What do you think about this topic? Send feedback!


Creating Reports with FastReport

Creating Reports with FastReport
Example Getting Started Send Feedback

This article guides you through the creation of your first report built with FastReport and FireDAC.

Group

Getting Started

Links
Example, Getting Started
Description
Installation

FireDAC installer is shipped with FastReport add-on's that can be found in FireDAC\AddOn\FastReportN folders. Where N corresponds to your FastReport version.

To install the add-on please:

  • open the project group that matches your FastReport and Delphi version;
  • compile frxADXX.dpk and dclfrxADXX.dpk packages;
  • right click dclfrxADXX.dpk package and select Install.

After installation TfrxADComponents component will appear on FastReport palette.

Before creating first report

To get started with creating your first report you will need to drop the following components onto your form:

  • TADConnection;
  • TADGUIxWaitCursor;
  • TADPhysXXXXDriverLink;
  • TfrxADComponents;
  • TfrxReport.

The first three components are used for connecting to your database. TfrxADComponents is used to link FastReport components with FireDAC components.

Set frxADComponents1.DefaultDatabase property to ADConnection1. This connection will be used by default for all datasets you create for the report.

Now you are ready to create the report: right click frxReport1 and choose Edit report...

Adding datasets to report

TfrxReport component editor area consists of a left-most tool palette and three pages: 'Code', 'Data' and 'Page1'.

Select the 'Data' page. On the tool palette you can see the following components:

  • AD Database;
  • AD Table;
  • AD Query;
  • AD StoredProc.

All of them match the respective FireDAC components: TADConnection, TADTable, TADQuery and TADStoredProc. To access a table in your database click AD Query on the palette and then click on the empty Data area.

This will add ADQuery1 component that can be configured in the Object Inspector similarly to how you would do that in Delphi IDE. Double click the component and enter the SELECT query to your table.

When applied the Data Tree will show the queried fields.

The same way you can configure the other datasets. In case you need to use more than one connection or connect to different DBMS's you can drop AD Database components to the data area. Dataset components Database property then should be set to the appropriate ADDatabase. Also in this way you will need to drop TADPhysXXXXDriverLink to your form or data module corresponding to DBMS used.

Using datasets

Select 'Page1' of the FastReport editor. Added datasets are available in the Data Tree. Expanding the dataset nodes will allow you to drag and drop the required field to the page area to build the report.

Drag and drop Query fields

Example

AddOn\FastReportX\Example folder contains a pre-configured sample that can be used to get started with FastReport and FireDAC.

What do you think about this topic? Send feedback!


Demo Databases

Demo Databases
Getting Started See Also Send Feedback

Describes how to install FireDAC demo databases.

Group

Getting Started

Links
Getting Started, See Also
Description
General

FireDAC uses the Northwind as a demo database. SQLite and MS Access demo databases are pre installed and does not require any additional configuration. For other DBMS you have to setup connection and create a database. The FireDAC installer contains SQL scripts, CSV data files and BAT files. The demo database may be created:

  • automatically at the FireDAC installation;
  • manually any time later.

Prerequisites
  • The demo database files will be installed only, if "Sample Databases" on the "Select Components" page is checked in the installer.
  • You should have an existing database and user account. The FireDAC installer will ask this info.
  • SQLite - installer installs a ready to use FireDAC\DB\Data\ADDEMO.SDB database file.
  • Access database - installer installs a ready to use FireDAC\DB\Data\ADDEMO.MDB database file.
  • SQL Server 2000 - the Northwind DB installation may be optional, because it is part of SQL Server 2000 distribution, may be [image] downloaded separately, and may be already installed.

Automatic installation

The FireDAC installer may build a demo database in automatic mode:

  • Mark required DBMS's on the "Demo Database" page of installer wizard.
  • On the next pages fill in the database and user account info.
  • At the end the installer creates a demo databases for marked DBMS's.

Manual installation

To build a demo database by yourself any time later, perform the following steps:

  • Run ADExplorer;
  • Create a connection definition for a required DBMS. The connection definition must have a predefined name, depending on DBMS:
DBMS | Sample connection definition | Connection definition name
Advantage Database | [ADS_Demo] DriverID=ADS ServerTypes=2 Database=\\DA\ADS_DB\ADDEMO.ADD User_Name=adssys | ADS_Demo
IBM DB2 Server | [DB2_Demo] DriverID=DB2 Alias=addemo User_Name=db2admin | DB2_Demo
Interbase / Firebird Server | [IB_Demo] DriverID=IB Database=E:\Firebird\ADDEMO.FB User_Name=sysdba | IB_Demo
Microsoft Access database | [Access_Demo] DriverID=MSAcc Database=$(ADHOME)\DB\Data\ADDemo.mdb | Access_Demo
Microsoft SQL Server | [MSSQL_Demo] DriverID=MSSQL Server=127.0.0.1 Database=Northwind User_Name=sa | MSSQL_Demo
MySQL Server | [MySQL_Demo] DriverID=MySQL Server=127.0.0.1 Database=addemo User_Name=root | MySQL_Demo
Oracle Server | [Oracle_Demo] DriverID=Ora Database=ORA_920_APP User_Name=ADDemo | Oracle_Demo
PostgreSQL | [PG_Demo] DriverID=PG Server=127.0.0.1 Database=addemo User_Name=ad | PG_Demo
SQLite database | [SQLite_Demo] DriverID=SQLite Database=$(ADHOME)\DB\Data\ADDemo.sdb | SQLite_Demo
Sybase SQLAnywhere | [ASA_Demo] DriverID=ASA Server=addemo_asa11 Database=addemo_asa11 User_Name=dba | ASA_Demo
  • Goto FireDAC\Bin folder.
  • SQL Server - to disable Northwind DB installation, open Bin\createMSSQL.bat and replace True with False. For SQL Server 2000 replace MSSQL2005 with MSSQL.
  • Run create<your DBMS>.bat
See Also

Database Connectivity, Defining Connection, ADExplorer, Create (DB name).bat

What do you think about this topic? Send feedback!


Demo Applications

Demo Applications
Getting Started See Also Send Feedback

Describes how to use FireDAC demo applications.

Group

Getting Started

Links
Getting Started, See Also
Description
General

FireDAC has many sample applications, located in the FireDAC\Samples folder. The folder has sub-folders:

  • "Getting Started" - basic simple demo applications, showing how to connect and execute queries;
  • "Comp Layer" - demo applications for the FireDAC components;
  • "DBMS Specific" - demo applications specific for some DBMS;
  • "DApt Layer", "DatS Layer", "GUIx Layer", "Moni Layer", "Phys Layer", "Stan Layer" - advanced demo applications specific for low level FireDAC API's.

The more deep sub-folders are:

  • for "Comp Layer" - demo applications for a specific component;
  • for others - demo applications for a specific feature.

Prerequisites
  • Most of FireDAC demo applications require the FireDAC Demo Database to be installed. So, first install a demo database.
  • A demo application may require some minor adjustment for your Delphi version. In most cases:
    • just ignore the DFM loading warnings;
    • comment out the not found units.
See Also

ADExecutor, ADExplorer, Demo Databases

What do you think about this topic? Send feedback!


Architecture

Architecture
FireDAC Topics Send Feedback

A set of articles describing FireDAC architecture, including the components set, supported DBMS, supported tools.

Group

FireDAC

Topics
Topic | Description
General | FireDAC has flexible, powerful and extendable architecture.
Components | FireDAC includes 50+ Delphi non-visual components.
Databases | FireDAC supports wide range of DBMS.
Programming Tools | FireDAC supports wide range of programming tools.
Class Hierarchy | FireDAC has well designed and structured class hierarchy.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


General

General
Architecture Send Feedback

FireDAC has flexible, powerful and extendable architecture.

Group

Architecture

Links
Architecture
Description

General

FireDAC has a weakly coupled multi layered architecture, where layers may provide services. A service API is defined as a COM interface, that may be requested by other layers using the interface factory.

When an interface implementation is not found, then an exception will be raised. To link the implementation into an application, the corresponding unit must be linked in. There may be alternative implementations and mandatory / optional implementations.

Example

For example, IADGUIxWaitCursor interface defines API for the mouse wait cursor. It has the three alternative implementations (providers):

  • uADGUIxFormsWait unit contains implementation for the VCL GUI applications;
  • uADGUIxFMXWait unit contains implementation for the FireMonkey GUI applications;
  • uADGUIxConsoleWait unit contains implementation for console applications.

GUI or console mouse wait cursor implementation is mandatory and must always be linked into the application. Otherwise exception is raised:

Object factory for class {3E9B315B-F456-4175-A864-B2573C4A2201} missing.
To register it, you can drop component [TADGUIxWaitCursor] into your project

Note, the exception message suggests the unit to include into your project to link the standard interface implementation.

Non visible Components [Comp]

The layer represents the FireDAC public interfaces as Delphi non-visual components, similar to other Delphi data access components. It includes components - TADConnection (establish connection), TADQuery (execute query), TADStoredProc (execute stored procedure), TADMemTable(in-memory dataset), TADScript (SQL script engine), etc. The main units are:

  • uADCompDataSet;
  • uADCompClient;
  • uADCompScript.

Visible Components [GUIx]

The layer provides a way to interact with the end user from an FireDAC application. It is a set of high-level components allowing to add the end-user dialogs for the standard database operations, like a Login or a Wait-for-operation. It includes components - TADGUIxWaitCursor (wait cursor), TADGUIxLoginDialog (login dialog), TADGUIxErrorDialog (error dialog), etc. Layer provides implementations for VCL / LCL, FireMonkey and console platforms. The main units are:

  • uADGUIxIntf;
  • uADCompGUIx;
  • uADGUIx<platform>Xxxx.

Local Data Storage [DatS]

The layer is a Local Data Storage implementation, which is analog to the ADO.NET's DataSet and its related objects (DataTable, DataRow, DataView, etc). It is an in-memory data engine, actually storing and handling all client data and meta-data. It has flexible API, allowing you to use DatS in applications. The main unit is:

  • uADDatSManager.

Data Adapter [DApt]

The layer allows automation and fine-tuning of a read operation with complex result sets (master-details, nested, ADT, etc) and allows posting updates back to the database system. It is controlled mostly through TField and UpdateOptions properites. The main units are:

  • uADDAptIntf;
  • uADDAptManager.

Debug and Performance Monitor [Moni]

The layer represents FireDAC debugging capabilities by implementing debug monitor interfaces, which allow monitoring and tracing interactions between the FireDAC application and the DBMS. It is controlled mostly through [ADSettings] parameters of ADConnectionDefs.ini and the MonitorBy connection definition parameter. It includes components - TADMoniRemoteClientLink (monitoring using ADMonitor), TADMoniFlatFileClientLink (tracing into file), TADMoniCustomClientLink (custom tracing). The main units are:

  • uADMoniRemoteClient;
  • uADMoniFlatFile;
  • uADMoniCustom.

Drivers API [Phys]

The layer defines interfaces for physical data access. It implements them in separate packages as the drivers, where each driver package belongs to the Phys layer and implements the required interfaces using appropriate DBMS API. See Database Connectivity for details. The main units are:

  • uADPhysIntf;
  • uADPhysManager.

By default none of the drivers are linked into the application.

Native Drivers [Phys]

The native drivers are implementing access to a DBMS using a high performance low-level API recommended by the DBMS vendor. They precisely adapt DBMS specific features to the FireDAC API. All native drivers have been tested and optimized for a DBMS. They include TADPhys<DBMS>DriverLink and service components. The main units are:

  • uADPhys<DBMS>Wrapper;
  • uADPhys<DBMS>Meta;
  • uADPhys<DBMS>:
    • uADPhysADS;
    • uADPhysASA;
    • uADPhysDataSnap;
    • uADPhysDB2;
    • uADPhysIB;
    • uADPhysMSAcc;
    • uADPhysMSSQL;
    • uADPhysMySQL;
    • uADPhysOracle;
    • uADPhysPG;
    • uADPhysSQLite.

Bridging Drivers [Phys]

The bridging drivers are implementing generic access to a DBMS using generic data access API's - ODBC and dbExpress. The bridging drivers are using driver supplied information regarding DBMS features, which is not covering all DBMS features interesting to FireDAC. They include TADPhysODBCDriverLink (ODBC driver), TADPhysTDBXDriverLink (dbExpress v 4 and higher driver), TADPhysDBXDriverLink (dbExpress v 1-3 driver). The main units are:

  • uADPhysODBC;
  • uADPhysTDBX;
  • uADPhysDbExp.
What do you think about this topic? Send feedback!


Components

Components
Architecture See Also Send Feedback

FireDAC includes 50+ Delphi non-visual components.

Group

Architecture

Links
Architecture, See Also
Description
FireDAC Core Components

Most of the applications will use TADConnection and few TADQuery.

Name | Platforms | Description
TADManager | All | The class is responsible to connection definitions (more) and connections management.
TADConnection | All | The class is responsible to connection establishment (more) with a DBMS.
TADTransaction | All | The class is responsible for connection transaction management (more).
TADCommand | All | The class is responsible for execution of SQL commands (more).
TADTableAdapter | All | The class binding TADCommand and TADMemTable.
TADSchemaAdapter | All | The class binding few datasets into a single in-memory storage and building a centralized change log.
TADMemTable | All | The class implementing in-memory dataset.
TADQuery | All | The class implementing dataset, capable to execute SQL queries (more).
TADStoredProc | All | The class implementing dataset, capable to execute server side stored procedures (more).
TADTable | All | The class implementing dataset, working with single database table (more).
TADUpdateSQL | All | TADUpdateSQL applies updates on behalf of queries or stored procedures that can't post updates directly (more).
TADDataMove | All | The class is responsible for data movement between different data sources.
TADScript | All | The class implementing SQL script engine, capable to execute a series of SQL queries (more).
TADMetaInfoQuery | All | The class implementing dataset, capable to execute meta-info queries (more).
TADEventAlerter | All | The class is responsible for handling the database event notifications (more).
TADLocalSQL | All | The class implementing Local SQL engine, capable to execute SQL queries with TDataSet descendants as data sources (more).

FireDAC Driver Link Components

Most of the applications will use one link component per supported database.

Name | Platforms | Description
TADPhysADSDriverLink | Win32, Win64, Linux32, Linux64 | Use the TADPhysADSDriverLink component to link the Advantage Database Server driver to an application and setup it (more).
TADPhysASADriverLink | Win32, Win64, Linux32, Linux64, MacOS | Use the TADPhysASADriverLink component to link the Sybase SQL Anywhere driver to an application and setup it (more).
TADPhysDataSnapDriverLink | Win32, Win64, Linux32, Linux64, MacOS, iOS on RAD Studio XE2 Enterprise and higher | Use the TADPhysDataSnapDriverLink component to link the Multi-Tier DataSnap driver to an application and setup it (more).
TADPhysDB2DriverLink | Win32, Win64, Linux32, Linux64 | Use the TADPhysDB2DriverLink component to link the IBM DB2 driver to an application and setup it (more).
TADPhysDBXDriverLink | Win32 | Use the TADPhysDBXDriverLink component to link the dbExpress v 1-3 bridge driver to an application (more).
TADPhysIBDriverLink | Win32, Win64, Linux32, Linux64, MacOS | Use the TADPhysIBDriverLink component to link the Firebird / Interbase driver to an application and setup it (more).
TADPhysMSAccessDriverLink | Win32, Win64 | Use the TADPhysMSAccessDriverLink component to link the Microsoft Access driver to an application and setup it (more).
TADPhysMSSQLDriverLink | Win32, Win64, Linux32, Linux64, MacOS | Use the TADPhysMSSQLDriverLink component to link the Microsoft SQL Server driver to an application and setup it (more).
TADPhysMySQLDriverLink | Win32, Win64, Linux32, Linux64, MacOS, iOS (1) | Use the TADPhysMySQLDriverLink component to link the MySQL Server driver to an application and setup it (more).
TADPhysODBCDriverLink | Win32, Win64, Linux32, Linux64, MacOS | Use the TADPhysODBCDriverLink component to link the ODBC bridge driver to an application (more).
TADPhysOracleDriverLink | Win32, Win64, Linux32, Linux64, MacOS | Use the TADPhysOracleDriverLink component to link the Oracle Database driver to an application and setup it (more).
TADPhysPgDriverLink | Win32, Win64, Linux32, Linux64, MacOS, iOS (1) | Use the TADPhysPgDriverLink component to link the PostgreSQL driver to an application and setup it (more).
TADPhysSQLiteDriverLink | Win32, Win64, Linux32, Linux64, MacOS, iOS | Use the TADPhysSQLiteDriverLink component to link the SQLite driver to an application and setup it (more 1, more 2).
TADPhysTDBXDriverLink | Win32, Win64, MacOS, iOS | Use the TADPhysTDBXDriverLink component to link the dbExpress v 4 bridge driver to an application (more).

Note 1: Embarcadero Technologies not tested this driver on this platform and does not provide the technical assistance for that. Use on your own risk.

FireDAC Monitor Link Components

An application will use one of the monitor components, when it is needed tracing capabilities.

Name | Platforms | Description
TADMoniFlatFileClientLink | All | Use the TADMoniFlatFileClientLink component to link tracing to text file capabilities to an application and setup it (more).
TADMoniRemoteClientLink | All | Use the TADMoniRemoteClientLink component to link ADMonitor tracing capabilities to an application and setup it (more).
TADMoniCustomClientLink | All | Use the TADMoniCustomClientLink component to link custom tracing capabilities to an application and setup it (more).

FireDAC UI Components

Most of the applications will use TADGUIxWaitCursor and TADGUIxLoginDialog.

Name | Platforms | Description
TADGUIxAsyncExecuteDialog | VCL, FireMonkey, LCL | The dialog showing a SQL query execution progress (more).
TADGUIxErrorDialog | VCL, FireMonkey, LCL | The dialog displaying FireDAC exceptions (more).
TADGUIxLoginDialog | VCL, FireMonkey, LCL | The dialog allows the users to enter their DB credentials (more).
TADGUIxScriptDialog | VCL, FireMonkey, LCL, Console | The dialog showing a SQL script execution progress (more).
TADGUIxWaitCursor | VCL, FireMonkey, LCL, Console | The component allowing to control the wait cursor.

FireDAC Service Components

An application will use service components to add a specific DBMS facility support.

Name | Platforms | Description
TADADSBackup | Win32, Win64, Linux32, Linux64 | The class implementing Advantage backup database service.
TADADSRestore | Win32, Win64, Linux32, Linux64 | The class implementing Advantage service restoring a database from a backup.
TADADSUtility | Win32, Win64, Linux32, Linux64 | The class implementing Advantage table utilities.
TADASABackup | Win32 | The class implementing SQL Anywhere backup database service.
TADASAValidate | Win32 | The class implementing SQL Anywhere database validate service.
TADIBBackup | Win32, Win64, Linux32, Linux64, MacOS | The class implementing FB/IB backup database service.
TADIBNBackup | Win32, Win64, Linux32, Linux64, MacOS | The class implementing Firebird-only backup database service.
TADIBNRestore | Win32, Win64, Linux32, Linux64, MacOS | The class implementing Firebird-only restored database service.
TADIBRestore | Win32, Win64, Linux32, Linux64, MacOS | The class implementing FB/IB service restoring a database from a backup.
TADIBSecurity | Win32, Win64, Linux32, Linux64, MacOS | The class implementing FB/IB database security management service.
TADIBTrace | Win32, Win64, Linux32, Linux64, MacOS | The class implementing Firebird database trace service.
TADIBValidate | Win32, Win64, Linux32, Linux64, MacOS | The class implementing FB/IB database validate and repair service.
TADMSAccessService | Win32, Win64 | The class implementing Microsoft Access database create, drop, compact and repair services
TADSQLiteBackup | Win32, Win64, Linux32, Linux64, MacOS, iOS | The class implementing SQLite backup, restore, copy database functionality (more).
TADSQLiteCollation | Win32, Win64, Linux32, Linux64, MacOS, iOS | The class implementing custom SQLite collation (more).
TADSQLiteFunction | Win32, Win64, Linux32, Linux64, MacOS, iOS | The class implementing custom SQLite function (more).
TADSQLiteSecurity | Win32, Win64, Linux32, Linux64, MacOS, iOS | The class allowing to manage SQLite database encryption (more).
TADSQLiteValidate | Win32, Win64, Linux32, Linux64, MacOS, iOS | The class implementing SQLite database validate service (more).
TADSQLiteRTree | Win32, Win64, Linux32, Linux64, MacOS, iOS | The class implementing custom SQLite RTree (more).
See Also

Class Hierarchy

What do you think about this topic? Send feedback!


Databases

Databases
Architecture See Also Send Feedback

FireDAC supports wide range of DBMS.

Group

Architecture

Links
Architecture, See Also
Description

Native Connections

There "Server and client version" column provides client library names for Windows only. For additional information, including other platforms support, click on the link in "Name" column.

Name | Server and client version | Platforms | Driver link component, Driver implementation unit | DriverID parameter
Advantage Database Server | Server and client v 8.0 and higher. | Win32, Win64, Linux32, Linux64 | TADPhysADSDriverLink, uADPhysADS | ADS
DataSnap server | DataSnap server built with RAD Studio 2007 and higher. DataSnap client built with RAD Studio XE2 Enterprise and higher. | Win32, Win64, Linux32, Linux64, MacOS, iOS | TADPhysDataSnapDriverLink, uADPhysDataSnap | DataSnap
IBM DB2 Server | Server and client v 8.1 and higher. | Win32, Win64, Linux32, Linux64 | TADPhysDB2DriverLink, uADPhysDB2 | DB2
Interbase Server | Interbase and gds32.dll v 6 and higher. | Win32, Win64, Linux32, Linux64, MacOS | TADPhysIBDriverLink, uADPhysIB | IB
Firebird Server | Firebird and fbclient.dll v 1.5 and higher. | Win32, Win64, Linux32, Linux64, MacOS | TADPhysIBDriverLink, uADPhysIB | IB
Microsoft SQL Server | Microsoft SQL Server 2000, ODBC driver from MDAC 2.8. Microsoft SQL Server 2005 and higher, SQL Native Client 2005 and higher. Microsoft SQL Azure, SQL Native Client 2008 and higher. Microsoft LocalDB, SQL Native Client 2012 and higher. | Win32, Win64, Linux32, Linux64, MacOS | TADPhysMSSQLDriverLink, uADPhysMSSQL | MSSQL
Microsoft Access database | Microsoft Access 2000 ODBC driver v 4 from MDAC 2.8 and higher. Microsoft Access 2007 ODBC driver v 12 and higher. | Win32, Win64 | TADPhysMSAccessDriverLink, uADPhysMSAcc | MSAcc
MySQL Server | Server and client 3.21 and higher. | Win32, Win64, Linux32, Linux64, MacOS, iOS (1) | TADPhysMySQLDriverLink, uADPhysMySQL | MySQL
Oracle Server | Server and client 8.0.3 and higher. | Win32, Win64, Linux32, Linux64, MacOS | TADPhysOracleDriverLink, uADPhysOracle | Ora
PostgreSQL | Server and libpq.dll v 7.4 and higher. | Win32, Win64, Linux32, Linux64, MacOS, iOS (1) | TADPhysPGDriverLink, uADPhysPG | PG
SQLite database | sqlite3_x86.obj / sqlite3_x64.obj or sqlite3.dll v 3 and higher. | Win32,Win64, Linux32, Linux64, MacOS, iOS | TADPhysSQLiteDriverLink, uADPhysSQLite | SQLite
Sybase SQL Anywhere | Server and client v 5.0.0 and higher. | Win32, Win64, Linux32, Linux64, MacOS | TADPhysASADriverLink, uADPhysASA | ASA

Note 1: Embarcadero Technologies not tested this driver on this platform and does not provide the technical assistance for that. Use on your own risk.

Bridge Connections

Name | Server and client version | Platforms | Driver link component, Driver implementation unit | DriverID parameter
dbExpress data source | dbExpress drivers v 1-3 (Delphi 5 to RAD Studio 2006) | Win32 | TADPhysDBXDriverLink, uADPhysDBX | DBX
dbExpress data source | dbExpress drivers v 4 (RAD Studio 2007 and higher) | Win32, Win64, MacOS, iOS | TADPhysTDBXDriverLink, uADPhysTDBX | TDBX
ODBC data source | ODBC drivers v 1-3 | Win32, Win64, Linux32, Linux64, MacOS | TADPhysODBCDriverLink, uADPhysODBC | ODBC

Additional Connections

  • Blackfish SQL Server;
  • Informix Dynamic Server;
  • MicroFocus Cobol;
  • MS SQL Server Compact Edition;
  • Sybase Adaptive Server Enterprise;
  • Unify SQLBase.
See Also

FireDAC Architecture, Configuring Drivers, Defining Connection, Demo Databases, Working with DBMS

What do you think about this topic? Send feedback!


Programming Tools

Programming Tools
Architecture See Also Send Feedback

FireDAC supports wide range of programming tools.

Group

Architecture

Links
Architecture, See Also
Description
Programming Tools
Name
Platforms
Comment
Embarcadero Delphi and C++ Builder XE3
  • Win32, Win64, MacOS, iOS
  • VCL, FireMonkey
Embarcadero Delphi and C++ Builder XE2
  • Win32, Win64, MacOS, iOS
  • VCL, FireMonkey
Update Pack 4, Hot Fix 1 is required.
Embarcadero Delphi and C++ Builder XE
  • Win32
  • VCL
Embarcadero Delphi and C++ Builder 2010
  • Win32
  • VCL
CodeGear Delphi and C++ Builder 2009
  • Win32
  • VCL
CodeGear Delphi and C++ Builder 2007
  • Win32
  • VCL
RAD Studio December 2007 Update required.
Borland Delphi and C++ Builder 2006
  • Win32
  • VCL
Update Pack 2 is required.
Borland Delphi 2005
  • Win32
  • VCL
Update Pack 2 is required.
Borland Delphi 7
  • Win32
  • VCL
Borland C++ Builder 6
  • Win32
  • VCL
See Borland Delphi 6.
Borland Delphi 6
  • Win32
  • VCL
Update Pack 2, RTL Update Pack 2, RTL Update Pack 3 are required.
Borland C++ Builder 5
  • Win32
  • VCL
See Borland Delphi 5.
Borland Delphi 5
  • Win32
  • VCL
Update Pack 1 is required.
FreePascal 2.6.0 & Lazarus 0.9.30.4
  • Win32, Win64, Linux32, Linux64, MacOS, iOS
  • LCL
Read the "Lazarus / FPC" article for details.
See Also

How to recompile FireDAC packages

What do you think about this topic? Send feedback!


Class Hierarchy

Class Hierarchy
Architecture Send Feedback

FireDAC has well designed and structured class hierarchy.

Group

Architecture

Links
Architecture
Description

ClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_HierarchyClassHierarchy_Global_Class_Hierarchy

What do you think about this topic? Send feedback!


Working with Connections

Working with Connections
FireDAC Topics Send Feedback

A set of articles describing how to setup DB drivers and manage database connections with FireDAC.

Group

FireDAC

Topics
Topic | Description
Defining Connection | Describes how to store and use FireDAC connection parameters and what is a connection definition. To specify connection parameters an application must use a connection definition. The connection definition is a set of parameters. A connection may be also pooled.
Configuring Drivers | Describes how to configure the FireDAC DBMS drivers, including how to specify a DBMS client library. To link an FireDAC driver to an application, specify DBMS client to the driver and other optional parameters, an application may use a TADPhysXXXDriverLink components and/or external configuration file.
Setting Options | Describes why the set of options makes FireDAC a flexible database framework and how to use the options. FireDAC offers the wide range of the options organized into an hierarchical options system. Most of the options may be leaved with their default values.
Establishing Connection | Describes how to open and close connection to a DBMS using FireDAC. To open a connection to a database FireDAC offers the TADConnection component.
Recovering Connection | Describes how to work in an unstable environment. FireDAC allows an application to recover from a connection failure.
Offlining Connection | Describes how to use FireDAC offline mode allows to work with data without a persistent connection to a database.
Managing Transactions | Describes how to manage DBMS transactions using FireDAC. To handle database transactions FireDAC offers the TADConnection and TADTransaction components.
Handling Errors | Describes how to handle database errors with FireDAC.
Multi Threading | Describes how to use FireDAC in multi threading environment.
DLL Development | Describes how to use FireDAC in the dynamic loading libraries.
Unicode Support | Describes how FireDAC works with Unicode data and metadata. FireDAC fully support Unicode data and metadata. Although an application may need to take the additional steps to use Unicode properly.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Defining Connection

Defining Connection
Working with Connections See Also Send Feedback

Describes how to store and use FireDAC connection parameters and what is a connection definition. To specify connection parameters an application must use a connection definition. The connection definition is a set of parameters. A connection may be also pooled.

Group

Working with Connections

Links
Working with Connections, See Also
Description
General

A connection definition is a set of parameters that defines how to connect an application to a DBMS using specific FireDAC driver. It is the equivalent of a BDE alias, ADO UDL (stored OLEDB connection string) or ODBC Data Source Name (DSN). For the list of supported DBMS's and corresponding parameters see FireDAC Database Connectivity.

FireDAC supports 3 connection definition kinds:

Type | Description | Pros | Cons
Persistent | Has an unique name, is managed by the ADManager and is stored in a connection definition file. | May be defined once and reused across many applications. May be pooled. | The parameters (server address, DB name, etc) are publically visible and may be changed incidentally. ADManager has to be be reactivated or the Delphi IDE has to be be restarted to make a newly added definition visible at design time.
Private | Has an unique name, is managed by the ADManager but is NOT stored in a connection definition file. | Connection definition parameters are not visible "outside" the application. May be pooled. | Application needs to create a private connection definition after each program restart and cannot share it with the other programs. Cannot be created at design time.
Temporary | Has no name, is not stored in a connection definition file and is not managed by the ADManager. | The most simple way to create a connection definition - just fill in the TADConnection.Params property. May be created at design time using the TADConnection component editor. | Similar to private. Also cannot be referenced by name and cannot be pooled.

Connection definition file

The persistent connection definitions are stored in an external file - the connection definition file. This file has the standard INI text file format. It may be edited by ADExplorer or ADAdministrator utilities at first, manually or by code. By default the file is $(ADHome)\DB\ADConnectionDefs.ini.

Note: If you added a new persistent connection definition using ADExplorer or ADAdministrator while the Delphi IDE is running, it will not be visible to the FireDAC design time code. To refresh the persistent connection definitions list, you will need to reactivate ADManager or restart the Delphi IDE.

Sample content of this file:

[Oracle_Demo]
DriverID=Ora
Database=ORA_920_APP
User_Name=ADDemo
Password=a
MetaDefSchema=ADDemo
;MonitorBy=Remote

[MSSQL_Demo]
DriverID=MSSQL
Server=127.0.0.1
Database=Northwind
User_Name=sa
Password=
MetaDefSchema=dbo
MetaDefCatalog=Northwind
MonitorBy=Remote

An application can specify a connection definition file name in the ADManager.ConnectionDefFileName property. FireDAC searches for a connection definition file in the following places:

  • If ConnectionDefFileName is specified:
    • search for a file name without a path, then look for it in an application EXE folder.
    • otherwise just use a specified file name.
  • If ConnectionDefFileName is not specified:
    • look for ADConnectionDefs.ini in an application EXE folder.
    • If the file above is not found, look for a file specified in the registry key HKCU\Software\da-soft\FireDAC\ConnectionDefFile. By default it is $(ADHome)\DB\ADConnectionDefs.ini.

Note: At design time, FireDAC ignores the value of the ADManager.ConnectionDefFileName, and looks for a file in a Delphi Bin folder or as specified in the registry. If the file is not found, an exception is raised.

If ADManager.ConnectionDefFileAutoLoad is True, a connection definition file is loading automatically. Otherwise it must be loaded explicitly by calling the ADManager.LoadConnectionDefFile method before the first usage of the connection definitions. For example, before setting TADConnection.Connected to True.

Creating a persistent connection definition

A persistent connection definition may be created using ADExplorer or ADAdministrator. Here, we will show you how to do that in code: $(ADHome)\Samples\Comp Layer\TADConnection\ConnectionDefs.

The following code snippet creates a connection definition named "MSSQL_Connection", which has all required parameters to connect to the Microsoft SQL Server running locally, using the OS authentification (SSPI):

uses
  uADCompClient, uADStanIntf;
var
  oDef: IADStanConnectionDef;
begin
  oDef := ADManager.ConnectionDefs.AddConnectionDef;
  oDef.Name := 'MSSQL_Connection';
  oDef.DriverID := 'MSSQL';
  oDef.Server := '127.0.0.1';
  oDef.Database := 'Northwind';
  oDef.OSAuthent := True;
  oDef.MarkPersistent;
  oDef.Apply;
  .....................
  ADConnection1.ConnectionDefName := 'MSSQL_Connection';
  ADConnection1.Connected := True;

The ADManager is a global instance of the FireDAC connection manager. Its property ConnectionDefs: IADStanConnectionDefs is a collection of the persistent and private connection definitions. The AddConnectionDef method adds a new connection definition. The MarkPersistent method marks a connection definition as persistent. The Apply method saves a connection definition to a connection definition file. Without the MarkPersistent call, the connection definition will be private.

Creating a private connection definition

A private connection definition may be created only in code. The code is similar to the one above, but without the MarkPersistent call.

Also, you can use a technique similar to BDE:

var
  oParams: TStrings;
begin
  oParams := TStringList.Create;
  oParams.Add('Server=127.0.0.1');
  oParams.Add('Database=Northwind');
  oParams.Add('OSAuthent=Yes');
  ADManager.AddConnectionDef('MSSQL_Connection', 'MSSQL', oParams);
  .....................
  ADConnection1.ConnectionDefName := 'MSSQL_Connection';
  ADConnection1.Connected := True;

Creating a temporary connection definition

A temporary connection definition may be created at design-time using FireDAC Connection Editor. For that double click on a TADConnection to invoke the editor:

Or at run-time in code by filling the TADConnection.Params property. This is the simplest way to create a connection definition.

ADConnection1.DriverName := 'MSSQL';
ADConnection1.Params.Add('Server=127.0.0.1');
ADConnection1.Params.Add('Database=Northwind');
ADConnection1.Params.Add('User_name=sa');
ADConnection1.Connected := True;

Editing a connection definition

An application may need an ability to create and edit a connection definition at run-time using standard FireDAC Connection Editor dialog. To edit a temporary connection definition stored in TADConnection use the code:

uses
  uADGUIxFormsfConnEdit;
...
if TfrmADGUIxFormsConnEdit.Execute(ADConnection1, '') then
  ADConnection1.Connected := True;

To edit a connection definition represented as FireDAC connection string use the code:

uses
  uADGUIxFormsfConnEdit;
...
var
  sConnStr: String;
...
sConnStr := ADConnection1.ResultConnectionDef.BuildString();
if TfrmADGUIxFormsConnEdit.Execute(sConnStr, '') then begin
  ADConnection1.ResultConnectionDef.ParseString(sConnStr);
  ADConnection1.Connected := True;
end;
See Also

ADAdministrator utility, ADExplorer utility, FireDAC Database Connectivity , Multi Threading

What do you think about this topic? Send feedback!


Configuring Drivers

Configuring Drivers
Working with Connections See Also Send Feedback

Describes how to configure the FireDAC DBMS drivers, including how to specify a DBMS client library. To link an FireDAC driver to an application, specify DBMS client to the driver and other optional parameters, an application may use a TADPhysXXXDriverLink components and/or external configuration file.

Group

Working with Connections

Links
Working with Connections, See Also
Description
General

To adjust a driver's behavior, you can use a driver configuration file or the TADPhysXXXDriverLink components. Most of the driver configuration file discussion also applies to the TADPhysXXXDriverLink components.

Driver configuration file

A driver configuration file is a standard INI text file. It may only be edited manually. Basically, the driver configuration file allows you to:

  • adjust parameters of a base driver (section name = base driver ID);
  • introduce a new virtual driver, which is a set of the base driver parameters saved under a new name (section name = new virtual driver ID).

FireDAC searches for the driver configuration file in the following places:

  • ADDrivers.ini in the application EXE folder.
  • If the file above is not found, it looks for the file specified in the registry key HKCU\Software\da-soft\FireDAC\DriverFile. By default, this is $(ADHome)\DB\ADDrivers.ini.

At design time, FireDAC will use the file in the Delphi Bin folder or as specified in the registry.

Base and Virtual Drivers

If the section name in the driver configuration file is the base driver ID (for example, "ASA" or "Ora"), the base driver uses the parameter values specified in the corresponding section.

If the section name is not an ID of any of the base drivers (for example, "Ora815" or "MySQL510_Embedded"), FireDAC registers a new virtual driver. The virtual driver uses the implementation of the base driver specified by the BaseDriverID parameter and the specified parameter values. A virtual driver ID then may be used as the value of the DriverID connection definition parameter. A virtual driver allows the application:

  • to work with different versions of the DBMS client software in different connections, established in the same application run, for example to connect to Interbase and Firebird servers;
  • to choose an explicit version of the DBMS client software, for example to use one of the many LIBMYSQL.DLL's installed on workstation;
  • to set up drivers, which require parameters to be specified, for example MySQL Embedded server, which requires to specify arguments.

Driver Configuration Parameters

The following parameters may be specified:

Parameter
Description
Applied to Drivers
VendorHome[ | Win32 | Win64 | MacOS32 | MacOS64 | UIX32 | UIX64]
The Oracle Home name.
Ora
The base installation path. For example: C:\ib\ib2007.
IB
The base installation path for normal server. For example: C:\MySQL\MySQL5-1-7. Or the path to LIBMYSQLD.DLL for embedded server. For example C:\MyAPP\MySQL.
MySQL
VendorLib[ | Win32 | Win64 | MacOS32 | MacOS64 | UIX32 | UIX64]
The DBMS client software API DLL name. For example: libmysql510.dll.
  • Ora
  • IB/FB
  • MySQL
ODBCDriver
ODBC driver name. For example: Adaptive Server Anywhere 8.0.
All ODBC based
ODBCAdvanced
ODBC driver additional parameters.
The string consists of ODBC driver parameters separated by ?;?. Check the vendor documentation for possible values.
All ODBC based
EmbeddedArgs
MySQL embedded server arguments.
The string consists of MySQL server arguments separated by ?;?. Check the vendor documentation for possible values. For example: --datadir=./data;--language=./;--skip-innodb.
MySQL
EmbeddedGroups
MySQL embedded server configuration file groups.
MySQL
NLSLang
Oracle NLS_LANG environment variable value.
Ora
TNSAdmin
Oracle TNS_ADMIN environment variable value.
Ora

For non-ODBC based drivers, if the VendorLib is specified, FireDAC will use the specified DLL. If the VendorHome is specified, the DLL with default name from the Bin subfolder will be used. If none is specified, a DLL with a default name from:

  • primary Oracle Home for Ora driver,
  • most left folder in PATH environment variable, containing the DLL, for other drivers

will be used. Additionally may be specified a suffix, designating a platform.

For ODBC based drivers, if the ODBCDriver is specified, FireDAC will use the specified driver. If it is not specified, a default driver name will be used.

Sample driver configuration file content

[ASA]
; ASA base driver will use specified ODBC driver
ODBCDriver=Adaptive Server Anywhere 8.0

[Ora815]
; Ora815 virtual driver will use specified Oracle Home
BaseDriverID=Ora
VendorHomeWin32=OraHome815
VendorHomeWin64=OraHome815_64

[MySQL327]
; MySQL327 virtual driver will use specified LIBMYSQL.DLL
BaseDriverID=MySQL
VendorLib=c:\LIBMYSQL327.DLL

[MySQL510_Embedded]
; MySQL510_Embedded virtual driver will use specified MySQL embedded library and arguments
BaseDriverID=MySQL
VendorLib=c:\LIBMYSQLD.DLL
EmbeddedArgs=--datadir=./data;--language=./;--skip-innodb;--skip-networking

[MSSQL_2000]
; MSSQL_2000 virtual driver will use specified ODBC driver
BaseDriverID=MSSQL
ODBCDriver=SQL SERVER
ODBCAdvanced=

[FB21]
; FB21 virtual driver will use specified Firebird client library
BaseDriverID=IB
VendorLibWin32=C:\ib\fb21\bin\fbclient.dll
VendorLibWin64=C:\ib\fb21_64\bin\fbclient.dll

[FB21_Embedded]
; FB21_Embedded virtual driver will use specified Firebird client library
BaseDriverID=IB
VendorLib=C:\ib\fb21_embed\bin\fbembed.dll

Configuring drivers in code

You can also configure FireDAC drivers in application code at runtime. To do that, drop the appropriate TADPhysXXXDriverLink components to your form. It has the same named properties as the parameters in the driver configuration file. The link component properties must be set before opening a first connection to a DBMS through this driver. The following code sample shows how to configure the Firebird driver at runtime:

interface

uses
  ..., uADPhysIB;

type
  TForm1 = class(TForm)
  ......
    ADPhysIBDriverLink1: TADPhysIBDriverLink;
    ADConnection1: TADConnection;
    procedure FormCreate(Sender: TObject);
  ......
  end;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  ADPhysIBDriverLink1.VendorLib := 'C:\ib\fb21_embed\bin\fbembed.dll';

  ADConnection1.ConnectionDefName := 'IB_Demo';
  ADConnection1.Connected := True;
end;

When a connection using a driver was established and an application needs to switch to the other DBMS client:

  • close all connections on this driver;
  • call the driver link Release method;
  • change required link properties.

The next connection using this driver will use the new link properties. The following code sample shows how to change the Firebird driver configuration at runtime:

ADConnection1.Close;
ADPhysIBDriverLink1.Release;
ADPhysIBDriverLink1.VendorLib := 'C:\fbclient.dll';
ADConnection1.Open;

Note: Although it is possible to use link components to configure drivers at design time, we do not recommend it, because it is hard to make that a module with a link component will be loaded before any other module with the FireDAC components. So, the link component will configure the driver properly.

See Also

FireDAC Database Connectivity, FireDAC FAQ

What do you think about this topic? Send feedback!


Setting Options

Setting Options
Example 1 Example 2 Working with Connections See Also Topics Send Feedback

Describes why the set of options makes FireDAC a flexible database framework and how to use the options. FireDAC offers the wide range of the options organized into an hierarchical options system. Most of the options may be leaved with their default values.

Group

Working with Connections

Topics
Topic | Description
Data Type Mapping | FireDAC offers flexible adjustable data type mapping system, allowing to simplify migration to FireDAC or optimize data representation.
Links
Example 1, Example 2, Working with Connections, See Also, Topics
Description

The FireDAC options are organized into five groups:

  • FetchOptions - Fetch options control, how the components and Phys layer commands fetch data from a DBMS. For example, it is possible to fetch all records at once, or fetch records on demand.
  • FormatOptions - Format options control, how DBMS data types will be mapped to the FireDAC data types and backward. For example, a programmer may setup a mapping for Oracle NUMBER (38) onto dtBCD or onto dtInt64. Read Data Type Mapping for more details.
  • UpdateOptions - Update options control, how FireDAC will post updates to DBMS. For example, during an update FireDAC can update all fields in a table or only the changed ones.
  • ResourceOptions - Resource options control, how system resources are used, dataset persistence and other. For example, an FireDAC Phys layer command can be performed asynchronously or blocked.
  • TxOptions - Transaction options control, how transactions are performed. For example, perform them in a ReadCommitted isolation mode. Note, that TxOptions does not use option value inheritance.

Because FireDAC introduces a lot of options, setting up each dataset or command may do the programming complex and error prone. FireDAC solves this issue by introducing a parent-child option values inheritance model. The option values are propagated from a parent to a child (top-down). If a lower level has no option value assigned explicitly, a value will be taken from a higher level, where a value is assigned or from the top-most level. The FireDAC has levels:

  • Manager (TADCustomManager, IADPhysManager) level;
  • Connection (TADCustomConnection, IADPhysConnection) level;
  • Command (TADCustomCommand / IADPhysCommand) / Dataset (TADCustomQuery, TADStoredProc, etc) level.

A Manager is the top-most level, a Connection is the intermediate and a Command / Dataset is the bottom level. So, by setting any particular Manager or Connection option, all Datasets will inherit its value. This is true as long as a programmer has not explicitly assigned a value to the Dataset option.

The TxxxOptions.AssignedValues flags controls the inheritance. If some option is changed at this level, then corresponding flag is included into AssignedValues. If flag is not included, then an option value is inherited from the more high level. Excluding flag from AssignedValues makes option inheriting its value from the more high level again.

The options may be setup for a persistent connection definition using ADExplorer. After connection establishment, the options setup will be applied to the TADCustomConnection options.

See Also

Data Type Mapping, uADStanOptions

Example 1

The mapping of data types from the DBMS types to the client types defined in FormatOptions is inherited by all Commands from their Connection.

with oConnection.Options.FormatOptions do begin
  OwnMapRules := True;
  MapRules.Clear;
  with MapRules.Add do begin
    PrecMax := 19;
    PrecMin := 4;
    SourceDataType := dtFmtBCD;
    TargetDataType := dtCurrency;
  end;
end;
Example 2

A Data Warehouse application may setup high-speed fetching mode, using FetchOptions of the Manager level. So, all connection and all their commands will inherit these options.

with ADManager.FetchOptions do begin
  Items := [];
  Cache := [];
  RowsetSize := 1000;
end;
What do you think about this topic? Send feedback!


Data Type Mapping

Data Type Mapping
Example Setting Options Send Feedback

FireDAC offers flexible adjustable data type mapping system, allowing to simplify migration to FireDAC or optimize data representation.

Group

Setting Options

Links
Example, Setting Options
Description
General

The data type mapping allows to map:

  • result set column data types returned by an FireDAC driver, to the data types preferred by application;
  • command parameters data types defined by an application, to the driver supported data types.

The data type mapping is useful for:

  • creation of the data type schema compatible with other data access components, when migrating application from these components to the FireDAC;
  • creation of the data type schema compatible across few supported DBMS, when developing a cross-DBMS application;
  • mapping the data types not supported by an application into the supported ones;
  • mapping the generalized data types supported by an driver into the more specialized / convenient ones;
  • optimizing the memory consumption, by specifying the more optimal data types.

Lets consider SELECT of numeric column from an Oracle table and how it may be mapped:

DDL | Driver data type | Preferred data type
NUMBER(2,0) | dtBcd, Precision=2, Scale=0 | dtSByte
NUMBER(4,0) | dtBcd, Precision=4, Scale=0 | dtInt16
NUMBER(8,0) | dtBcd, Precision=8, Scale=0 | dtInt32
NUMBER(18,4) | dtBcd, Precision=18, Scale=4 | dtCurrency

There you see, that Oracle driver returns some unified data type (dtBcd / dtFmtBCD) for all possible NUMBER(X,Y) database types. But an application may prefer to use a more specialized / convenient data type, like a dtInt32.

Defining

FireDAC applies the mapping rules at a command preparation. After the command is prepared, the rule changes will have no effect. If data type conforms to few rules, then only first one will be used. MaxStringSize, MaxBcdPrecision, MaxBcdScale properties are applied to source data type before mapping rules.

To define the data type mapping an application must set FormatOptions.OwnMapRules to True and fill MapRules collection. Each item in collection is of TADMapRule class and represents a single mapping rule. In case of a result set column, each rule defines a transformation of a source data type, returned by a driver, into a target one, preferred by an application. In case of a command parameter, rule defines a transformation of a target data type, specified by an application, into a source data type, supported by a driver. All rules, excluding the name based ones work bidirectionally for both cases.

Each rule is defined by the TADMapRule properties:

Properties | Description
PrecMin / PrecMax | Defines the range of source data type numeric precision.
ScaleMin / ScaleMax | Defines the range of source data type numeric scale.
SizeMin / SizeMax | Defines the range of source data type string length.
SourceDataType | Source data type.
TargetDataType | Target data type.
NameMask | Column name mask.

If a precision, scale or size is not used by the rule, then its value must be -1 (default value). If a source data type conforms to some rule, then a column data type will be defined using corresponding TargetDataType.

Example

To define mapping rules for sample above, use code:

with ADConnection1.FormatOptions do begin
  OwnMapRules := True;
  with MapRules.Add do begin
    ScaleMin := 0;
    ScaleMax := 0;
    PrecMin := 0;
    PrecMax := 2;
    SourceDataType := dtBcd;
    TargetDataType := dtSByte;
  end;
  with MapRules.Add do begin
    ScaleMin := 0;
    ScaleMax := 0;
    PrecMin := 3;
    PrecMax := 4;
    SourceDataType := dtBcd;
    TargetDataType := dtInt16;
  end;
  with MapRules.Add do begin
    ScaleMin := 0;
    ScaleMax := 0;
    PrecMin := 5;
    PrecMax := 8;
    SourceDataType := dtBcd;
    TargetDataType := dtInt32;
  end;
  with MapRules.Add do begin
    ScaleMin := 4;
    ScaleMax := 4;
    PrecMin := 18;
    PrecMax := 18;
    SourceDataType := dtBcd;
    TargetDataType := dtCurrency;
  end;
end;
What do you think about this topic? Send feedback!


Establishing Connection

Establishing Connection
Working with Connections See Also Send Feedback

Describes how to open and close connection to a DBMS using FireDAC. To open a connection to a database FireDAC offers the TADConnection component.

Group

Working with Connections

Links
Working with Connections, See Also
Description
General

After a connection definition is created, the connection may be established to a database. In general, there are two ways:

  • explicitly, by setting TADCustomConnection.Connected to True or calling one of the Open methods;
  • implicitly, by performing any action requiring to talk to a DBMS. For example, by setting linked TADQuery Active property to True. Note, that ResourceOptions.AutoConnect must be True, otherwise an exception will be raised.

FireDAC offers few TADCustomConnection.Open methods additionally to the Connected property. These method allows to use an FireDAC connection string, which is a string in the form of param=value[;...param=value]. For example:

ADConnection1.Open('DriverID=SQLite;Database=c:\test.sdb;Password=12345');

Before the connection will be opened the BeforeConnect event will be fired. After connection establishment - AfterConnect.

Handling connection errors

If connection establishment fails, then an application may analyze failure using one of the approaches:

  • using OnError event handler. That is more appropriate when a connection is opened implicitly;
  • using try ... except ... end syntax. That is the best approach with explicit connection establishment. For example:

try
  ADConnection1.Connected := True;
except
  on E: EAbort do
    ; // user pressed Cancel button in Login dialog
  on E: EADDBEngineException do
    case E.Kind of
    ekUserPwdInvalid: ; // user name or password are incorrect
    ekUserPwdExpired: ; // user password is expired
    ekServerGone: ;     // DBMS is not accessible due to some reason
    else                // other issues
    end;
end;

Note, that Login dialog is automatically handling the ekUserPwdInvalid error kind, by suggesting to the user to repeat the login. And the ekUserPwdExpired, by allowing to the user to enter the new password.

Also, if the connection recovery is setup, then ekServerGone error kind will lead to bringing a connection to an initially offlined state. Alternatively the Ping method may be used to avoid ekServerGone error and make the connection active, when a DBMS is available.

See "Handling Errors" for more details.

Using the Login dialog

The GUI application may use TADGUIxLoginDialog component to allow the end users to enter the database credentials. The login dialog may be bind by one of the ways:

  • Drop the TADGUIxLoginDialog component to a form. No additional setup is required. This dialog will be a default Login dialog for an application.
  • Drop the TADGUIxLoginDialog component to a form and set TADCustomConnection.LoginDialog to this dialog. The dialog will be used privately by this connection.

The Login dialog will be automatically invoked by the TADCustomConnection, when LoginPrompt = True:

Using VisibleItems property you may specify which connection definition parameters to show to the end user and how to name them. The last option allows to localize the Login dialog. For example, German speaking SQL Server developers may specify:

with ADGUIxLoginDialog1.VisibleItems do begin
  Clear;
  Add('Server');
  Add('User_name=Benutzer');
  Add('Password=Kennwort');
  Add('OSAuthent');
end;
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.Connected := True;

When a DBMS supports password expiration, the password is expired and ChangeExpiredPassword is True, the dialog will ask for a new password.

Closing Connection

The connection may be closed by one of the two ways:

  • explicitly, by setting TADCustomConnection.Connected to False.
  • implicitly, when the connection object has no more active commands and datasets, and the ResourceOptions.KeepConnection is False.

Before connection will be closed FireDAC will finish the active transactions, if any. Use TxOptions.DisconnectAction to control the performed action.

Also before that the BeforeDisconnect event will be fired. After connection closing - AfterDisconnect.

See Also

Handling Errors, Defining Connection, Offlining Connection, TADCustomConnection Class, TADGUIxLoginDialog Class

What do you think about this topic? Send feedback!


Recovering Connection

Recovering Connection
Working with Connections See Also Send Feedback

Describes how to work in an unstable environment. FireDAC allows an application to recover from a connection failure.

Group

Working with Connections

Links
Working with Connections, See Also
Description
General

A database application may work within a non stable environment, where the network may be physically disconnected or the DBMS server may be restarted. Application need to seamlessly recover from such interruptions and continue to communicate with the DBMS.

The FireDAC automatic connection recovery allows you to detect when a connection has been lost, and to properly respond and recover from this situation. The lost is discovered only when some DB action is performed, like Open, ExecSQL or Ping. Then DBMS driver raises EADDBEngineException with Kind = ekServerGone.

The most simple way to verify a connection status and/or keep the connection alive is to call TADCustomConnection.Ping method. The Ping method may be used even when a connection is closed, to see when a connection may be established.

Known limitations:

DBMS
Description
Advantage Database
Not supported for a local free connection.
dbExpress bridge driver
  • FireDAC may fail to detect ekServerGone;
  • Ping method is not supported.
Informix
Required to set DirectExecute to True.
Microsoft Access
Not supported.
MySQL
To mimimize call delays when network connection is losted, consider to adjust ReadTimeout and WriteTimeout connection definition parameters.
ODBC bridge driver
  • FireDAC may fail to detect ekServerGone;
  • Ping method is not supported.
SQLite
Not supported.

Controlling connection recovery

To enable automatic connection recovery set ResourceOptions.AutoReconnect to True. And optionally use the TADCustomConnection event handlers:

  • OnRecover - to respond to the connection lost event and provide the next action to FireDAC;
  • OnLosted - fires when a connection was lost and not recovered;
  • OnRestored - fires when a connection was lost and recovered.

The response from OnRecover event handler may be to re-establish the connection, go into the offline mode, or simply close the connection. When OnRecover is not specified, FireDAC will try to re-establish connection. For example:

procedure TForm1.ADConnection1Recover(ASender: TObject;
  const AInitiator: IADStanObject; AException: Exception;
  var AAction: TADPhysConnectionRecoverAction);
var
  iRes: Integer;
begin
  iRes := MessageDlg('Connection is lost. Offline - yes, Retry - ok, Fail - Cancel',
    mtConfirmation, [mbYes, mbOK, mbCancel], 0);
  case iRes of
  mrYes:    AAction := faOfflineAbort;
  mrOk:     AAction := faRetry;
  mrCancel: AAction := faFail;
  end;
  Log('Connection is recovering');
end;

We strongly recommend to not close FireDAC manager from within OnRecover, OnLosted and OnRestored event handlers, as that can lead to unexpected problems.

Preparing application

When a connection is recovered, the following states are lost:

  • active transactions are rolled back, and execution is continued from the failed statement;
  • not yet fetched result sets are trimmed and TADDataSet.SourceEOF is set to True;
  • database session states are lost, including Oracle package states and session variables;
  • registered database alerts are unregistered.

To prepare your application to work in unstable environment and minimize failure affects, consider to setup:

  • FetchOptions.Mode to fmAll;
  • FetchOptions.RowsetSize to 200-500;
  • FetchOptions.AutoClose to True (default);
  • TxOptions.AutoCommit to True;
  • ResourceOptions.AutoReconnect to True.

The application may consider to use Offline connection mode and CachedUpdates.

See Also

TADCustomConnection Class, Establishing Connection, Offlining Connection

What do you think about this topic? Send feedback!


Offlining Connection

Offlining Connection
Working with Connections See Also Send Feedback

Describes how to use FireDAC offline mode allows to work with data without a persistent connection to a database.

Group

Working with Connections

Links
Working with Connections, See Also
Description
General

The FireDAC offline mode is similar to a multi-tier client, where most of time a client is disconnected from a database. The connection is active only when a client needs to exchange data with a database. That is useful when an application works in an unstable environment or requires to preserve the DBMS resources.

In offline mode a connection to a database is closed. But the datasets are opened.

Controlling offlining

To bring a connection to offline mode use one of the options:

  • call the TADCustomConnection.Offline method;
  • return AAction=amOfflineXxxx in TADCustomConnection.OnRecover method.

FireDAC does not allow to bring a connection to the offline mode automatically, as it does not know when the next time an application needs to contact a database. So, that must be done by the application code. Before the connection will be set to the offline mode, active datasets with not yet fetched result sets will perform an action specified by the FetchOptions.AutoFetchAll property.

To bring a connection to online mode use one of the following options:

  • explicit call of the TADCustomConnection.Online method;
  • implicit activation, when a connection needs to talk to a DBMS, either executing a command, either posting updates, etc. Note, that ResourceOptions.AutoConnect must be True, otherwise an exception will be raised.

If a dataset has ResourceOptions.PersistentFileName property specified, then at Open call, the connection is not required for the dataset. It will load the content from the specified file.

Note, bringing connection to offline and then to online mode is similar to recovering a broken connection in aspect that a database session state is lost. Read Recovering Connection article for more details.

See Also

TADCustomConnection Class, Establishing Connection, Recovering Connection

What do you think about this topic? Send feedback!


Managing Transactions

Managing Transactions
Working with Connections See Also Send Feedback

Describes how to manage DBMS transactions using FireDAC. To handle database transactions FireDAC offers the TADConnection and TADTransaction components.

Group

Working with Connections

Links
Working with Connections, See Also
Description
General

By default the FireDAC application is working in auto-commit mode, where a transaction is automatically started by FireDAC when it is required, and is committed on the successful command execution or rolled back on a failure. The auto-commit is controlled by the TADTxOptions.AutoCommit property. The auto-commit mode is simple to use for the application, but it:

  • slowdowns multiple updates to a database;
  • do not allow to perform few database operation in a single transaction;
  • cannot be prolonged in a time.

Alternatively the application may use the explicit transaction control. For that use the TADConnection methods StartTransaction, Commit, Rollback. Or to use the TADTransaction component. Note, the TADTransaction component usage is optional in FireDAC.

FireDAC offers the Isolation, ReadOnly, Params properties allowing to control the transaction mode. They apply as to auto-commit as to explicit transactions. Not all modes may be supported by DBMS, for example read-only mode, then FireDAC will use less restrictive mode. Note, that all settings will be applied to the next transactions only.

The standard code using explicit transaction looks like:

ADConnection1.StartTransaction;
try
  ADQuery1.ExecSQL;
  ....
  ADQuery1.ExecSQL;
  ADConnection1.Commit;
except
  ADConnection1.Rollback;
  raise;
end;

The TADTransaction component wraps the transaction control functionality into a component. Practically it offers the same transaction functionality as TADConnection, but allows to group commands and datasets by linking them to a specific transaction object. At first that refers to the multiple active transactions support, that is Firebird / Interbase servers feature.

The TADTxOptions.Params may be used to specify DBMS specific transaction attributes. At moment only Firebird / Interbase driver supports such attributes. Each attribute must be specified on a separate line. It will correspond to isc_tpb_<attribute name> transaction parameters.

Nested transactions

Although none of the supported DBMS's supports the nested transactions, they are emulated by FireDAC using the savepoints. Means, the nested StartTransaction call will not start a new transaction and will not raise an exception, but will put a savepoint. If a DBMS does not support savepoints, then "Capability is not supported" exception will be raised.

To disable nested transaction set TADTxOptions.EnableNested to False. Then nesting StartTransaction call will raise an exception.

Corresponding Commit call releases a savepoint and Rollback rolls back to a savepoint. For example:

// start new transaction
ADConnection1.StartTransaction;
try
  ADQuery1.ExecSQL;
  ....

  // set savepoint
  ADConnection1.StartTransaction;
  try
    ADQuery1.ExecSQL;
    ....

    // release savepoint
    ADConnection1.Commit;
  except
    // rollback to savepoint
    ADConnection1.Rollback;
    raise;
  end;

  // commit transaction
  ADConnection1.Commit;

except
  // rollback transaction
  ADConnection1.Rollback;
  raise;
end;

Note, that nested transaction will use the settings of the most top transaction.

Continuous transactions

The CommitRetaining and RollbackRetaining methods are similar to the Commit and Rollback methods, but they do not finish the transaction. So, it remains active after these calls. The Firebird / Interbase servers are supporting this feature on the DBMS core level. For all other DBMS's this feature is emulated using the Commit / Rollback and StartTransaction calls.

Multiple active transactions

The Firebird / Interbase server supports multiple active transactions on the DBMS core level. That means, that some commands may be performed in one transaction context, others in the second transaction context, etc. To support this feature FireDAC offers TADTransaction component. It single instance allows to handle single transaction in each moment of the time.

The TADCustomConnection properties may be used to setup default transaction objects:

  • Transaction - the default transaction object for all commands;
  • UpdateTransaction - the default transaction for all update commands, used to post updates from the FireDAC datasets. Note, the UpdateTransaction will not be used, for example, for a UPDATE query explicitly specified for TADQuery component.

The TADCustomQuery and other components have similar properties:

  • Transaction - the explicit transaction object to use to execute the SQL query;
  • UpdateTransaction - the explicit transaction object to use to post updates from the dataset.

In general, the good practice to setup transaction objects for Firebird / Interbase application:

UpdateTransaction: TADTransaction;
ReadTransaction: TADTransaction;
...
// setup transaction for updating commands: read_committed, rec_version, nowait
UpdateTransaction.Connection := ADConnection1;
ADConnection1.UpdateOptions.LockWait := False;
UpdateTransaction.Options.ReadOnly := False;
UpdateTransaction.Options.Isolation := xiReadCommitted;
...
ReadTransaction.Connection := ADConnection1;
ReadTransaction.Options.ReadOnly := True;
ReadTransaction.Options.Isolation := xiReadCommitted;
...
SelectQuery.Transaction := ReadTransaction;
SelectQuery.UpdateTransaction := UpdateTransaction;

Note, you can use few TADTransaction's for other DBMS's. Then all TADTransaction's will share the same transaction.

Transactions and cursors

A DBMS associates an open cursor with the transaction context, where it was opened. When the transaction finishes, the DBMS may invalidate the active cursors. The exact behavior depends on the DBMS:

DBMS | Action
Microsoft Access | Invalidates a cursor on StartTransaction / Commit / Rollback.
Firebird / Interbase | Invalidates a cursor on Commit / Rollback.
IBM DB2 | Invalidates a cursor on Rollback.
MySQL | Invalidates a cursor on StartTransaction / Commit / Rollback.
Oracle | <nothing>
PostgreSQL | Invalidates a cursor on Commit / Rollback.
SQLite | Invalidates a cursor on Rollback.
SQL Anywhere | <nothing>
SQL Server | Invalidates a cursor on StartTransaction / Commit / Rollback.

When FireDAC discovers a transaction control command that will lead to the cursor invalidation, FireDAC performs an actions specified by the FetchOptions.AutoFetchAll and releases the cursor.

Note, the Firebird / Interbase servers are invalidating the prepared statement on the transaction finish. So, the auto-commit mode may lead to performance degradation on these DBMS's.

See Also

TADCustomConnection, TADCustomTransaction, Executing Command

What do you think about this topic? Send feedback!


Handling Errors

Handling Errors
Working with Connections See Also Send Feedback

Describes how to handle database errors with FireDAC.

Group

Working with Connections

Links
Working with Connections, See Also
Description
General

The EADDBEngineException class is the base class for all DBMS exceptions. A single exception object is a collection of database errors, accessible through EADDBEngineException.Errors[] property and represented by the TADDBError class.

FireDAC combines "personalization" and unification of EADDBEngineException exception and TADDBError error classes. "Personalization" means that a driver may have its own exception and error classes, which contain information specific to the DBMS:

DBMS | Exception class | Error class
Advantage Database | uADPhysADSWrapper.EADSNativeException | uADStanError.TADDBError
Sybase SQL Anywhere | uADPhysASAWrapper.EASANativeException | uADPhysODBCWrapper.TADODBCNativeError
DataSnap server | uADPhysTDBXBase.ETDBXNativeException | uADStanError.TADDBError
IBM DB2 | uADPhysDB2.EDB2NativeException | uADPhysODBCWrapper.TADODBCNativeError
Firebird / Interbase | uADPhysIBWrapper.EIBNativeException | uADPhysIBWrapper.TADIBError
Microsoft Access | uADPhysMSAcc.EMSAccessNativeException | uADPhysODBCWrapper.TADODBCNativeError
Microsoft SQL Server | uADPhysMSSQL.EMSSQLNativeException | uADPhysMSSQL.TADMSSQLError
MySQL | uADPhysMySQLWrapper.MySQLNativeException | uADPhysMySQLWrapper.TADMySQLError
ODBC | uADPhysODBCWrapper.EODBCNativeException | uADPhysODBCWrapper.TADODBCNativeError
Oracle | uADPhysOracleWrapper.EOCINativeException | uADPhysOracleWrapper.TOCIError
PostgreSQL | uADPhysPGWrapper.EPgNativeException | uADPhysPGWrapper.TADPgError
SQLite | uADPhysSQLiteWrapper.SQLiteNativeException | uADStanError.TADDBError
dbExpress v1-3 | uADPhysDBExp.EDBXNativeException | uADStanError.TADDBError
dbExpress v4 | uADPhysTDBXBase.ETDBXNativeException | uADStanError.TADDBError

And TADDBError has ErrorCode property - the native DBMS error code.

"Unification" means that all driver exception classes are inherited from the EADDBEngineException - a single base class that contains driver independent information. And the Kind property - a DBMS independent error code. For example, code for handling a unique key violation may look like this:

try
  ADQuery1.ExecSQL('insert into MyTab(code, name) values (:code, :name)', [100, 'Berlin']);
except
  on E: EADDBEngineException do begin
    if E.Kind = ekUKViolated then
      ShowMessage('Please enter unique value !');
    raise;
  end;
end;

Error information

The error information is mainly present by the EADDBEngineException properties:

  • Errors - the collection of the TADDBError objects.
  • ErrorCount - the number of errors in Errors collection.
  • Kind - the DBMS independent error kind.
  • Message - the actual error message.

And by the TADDBError properties:

  • ErrorCode - DBMS vendor specific error code.
  • Kind - the DBMS independent error kind.
  • Message - the error message.

To simplify the application debugging or to make exception logging more informative, the EADDBEngineException provides the SQL and Params properties. That is the SQL command with parameter values leaded to the exception.

Also depending on the error area and the DBMS ability to provide the advanced error information, the following properties are useful:

  • When a SQL parsing error, then CommandTextOffset returns the offset in the SQL command text.
  • When a constraint violation, a DB object alteration failure or some other cases, then the ObjName property returns an database object name.
  • When a Array DML error, then RowIndex returns the array row index, to which the error belongs.

Handling exceptions

The exceptions may be processed using one of the ways:

  • using try / except / end construction. This is a standard Delphi way to handle exceptions. For example:

ADConnection1.StartsTransaction;
try
  ADQuery1.ExecSQL;
  ADConnection1.Commit;
except
  on E: EADDBEngineException do begin
    ADConnection1.Rollback;
    // do something here
    raise;
  end;
end;

  • setting TADQuery.OnError event handler;
  • setting TADConnection.OnError event handler. These ways are good for exception logging or exception "adjusting". For example:

procedure TForm1.ADConnection1Error(ASender: TObject; const AInitiator: IADStanObject;
  var AException: Exception);
var
  oExc: EADDBEngineException;
begin
  if AException is EADDBEngineException then begin
    oExc := EADDBEngineException(AException);
    if oExc.Kind = ekRecordLocked then
      oExc.Message := 'Please, try the operation later. At moment, the record is busy'
    else if (oExc.Kind = ekUKViolated) and SameText(oExc[0].ObjName, 'UniqueKey_Orders') then
      oExc.Message := 'Please, provide the unique order information. It seems, your order was already put';
  end;
end;

ADConnection1.OnError := ADConnection1Error;

  • setting TADQuery.OnExecuteError event handler for handling Array DML specific errors;
  • setting TADQuery.OnUpdateError event handler for handling updates posting errors;
  • setting TADConnection.OnLosted, OnRestored, OnRecover event handlers for handling connection lost errors.

Using end user error dialog

With help of TADGUIxErrorDialog component, an end user may be notified about errors returned by the database:

To use the dialog, just drop the component somewhere on a form. The dialog will hook TApplication.OnException event handler. And will popup the dialog, when there is an unhandled FireDAC exception. The "Query" page allows to see the SQL command text produced the exception. Pressing Ctrl+C in dialog will put complete exception information into clipboard.

See Also

Recovering Connection , Executing Command , uADStanError Namespace , TADCustomConnection.OnError , TADAdaptedDataSet.OnError Event

What do you think about this topic? Send feedback!


Multi Threading

Multi Threading
Example Working with Connections See Also Send Feedback

Describes how to use FireDAC in multi threading environment.

Group

Working with Connections

Links
Example, Working with Connections, See Also
Description
General

FireDAC is thread-safe, when the following conditions are meat:

  • A connection object and all associated with it objects (like TADQuery, TADTransaction, etc) in each moment of time must be used by a single thread.
  • ADManager must be activated before threads will start by setting ADManager.Active to True.

Means, after a thread opened a query, and until its processing is not finished, application cannot use this query and connection objects in an other thread. Or, after a thread started a transaction, and until it is not finished, application cannot use this transaction and connection objects in an other thread.

Practically this means an application must serialize access to a connection across all threads, and that is not a convenient technique. Breaking these rules may lead to misbehavior, AV's and errors like the SQL Server error "Connection is busy with results for another command".

The standard simplification is to create and use for each thread a dedicated connection object working with database. In this case, no additional serialization is required. For example the following code performs a DB tasks in threads:

type
  TDBThread = class(TThread)
  protected
    procedure Execute; override;
  end;

procedure TDBThread.Execute;
var
  oConn: TADConnection;
  oPrc: TADQuery;
begin
  FreeOnTerminate := False;
  oConn := TADConnection.Create(nil);
  oConn.ConnectionDefName := 'Oracle_Pooled'; // see next section
  oPrc := TADStoredProc.Create(nil);
  oPrc.Connection := oConn;
  try
    oConn.Connected := True;
    oPrc.StoredProcName := 'MY_LONG_RUNNING_PROC';
    oPrc.ExecProc;
  finally
    oPrc.Free;
    oConn.Free;
  end;
end;

// main application code
var
  oThread1, oThread2: TDBThread;
begin
  ADManager.Active := True;
  ...
  oThread1 := TDBThread.Create(False);
  oThread2 := TDBThread.Create(False);
  ...
  oThread1.WaitFor;
  oThread1.Free;
  oThread2.WaitFor;
  oThread2.Free;
end;

Note, for above case, where application runs a single SQL query in background, consider to use asynchronous query execution mode.

Note, multi-threaded application may close connections opened in the background threads in a TADManager.BeforeShutdown event handler to avoid possible dead lock.

Connection Pooling

One of the expensive database interaction operations is the connection establishment. In multi threading application, where each thread starts, establish connection, performs some short task and releases connection, the repetitive connection establishments may lead to performance degradation across all system. To avoid that the application may use the connection pooling.

The connection pooling may be enabled only for persistent or private connection definition by setting Pooled=True. For example, persistent definition:

[Oracle_Pooled]
DriverID=Ora
Database=ORA_920_APP
User_Name=ADDemo
Password=a
Pooled=True

Or private definition setup:

var
  oParams: TStrings;
begin
  oParams := TStringList.Create;
  oParams.Add('Database=ORA_920_APP');
  oParams.Add('User_Name=ADDemo');
  oParams.Add('Password=a');
  oParams.Add('Pooled=True');
  ADManager.AddConnectionDef('Oracle_Pooled', 'Ora', oParams);
  .....................
  ADConnection1.ConnectionDefName := 'Oracle_Pooled';
  ADConnection1.Connected := True;

None additional parameters may be specified in TADConnection.Params property, as all pooled connections must share the same connection parameters.

Setting TADConnection.Connected to True acquires a physical connection from the pool. Setting TADConnection.Connected to False releases the physical connection to the pool, but keeps connection opened. To close and destroy all pooled physical connections, the application may call TADManager.CloseConnectionDef method:

ADManager.CloseConnectionDef('Oracle_Pooled');

or close the FireDAC driver manager by calling:

ADManager.Close;

Additional connection definition parameters may be specified to setup a pool:

Parameter | Description | Example
POOL_CleanupTimeout | The timeout (msecs) when FireDAC will remove connections unused more than POOL_ExpireTimeout time. Default value is 30000 msecs (30 secs). | 3600000
POOL_ExpireTimeout | The time (msecs) after which the inactive connection may be deleted from the pool and destroyed. Default value is 90000 msecs (90 secs). | 600000
POOL_MaximumItems | The maximum number of connection in the pool. When application will require more connections, then exception will be riased. Default value is 50. | 100
See Also

Configuring Drivers, Defining Connection, Establishing Connection

Example

For example see the FireDAC\Samples\Comp Layer\TADConnection\Pooling demo.

What do you think about this topic? Send feedback!


DLL Development

DLL Development
Example Working with Connections See Also Send Feedback

Describes how to use FireDAC in the dynamic loading libraries.

Group

Working with Connections

Links
Example, Working with Connections, See Also
Description
General

FireDAC may be used in a DLL as in a normal application. But developers must be aware of two techniques, specific to DLL development.

Connection sharing between application and DLL

When a connection must be transferred from an application to the DLL's, the application should not transfer the TADCustomConnection object, as it may lead to AV's and other issues. This is not the FireDAC issue, it is due to the Delphi RTL / RTTI limitations. Note, a connection cannot be shared with other process, as the sharing works only inside the same address space.

To transfer a connection between an application and a DLL, application should transfer the TADCustomConnection.CliHandle property value to the DLL. There the handle must be assigned to the TADCustomConnection.SharedCliHandle property.

After the SharedCliHandle is assigned the DLL connection may be activated by setting Connected to True. Note, there is no need to setup connection definition, including DriverID. Then connection may be used as a normal database connection. Finally it may be closed by setting Connected to False. That will not close the physical connection, so the application connection will remain active.

The application connection does not track state changes, performed by the DLL. So, the DLL should preserve the same transaction state, as it was before DLL call. Best - do not handle transactions in a DLL, change transaction isolation level and other settings in a DLL.

Also, setting SharedCliHandle does not transfer any of option values from an application to a DLL connection object. The DLL connection options may be set similar to the application connection options.

For example, the DLL code:

procedure SomeTask(ACliHandle: LongWord); stdcall;
var
  oConn: TADConnection;
begin
  oConn := TADConnection.Create(nil);
  oQuery := TADQuery.Create(nil);
  try
    oConn.SharedCliHAndle := ACliHandle;
    oConn.Connected := True;

    oQuery.Connection := oConn;
    oQuery.ExecSQL('delete from aaa');
  finally
    oQuery.Free;
    oConn.Free;
  end;
end;

exports
  SomeTask;

And the application code:

procedure TForm1.Button1Click(Sender: TObject);
type
  TSomeTaskProc = procedure (ACliHandle: LongWord); stdcall;
var
  hDll: THandle;
  pSomeTask: TSomeTaskProc;
begin
  hDll := LoadLibrary(PChar('Project2.dll'));
  try
    @pSomeTask := GetProcAddress(FhDll, PChar('SomeTask'));
    ADConnection1.StartTransaction;
    try
      pSomeTask(ADConnection1.CliHandle);
      ADConnection1.Commit;
    except
      ADConnection1.Rollback;
      raise;
    end;
  finally
    FreeLibrary(hDll);
  end;
end;

Note, this code does not:

  • handle DLL loading errors;
  • care about FireDAC DLL unloading - see next chapter;
  • keep DLL loaded for a long time and keep DLL objects for a long time.

FireDAC DLL unloading

An application may hang-up at unloading of a DLL containing FireDAC. The standard symptom for that is the application hanging on the FreeLibrary call. This is the FireDAC limitation, which has two workarounds:

  1. Enable FireDAC silent mode in the DLL, so no wait cursors, no dialogs, etc will be shown by the FireDAC. For that put in your DLL DPR file:

uses
  uADGUIxIntf;

begin
  FADGUIxSilentMode := True;
end.

  2. Terminate FireDAC manager before unloading of a DLL. For that the DLL should export a procedure, which will call ADTerminate procedure. For that put in your DLL DPR file:

uses
  uADStanFactory;

procedure Shutdown;
begin
  ADTerminate;
end;

exports
  Shutdown;

Then import and call the Shutdown procedure from the application before FreeLibrary call:

var
  Shutdown: procedure;
....
  Shutdown := GetProcAddress(hLib, 'Shutdown');
  if Assigned(Shutdown) then
    Shutdown();
  FreeLibrary(hLib);

Note, the above technique must be used for the ActiveX servers with FireDAC inside.

See Also

TADCustomConnection.CliHandle, TADCustomConnection.SharedCliHandle

Example

For example see the FireDAC\Samples\Comp Layer\TADConnection\DLL_Sharing demo.

What do you think about this topic? Send feedback!


Unicode Support

Unicode Support
Working with Connections Send Feedback

Describes how FireDAC works with Unicode data and metadata. FireDAC fully support Unicode data and metadata. Although an application may need to take the additional steps to use Unicode properly.

Group

Working with Connections

Links
Working with Connections
Description
General

Most enterprise-class database applications must be able to work with character data encoded provided as Unicode. FireDAC provides seamless support for:

  • different single byte client character sets and code pages, including standard ANSI;
  • as well multi-byte strings such as Unicode, including UTF8, UTF16 and UCS2 encodings.

FireDAC Unicode handling depends on:

  • the version of Delphi being used;
  • client character set - UTF8/UTF16 or ACP compatible;
  • DBMS client / driver.

FireDAC performs transparent character set conversion between Delphi application and DBMS client character set, when it is required. Note, that the complete Unicode support may be achieved only with the Unicode Delphi version usage - Delphi 2009 and higher. The following table summarizes where and what encoding may be used depending on a Delphi version:

Usage
Unicode enabled Delphi 2009 and higher
Non-Unicode enabled Delphi 2007 and less
SQL command text
Unicode
ANSI
SQL script text
Unicode
ANSI
Result set field values
Unicode / ANSI
ANSI / Unicode
Parameter values
Unicode / ANSI
ANSI / Unicode
Metadata values, including:
  • column names,
  • table names;
  • generator names;
  • index names;
  • etc
Unicode
ANSI
Metadata query values
ANSI
ANSI
Text data files
Unicode / ANSI
ANSI / Unicode
Trace output
Unicode / ANSI
ANSI / Unicode
Tools
Unicode
Unicode

Configuring connection definitions for Unicode

Note: It is recommended to set the DBMS client character set to Unicode, for Delphi 2009 and higher, to avoid conversion loss.

In general, to configure connection definitions for Unicode, it is required to set the DBMS client character set to Unicode. How this is done depends on the version of Delphi and the used DBMS driver:

DBMS
Parameter
Advantage Database Server
Not supported.
IBM DB2 Server
Automatically set to UTF16 in Delphi 2009 and higher. Not supported in Delphi 2007 or less.
DataSnap server
Automatically set to UTF16 in Delphi 2009 and higher. Not supported in Delphi 2007 or less.
Interbase or Firebird Server
CharacterSet=utf8
Microsoft SQL Server
Automatically set to UTF16 in Delphi 2009 and higher. Not supported in Delphi 2007 or less.
Microsoft Access Database
Automatically set to UTF16 in Delphi 2009 and higher. Not supported in Delphi 2007 or less.
MySQL Server
CharacterSet=utf8
Oracle Server
  • CharacterSet=utf8;
  • or NLS_LANG=_.UTF8, if CharacterSet is not specified.
PostgreSQL
CharacterSet=utf8
SQLite database
Automatically set to UTF16 in Delphi 2009 and higher. Not supported in Delphi 2007 or less.
Sybase SQL Anywhere
Automatically set to UTF16 in Delphi 2009 and higher. Not supported in Delphi 2007 or less.
dbExpress bridge driver
Depends on dbExpress driver.
ODBC bridge driver
Automatically set to UTF16 in Delphi 2009 and higher. Not supported in Delphi 2007 or less.

SQL command text

Starting with Delphi 2009, TADQuery.SQL, TADCommand.CommandText, IADPhysCommand.CommandText, and other property values are Unicode encoded. The SQL command text preprocessor supports only UCS2 encoding, which means that surrogate pairs are not supported.

Pre Delphi 2009 versions support only ANSI encoded command text.

Before sending SQL command text to the DBMS, FireDAC converts it to:

  • Active Code Page, if the client character set is SBCS (non Unicode). If the client character set is not compatible with ACP, conversion loss is possible.
  • UTF8, if client character set is UTF8.
  • UTF16, if client character set is UTF16.

To specify Unicode encoded SQL command text, just do the following:

ADQuery1.SQL.Text := 'select ''Hello world !'' where Lang = ''RU'' and Val = ''Привет мир !''';

SQL script text

Starting with Delphi 2009, TADScript.SQLScripts collections can contain Unicode encoded SQL script texts. Other than that, SQL script text processing is similar to SQL command text processing.

Pre Delphi 2009 versions support only ANSI encoded script text. TADScript can load Unicode encoded SQL script files, but they will be converted into ACP (ANSI) encoding before processing.

To control SQL script file and log file encoding, use TADScript.ScriptOptions.FileEncoding property:

ADScript1.ScriptOptions.FileEncoding := enUTF16;
ADScript1.SQLScriptFileName := 'u:\builddb.sql';
ADScript1.ExecuteAll;

Result set fields
DBMS
Description
Advantage Database Server
  • NCHAR - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • NVARCHAR - ftWideString;
  • NMEMO - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
IBM DB2 Server
  • GRAPHIC - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • VARGRAPHIC - ftWideString;
  • LONG VARGRAPHIC, DBCLOB - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
DataSnap server
  • ftFixedWideChar on Delphi 2006 and higher and ftWideString;
  • ftWideMemo on Delphi 2006 and higher and ftFmtMemo.
Interbase or Firebird Server
If CharacterSet is UTF8 or UNICODE_FSS, then:
  • CHAR - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • VARCHAR - ftWideString;
  • BLOB SUB_TYPE TEXT - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
Microsoft SQL Server
  • NCHAR - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • NVARCHAR - ftWideString;
  • NTEXT, NVARCHAR(MAX) - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise;
Microsoft Access Database
  • CHARACTER - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • MEMO - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
MySQL Server
If CharacterSet is UTF8, then:
  • CHAR - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • VARCHAR, TINYTEXT - ftWideString;
  • MEDIUMTEXT, TEXT, LONGTEXT - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
Oracle Server
  • NCHAR - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • NVARCHAR2 - ftWideString;
  • NCLOB - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
If CharacterSet is UTF8, then:
  • CHAR - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • VARCHAR2 - ftWideString;
  • LONG, CLOB - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
SQLite Database
If StringFormat=Choose, then:
  • NCHAR, NATIONAL CHAR, NATIONAL CHARACTER - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • NVARCHAR, NVARCHAR2, NATIONAL CHARACTER VARYING, NATIONAL CHAR VARYING - ftWideString;
  • NTEXT, WTEXT, NCLOB, NMEMO, LONG NTEXT, LONG WTEXT, NATIONAL TEXT, LONGWVARCHAR - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
If StringFormat=Unicode, then all string column are Wide strings. If StringFormat=Ansi, then - ANSI strings.
PostgreSQL
If CharacterSet is UTF8, then:
  • CHAR - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • VARCHAR - ftWideString;
  • TEXT - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
Sybase SQL Anywhere
  • NCHAR - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • NVARCHAR - ftWideString;
  • LONG NVARCHAR - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
dbExpress bridge driver
Depends on dbExpress driver and DBMS. The general rule:
DBX1-3:
  • fldZSTRING, fldstUNICODE - ftWideString;
  • fldZSTRING, fldstUNICODE, fldstFIXED - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • fldBLOB, fldstMEMO, fldstUNICODE - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise;
  • fldBLOB, fldstFMTMEMO - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.
DBX4:
  • TDBXDataTypes.WideStringType - ftWideString;
  • TDBXDataTypes.WideStringType, TDBXDataTypes.FixedSubType - ftFixedWideChar;
  • TDBXDataTypes.BlobType, TDBXDataTypes.WideMemoSubType - ftWideMemo.
ODBC bridge driver
Depends on ODBC driver and DBMS. The general rule:
  • SQL_WCHAR, SQL_GRAPHIC - ftFixedWideChar on Delphi 2006 and higher, ftWideString otherwise;
  • SQL_WVARCHAR, SQL_VARGRAPHIC, SQL_LONGVARGRAPHIC - ftWideString;
  • SQL_WLONGVARCHAR, SQL_DBCLOB - ftWideMemo on Delphi 2006 and higher, ftFmtMemo otherwise.

To read/write Unicode string values programmatically use:

  • TField.AsWideString or TField.Value properties;
  • TField.AsString on Delphi 2009 and higher. On earlier Delphi versions reading / writing of AsString property may lead to conversion loss, since AsString returns ANSI strings there.

To read/write the Unicode field on any Delphi version:

ADQuery1.Edit;
ADQuery1.Fields[0].AsWideString := ADQuery1.Fields[0].AsWideString + 'русский + english';
ADQuery1.Post;

To read/write Unicode memo field on Delphi 2009:

ADQuery1.Edit;
ADQuery1.FieldsByName('memo').Assign(Memo1.Lines);
ADQuery1.Post;

Parameter values

The Unicode encoded parameter value is converted to a supported by DBMS Unicode character set and sent to the DBMS. This does not depend on a client character set or a Delphi version.

Note, Firebird and Interbase cannot send Unicode character data to a server if the CharacterSet parameter is not UTF8.

To read/write Unicode parameter value on any Delphi version:

ADQuery1.Params[0].AsWideString := 'русский + english';
// the same as following
ADQuery1.Params[0].Value := 'русский + english';
ADQuery1.Params[0].DataType := ftWideString;

Metadata values

Starting with Delphi 2009, Unicode encoded metadata text is supported for:

  • table names;
  • resultset column names;
  • stored procedure names;
  • stored procedure parameter names;
  • SQL command parameter names;
  • SQL command macro names;
  • user name;
  • schema, catalog names.

Pre Delphi 2009 versions support only ANSI encoded metadata text.

Note: At the moment, FireDAC does not support Unicode encoded column values in metadata result sets, returned by TADMetaInfoCommand, TADMetaInfoQuery and IADPhysMetaInfoCommand.

Text data files

Starting with Delphi 2009, TADDataMove can read/write Unicode encoded text data files without conversion loss. On prior Delphi versions TADDataMove can read/write Unicode encoded text data files, but internally handles all data as ACP encoded. So, conversion loss is possible.

To control encoding of:

  • text data file, use TADDataMove.TextFileEncoding property;
  • log file, use TADScript.ScriptOptions.LogFileEncoding property.

To read Unicode data file and create ACP encoded log file do:

ADDataMove1.TextFileName := 'u:\data.txt';
ADDataMove1.TextFileEncoding := enUTF8;
ADDataMove1.LogFileName := 'u:\log.txt';
ADDataMove1.TextFileEncoding := enANSI;
ADDataMove1.Destination := ADQuery1;
ADDataMove1.SourceKind := skText;
ADDataMove1.Execute;

Trace output

To enable Unicode encoding for trace file output (MonitorBy=FlatFile), set TADMoniFlatFileClientLink.FileEncoding property value to ecUTF8 or ecUTF16.

Tools

All FireDAC utilities are compiled with Unicode Delphi version and are 100% Unicode enabled.

What do you think about this topic? Send feedback!


Working with Commands

Working with Commands
FireDAC Topics Send Feedback

A set of articles describing how to execute SQL commands with FireDAC, exchange data and metadata.

Group

FireDAC

Topics
Topic | Description
Preprocessing Command Text | FireDAC offers powerful SQL command text preprocessor. Allowing to write DBMS independent SQL commands and to get more flexibility while building dynamic SQL command. The preprocessor features include substitution variables, escape sequences, escape functions and conditional escapes.
Executing Command | FireDAC offers TADQuery, TADCommand components and some TADConnection methods to execute SQL commands. The SQL commands are the main way to talk to SQL database.
Executing Stored Procedure | FireDAC offers TADStoredProc component to execute database stored procedures, as a stored procedure may be executed directly.
Browsing Table | FireDAC offers TADTable component to browse database table data, filter and sort records, and edit the table data.
Database Alerts | FireDAC offers the TADEventAlerter component to listen for database alerts, send the alerts and manage them.
Fetching Rows | When a SQL command is executed it may create a cursor returning the result set. FireDAC offers wide range of features to effectively process the cursor and fetch rows into the client records cache.
Command Batches | FireDAC supports SQL command batches. Command batches allowing to execute multiple SQL commands in a single step and to process multiple result sets in a sequence.
Array DML | FireDAC offers high performance Array DML feature. It allows to move large volumes of data to a database using standard INSERT or UPDATE SQL commands.
Asynchronous Execution | FireDAC offers multiple features for asynchronous operation execution. In addition to being ready for use in multi-threaded applications, FireDAC makes it easy for the developer to not have to worry about multi-threading in the first place by allowing you to control the timing aspects of the data access operation execution. This includes Execute, Open and Fetch operations.
Executing SQL Scripts | Most database applications have backend administration utilities, which must execute SQL script. These scripts are written using lines appropriate to the DBMS SQL script syntax. TADScript is the FireDAC SQL script processor.
Local SQL | FireDAC offers flexible Local SQL feature. It allows to execute SQL queries against TDataSet descendants as the data sources.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Preprocessing Command Text

Preprocessing Command Text
Working with Commands See Also Topics Send Feedback

FireDAC offers powerful SQL command text preprocessor. Allowing to write DBMS independent SQL commands and to get more flexibility while building dynamic SQL command. The preprocessor features include substitution variables, escape sequences, escape functions and conditional escapes.

Group

Working with Commands

Topics
Topic | Description
Character macro functions | List of the functions working with character strings.
Numeric macro functions | List of the functions working with numbers.
Date and time macro functions | List of the functions working with date and time.
System macro functions | List of the special functions.
Convert macro function | Describes the CONVERT function.
RETURNING unified support | FireDAC supports the Firebird, Oracle and PostgreSQL RETURNING phrase.
Links
Working with Commands, See Also, Topics
Description
General

In this text in other places a "macro" and "escape sequence" are interchangeable phrases. FireDAC supports three kinds of macro instructions:

  • Substitution variables. They allow to put substitution parameters in a command text. This is to extend the use of parameters. For example, to parameterize a table name in FROM clause or the column names in SELECT clause, the substitution variables can be used but the parameters are of no use.
  • Escape sequences. They allow writing DBMS independent SQL commands.
  • Conditional substitutions. They allow expand SQL command conditionally, depending on application defined attributes or currently attached DBMS.

Setting CommandText or SQL property values will automatically fill the Macros collection property when ResourceOptions.MacroCreate is True. At Prepare call, the FireDAC command preprocessor transforms command text into a form understood by the DBMS when ResourceOptions.MacroExpand is True. This means, the macros are not visible to the DBMS.

The Params collection property is filled automatically when ResourceOptions.ParamCreate is True. At Prepare call FireDAC replaces the FireDAC parameter markers with the DBMS native markers when ResourceOptions.ParamExpand is True.

The escape sequences and conditional substitutions are processed when ResourceOptions.EscapeExpand is True.

SQL dialect abstraction

If the application needs to support multiple DBMS’s, then it must be aware that their SQL dialects may be different. FireDAC escape sequences allow you to write SQL dialect independent SQL commands.

For example, the function to convert string to upper case is different in MySQL, Oracle and Microsoft SQL Server. But the following command will work on any DBMS:

SELECT {ucase(Name)} FROM MyTable

Note, with SQLite add the uADStanExprFuncs unit to your "uses" clause. In more complex cases, parts of the command or even the full command must be written differently. Then, the FireDAC conditional escape sequence will help:

{IF Oracle} SELECT * FROM OracleTab {fi}
{IF MSSQL} SELECT * FROM MSSQLTab {fi}

Substitution variables

A substitution variable starts with ‘!’ or ‘&’ symbol and is followed by the macro variable name. For example:

 SELECT * FROM &TabName

The symbols have the following meaning:

• ‘!’ - “string” substitution mode. Macro value will be substituted “as is”, directly into the command text without any transformations.

• ‘&’ – “SQL” substitution mode. Macro value will be substituted depending on the macro data type, using target DBMS syntax rules.

To use the macros use the code like this:

ADQuery1.SQL.Text := 'SELECT * FROM &TabName';
ADQuery1.MacroByName('TabName').AsRaw := 'Orders';
ADQuery1.Open;

The macros are processed when ResourceOptions.MacroCreate and MacroExpand are True.

Parameter markers

A parameter marker starts with ':' symbol and is followed by the parameter name. For example:

SELECT * FROM Orders WHERE OrderDate > :FROM_DATE

The '?' symbol is recognized an unnamed parameter marker. This is for DataSnap compatibility and should not be used in an ordinary FireDAC application.

To use the parameters read the "Using parameters" chapter at "Executing Command". The parameters are processed when ResourceOptions.ParamCreate and ParamExpand are True.

Escape sequences

FireDAC has 5 kinds of escape sequences:

• Allowing constant substitution.

• Allowing identifier substitution.

• Conditional substitution.

• LIKE operator escape sequence.

• Scalar functions.

The escape sequences are processed when ResourceOptions.EscapeExpand is True.

The constant substitution escape sequences allow writing constants in command text, independent on DBMS syntax and regional settings. Following describes escape sequences expansion to DBMS syntax:

Format | Description
{e <number>} | Number constant. <number> must be specified with '.' as decimal separator. For example: {e 123.7} -> 123,7 on MSAccess
{d <date>} | Date constant. <date> must be specified in 'yyyy-mm-dd' format. For example: {d 2004-08-30} -> TO_DATE('2004-08-30', 'yyyy-mm-dd') on Oracle.
{t <time>} | Time constant. <time> must be specified in 'hh24:mi:ss' format. For example: {t 14:30:00} -> CONVERT(DATETIME, '14:30:00', 114) on SQL Server
{dt <date & time>} | Date and time constant. <date & time> must be in the above formats.
{l <boolean>} | Boolean constant. <boolean> is False or True. If DBMS supports Boolean data type, then sequence expands to that type constant, otherwise to numeric values 0 or 1.
{s <string>} | String constant. <string> is quoted or not quoted sequence of characters. For example: {s Company '1st Coding'} -> 'Company ''1st Coding'''

The identifier substitution escape sequence allows abstracting from DBMS specific identifier quoting rules. Read the "Object Names" chapter for more details. The syntax is:

Format | Description
{id <identifier name>} | Expands to DBMS specific quoted identifier syntax. For example: {id Order Details} -> “Order Details” on Oracle.

The escape function sequence allows abstracting from a DBMS specific set of a build-in functions and their syntax. The syntax is:

Format
Description
{fn <function name>(<arguments>)}
The escape functions syntax and set is identical to the ODBC escape functions. In the sub topics the FireDAC escape functions are listed. For example:
SELECT * FROM MyTab WHERE Year = {fn YEAR({fn NOW()}} or
SELECT * FROM MyTab WHERE Year = {YEAR({NOW()}} ->
SELECT * FROM MyTab WHERE Year = TO_NUMBER(TO_CHAR(SYSDATE, 'YYYY')) on Oracle.
{<function name>(<arguments>)}
The same as above.

Conditional substitution

Conditional substitution escape sequences allow substitute text into command, depending on either a DBMS the application is connected to, either on a macro variable value. Beside different syntaxes, these constructions handle parameters and macros in different ways. Escape sequence syntaxes are:

Format
Description
{iif (X1, Y1, …, XN, YN, YN+1) }
Here Xi is either:
  • DBMS identifier. So, if application is connected to this DBMS, then Yi text will be substituted into command.
  • Macro variable. If it value is not empty, then Yi text will be substituted into command.
If neither of conditions is meted and YN+1 text is specified, then it will be substituted into command. Parameters and macros in either Xi and Yi will be created in Params and Macros collection.
{if x} y {fi}
Here X is either:
  • DBMS identifier. So, if application is connected to this DBMS, then Y text will be substituted into command.
  • Macro variable. If it value is not empty, then Y text will be substituted into command.
Parameters and macros in Y will be created in Params and Macros collection only if X is “true”.

FireDAC DBMS identifiers are case insensitive. Following table lists them:

Identifier | DBMS
ADS | Advantage Database Server
ASA | Sybase SQL Anywhere
DB2 | IBM DB2
INTRBASE | Interbase or Firebird Server
MSACCESS MSACC | Microsoft Access database
MSSQL | Microsoft SQL Server
MYSQL | MySQL Server
ORACLE ORA | Oracle Server
OTHER | Any other DBMS, not listed in the table.
POSTGRESQL PG | PostgreSQL Server
SQLITE | SQLite database

For example:

{iif (Oracle, TO_CHAR, MSSQL, CONVERT)}          -> ‘TO_CHAR’ on Oracle and ‘CONVERT’ on SQL Server.
{iif (&v1, Me, &v2, You, We)}                   -> ‘Me’ if &v1 has nonempty value, ‘you’ if &v2 has nonempty value, otherwise ‘We’.
{if Oracle} TO_CHAR {fi} {if MSSQL} CONVERT {fi} -> TO_CHAR on Oracle and CONVERT on SQL Server.
{if &v1} Me {fi} {if &v2} You {fi}              -> ‘Me’ if &v1 has nonempty value + ‘you’ if &v2 has nonempty value.

Note, escape functions IF/IIF have the same names. To distinguish a function from a conditional substitution, use {fn IF(...)} or {fn IIF(...)} syntax.

Special character processing

To transmit special characters - ‘!’, ‘&’, ‘:’, '?', ‘{‘ or ‘}’ to the DBMS, you will need:

• to double special character. For example, ‘{{‘.

• on MySQL precede this character by ‘\’ character. For example, ‘\”’.

• for '!', '&', '{', '} set ResourceOptions.MacroCreate, MacroExpand and EscapeExpand to False.

• for ':', '?' set ResourceOptions.ParamCreate, ParamExpand to False.

Otherwise '!', '&', '{', '}' characters will be treated as a macro command. And ':', '?' as a parameter marker, excluding the following cases:

• Oracle PL/SQL assignment operator is detected by FireDAC and will not be treated as parameter marker.

• Firebird EXECUTE BLOCK parameters inside of BEGIN … END are detected by FireDAC and will not be treated as parameter marker.

• TSQL label is detected by FireDAC and will not be treated as parameter marker.

See Also

Object Names

What do you think about this topic? Send feedback!


Character macro functions

Character macro functions
Preprocessing Command Text Send Feedback

List of the functions working with character strings.

Group

Preprocessing Command Text

Links
Preprocessing Command Text
Description
CHARACTER
Function | Description | Local expression engine
ASCII(string_exp) | Returns the ASCII code value of the leftmost character of string_exp as an integer. | +
BIT_LENGTH(string_exp) | Returns the length in bits of the string expression. | -
CHAR(code) | Returns the character that has the ASCII code value specified by code. The value of code should be between 0 and 255; otherwise, the return value is data source–dependent. | +
CHAR_LENGTH(string_exp) | Returns the length in characters of the string expression, if the string expression is of a character data type; otherwise, returns the length in bytes of the string expression (the smallest integer not less than the number of bits divided by 8). (This function is the same as the CHARACTER_LENGTH function.) | +
CHARACTER_LENGTH(string_exp) | Returns the length in characters of the string expression, if the string expression is of a character data type; otherwise, returns the length in bytes of the string expression (the smallest integer not less than the number of bits divided by 8). (This function is the same as the CHAR_LENGTH function.) | +
CONCAT(string_exp1, string_exp2) | Returns a character string that is the result of concatenating string_exp2 to string_exp1. The resulting string is DBMS-dependent. For example, if the column represented by string_exp1 contained a NULL value, DB2 would return NULL but SQL Server would return the non-NULL string. | +
DIFFERENCE(string_exp1, string_exp2) | Returns an integer value that indicates the difference between the values returned by the SOUNDEX function for string_exp1 and string_exp2. | -
INSERT(string_exp1, start, length, string_exp2) | Returns a character string where length characters have been deleted from string_exp1, beginning at start, and where string_exp2 has been inserted into string_exp, beginning at start. | +
LCASE(string_exp) (ODBC 1.0) | Returns a string equal to that in string_exp, with all uppercase characters converted to lowercase. | +
LEFT(string_exp, count) | Returns the leftmost count characters of string_exp. | +
LENGTH(string_exp) | Returns the number of characters in string_exp, excluding trailing blanks. | +
LOCATE(string_exp1, string_exp2[, start]) | Returns the starting position of the first occurrence of string_exp1 within string_exp2. The search for the first occurrence of string_exp1 begins with the first character position in string_exp2 unless the optional argument, start, is specified. If start is specified, the search begins with the character position indicated by the value of start. The first character position in string_exp2 is indicated by the value 1. If string_exp1 is not found within string_exp2, the value 0 is returned. | +
LTRIM(string_exp) | Returns the characters of string_exp, with leading blanks removed. | +
OCTET_LENGTH(string_exp) | Returns the length in bytes of the string expression. The result is the smallest integer not less than the number of bits divided by 8. | +
POSITION(character_exp, character_exp) | Returns the position of the first character expression in the second character expression. The result is an exact numeric with an implementation-defined precision and a scale of 0. | +
REPEAT(string_exp, count) | Returns a character string composed of string_exp repeated count times. | +
REPLACE(string_exp1, string_exp2, string_exp3) | Search string_exp1 for occurrences of string_exp2, and replace with string_exp3. | +
RIGHT(string_exp, count) | Returns the rightmost count characters of string_exp. | +
RTRIM(string_exp) | Returns the characters of string_exp with trailing blanks removed. | +
SOUNDEX(string_exp) | Returns a data source–dependent character string representing the sound of the words in string_exp. For example, SQL Server returns a 4-digit SOUNDEX code; Oracle returns a phonetic representation of each word. | -
SPACE(count) | Returns a character string consisting of count spaces. | +
SUBSTRING(string_exp, start, length) | Returns a character string that is derived from string_exp, beginning at the character position specified by start for length characters. | +
UCASE(string_exp) | Returns a string equal to that in string_exp, with all lowercase characters converted to uppercase. | +
What do you think about this topic? Send feedback!


Numeric macro functions

Numeric macro functions
Preprocessing Command Text Send Feedback

List of the functions working with numbers.

Group

Preprocessing Command Text

Links
Preprocessing Command Text
Description
NUMERIC
Function | Description | Local expression engine
ABS(numeric_exp) | Returns the absolute value of numeric_exp. | +
ACOS(float_exp) | Returns the arccosine of float_exp as an angle, expressed in radians. | +
ASIN(float_exp) | Returns the arcsine of float_exp as an angle, expressed in radians. | +
ATAN(float_exp) | Returns the arctangent of float_exp as an angle, expressed in radians. | +
ATAN2(float_exp1, float_exp2) | Returns the arctangent of the x and y coordinates, specified by float_exp1 and float_exp2, respectively, as an angle, expressed in radians. | +
CEILING(numeric_exp) | Returns the smallest integer greater than or equal to numeric_exp. The return value is of the same data type as the input parameter. | +
COS(float_exp) | Returns the cosine of float_exp, where float_exp is an angle expressed in radians. | +
COT(float_exp) | Returns the cotangent of float_exp, where float_exp is an angle expressed in radians. | +
DEGREES(numeric_exp) | Returns the number of degrees converted from numeric_exp radians. | +
EXP(float_exp) | Returns the exponential value of float_exp. | +
FLOOR(numeric_exp) | Returns the largest integer less than or equal to numeric_exp. The return value is of the same data type as the input parameter. | +
LOG(float_exp) | Returns the natural logarithm of float_exp. | +
LOG10(float_exp) | Returns the base 10 logarithm of float_exp. | +
MOD(integer_exp1, integer_exp2) | Returns the remainder (modulus) of integer_exp1 divided by integer_exp2. | +
PI( ) | Returns the constant value of pi as a floating-point value. | +
POWER(numeric_exp, integer_exp) | Returns the value of numeric_exp to the power of integer_exp. | +
RADIANS(numeric_exp) | Returns the number of radians converted from numeric_exp degrees. | +
RAND([integer_exp]) | Returns a random floating-point value using integer_exp as the optional seed value. | +
ROUND(numeric_exp, integer_exp) | Returns numeric_exp rounded to integer_exp places right of the decimal point. If integer_exp is negative, numeric_exp is rounded to |integer_exp| places to the left of the decimal point. | +
SIGN(numeric_exp) | Returns an indicator of the sign of numeric_exp. If numeric_exp is less than zero, –1 is returned. If numeric_exp equals zero, 0 is returned. If numeric_exp is greater than zero, 1 is returned. | +
SIN(float_exp) | Returns the sine of float_exp, where float_exp is an angle expressed in radians. | +
SQRT(float_exp) | Returns the square root of float_exp. | +
TAN(float_exp) | Returns the tangent of float_exp, where float_exp is an angle expressed in radians. | +
TRUNCATE(numeric_exp, integer_exp) | Returns numeric_exp truncated to integer_exp places right of the decimal point. If integer_exp is negative, numeric_exp is truncated to |integer_exp| places to the left of the decimal point. | +
What do you think about this topic? Send feedback!


Date and time macro functions

Date and time macro functions
Preprocessing Command Text Send Feedback

List of the functions working with date and time.

Group

Preprocessing Command Text

Links
Preprocessing Command Text
Description
DATE, TIME
Function | Description | Local expression engine
CURRENT_DATE( ) | Returns the current date. | +
CURRENT_TIME[(time-precision)] | Returns the current local time. The time-precision argument determines the seconds precision of the returned value. | +
CURRENT_TIMESTAMP [(timestamp-precision)] | Returns the current local date and local time as a timestamp value. The timestamp-precision argument determines the seconds precision of the returned timestamp. | +
CURDATE( ) | Returns the current date. | +
CURTIME( ) | Returns the current local time. | +
DAYNAME(date_exp) | Returns a character string containing the data source–specific name of the day (for example, Sunday through Saturday or Sun. through Sat. for a data source that uses English, or Sonntag through Samstag for a data source that uses German) for the day portion of date_exp. | +
DAYOFMONTH(date_exp) | Returns the day of the month based on the month field in date_exp as an integer value in the range of 1–31. | +
DAYOFWEEK(date_exp) | Returns the day of the week based on the week field in date_exp as an integer value in the range of 1–7, where 1 represents Sunday. | +
DAYOFYEAR(date_exp) | Returns the day of the year based on the year field in date_exp as an integer value in the range of 1–366. | +
EXTRACT(extract-field, extract-source) | Returns the extract-field portion of the extract-source. The extract-source argument is a datetime or interval expression. The extract-field argument can be one of the following keywords: YEAR MONTH DAY HOUR MINUTE SECOND The precision of the returned value is implementation-defined. The scale is 0 unless SECOND is specified, in which case the scale is not less than the fractional seconds precision of the extract-source field. | +
HOUR(time_exp) | Returns the hour based on the hour field in time_exp as an integer value in the range of 0–23. | +
MINUTE(time_exp) | Returns the minute based on the minute field in time_exp as an integer value in the range of 0–59. | +
MONTH(date_exp) | Returns the month based on the month field in date_exp as an integer value in the range of 1–12. | +
MONTHNAME(date_exp) | Returns a character string containing the data source–specific name of the month (for example, January through December or Jan. through Dec. for a data source that uses English, or Januar through Dezember for a data source that uses German) for the month portion of date_exp. | +
NOW( ) | Returns current date and time as a timestamp value. | +
QUARTER(date_exp) | Returns the quarter in date_exp as an integer value in the range of 1–4, where 1 represents January 1 through March 31. | +
SECOND(time_exp) | Returns the second based on the second field in time_exp as an integer value in the range of 0–59. | +
TIMESTAMPADD(interval, integer_exp, timestamp_exp) | Returns the timestamp calculated by adding integer_exp intervals of type interval to timestamp_exp. Valid values of interval are the following keywords: FRAC_SECOND (*) SECOND MINUTE HOUR DAY WEEK MONTH QUARTER YEAR where fractional seconds are expressed in billionths of a second. For example, the following SQL statement returns the name of each employee and his or her one-year anniversary date: SELECT NAME, {fn TIMESTAMPADD(‘YEAR’, 1, HIRE_DATE)} FROM EMPLOYEES If timestamp_exp is a time value and interval specifies days, weeks, months, quarters, or years, the date portion of timestamp_exp is set to the current date before calculating the resulting timestamp. If timestamp_exp is a date value and interval specifies fractional seconds, seconds, minutes, or hours, the time portion of timestamp_exp is set to 0 before calculating the resulting timestamp. | +
TIMESTAMPDIFF(interval, timestamp_exp1, timestamp_exp2) | Returns the integer number of intervals of type interval by which timestamp_exp2 is greater than timestamp_exp1. Valid values of interval are the following keywords: FRAC_SECOND (*) SECOND MINUTE HOUR DAY WEEK MONTH QUARTER YEAR where fractional seconds are expressed in billionths of a second. For example, the following SQL statement returns the name of each employee and the number of years he or she has been employed: SELECT NAME, {fn TIMESTAMPDIFF(‘YEAR’, {fn CURDATE()}, HIRE_DATE)} FROM EMPLOYEES If either timestamp expression is a time value and interval specifies days, weeks, months, quarters, or years, the date portion of that timestamp is set to the current date before calculating the difference between the timestamps. If either timestamp expression is a date value and interval specifies fractional seconds, seconds, minutes, or hours, the time portion of that timestamp is set to 0 before calculating the difference between the timestamps. | +
WEEK(date_exp) | Returns the week of the year based on the week field in date_exp as an integer value in the range of 1–53. | +
YEAR(date_exp) | Returns the year based on the year field in date_exp as an integer value. The range is data source–dependent. | +

(*) Some DBMS's fail to work with FRAC_SECOND.

What do you think about this topic? Send feedback!


System macro functions

System macro functions
Preprocessing Command Text Send Feedback

List of the special functions.

Group

Preprocessing Command Text

Links
Preprocessing Command Text
Description
SYSTEM
Function
Description
Local expression engine
DATABASE( )
Returns the name of the database corresponding to the connection.
+
IFNULL(exp, value)
If exp is null, value is returned. If exp is not null, exp is returned. The possible data type or types of value must be compatible with the data type of exp.
+
IF(exp, value1, value2)
IIF(exp, value1, value2)
If exp is True, value1 is returned, otherwise - value2. Do not mix IF/IIF escape functions with IF/IIF conditional substitutions. To call IF/IIF escape function use {fn IF(...)} or {fn IIF(...)} syntax.
+
LIMIT([skip,] rows)
Allows to limit the result set, by skiping first <skip> records and returning to more than <rows> records. The function may be put in any place of the SQL command.
-
NEWGUID( )
Returns the new randomly generated GUID value. Is not supported as the escape function.
+
USER( )
Returns the user name in the DBMS. This can be different than the login name.
+
What do you think about this topic? Send feedback!


Convert macro function

Convert macro function
Preprocessing Command Text Send Feedback

Describes the CONVERT function.

Group

Preprocessing Command Text

Links
Preprocessing Command Text
Description
CONVERT
Function | Description | Local expression engine
CONVERT(value_exp, data_type) | The function returns the value specified by value_exp converted to the specified data_type, where data_type is one of the following keywords. | +

The supported keywords:

BIGINT | REAL
BINARY | SMALLINT
BIT | DATE
CHAR | TIME
DECIMAL | TIMESTAMP
DOUBLE | TINYINT
FLOAT | VARBINARY
GUID | VARCHAR
INTEGER | WCHAR
LONGVARBINARY | WLONGVARCHAR
LONGVARCHAR | WVARCHAR
NUMERIC |

The syntax for the explicit data type conversion function does not support specification of conversion format. The argument value_exp can be a column name, the result of another scalar function, or a numeric or string literal. For example:

 { fn CONVERT( { fn CURDATE() }, CHAR ) }

converts the output of the CURDATE scalar function to a character string. Because FireDAC does not mandate a data type for return values from scalar functions (because the functions are often data source–specific), applications should use the CONVERT scalar function whenever possible to force data type conversion. The following two examples illustrate the use of the CONVERT function. These examples assume the existence of a table called EMPLOYEES, with an EMPNO column of type SQL_SMALLINT and an EMPNAME column of type SQL_CHAR. If an application specifies the following SQL statement:

 SELECT EMPNO FROM EMPLOYEES WHERE {fn CONVERT(EMPNO,CHAR)} LIKE '1%'

  • A driver for ORACLE translates the SQL statement to:

 SELECT EMPNO FROM EMPLOYEES WHERE to_char(EMPNO) LIKE '1%'

  • A driver for SQL Server translates the SQL statement to:

 SELECT EMPNO FROM EMPLOYEES WHERE convert(char,EMPNO) LIKE '1%'

If an application specifies the following SQL statement:

 SELECT {fn ABS(EMPNO)}, {fn CONVERT(EMPNAME,SMALLINT)} FROM EMPLOYEES WHERE EMPNO <> 0

A driver for ORACLE translates the SQL statement to:

 SELECT abs(EMPNO), to_number(EMPNAME) FROM EMPLOYEES WHERE EMPNO <> 0

A driver for SQL Server translates the SQL statement to:

 SELECT abs(EMPNO), convert(smallint, EMPNAME) FROM EMPLOYEES WHERE EMPNO <> 0
What do you think about this topic? Send feedback!


RETURNING unified support

RETURNING unified support
Preprocessing Command Text Send Feedback

FireDAC supports the Firebird, Oracle and PostgreSQL RETURNING phrase.

Group

Preprocessing Command Text

Links
Preprocessing Command Text
Description

FireDAC offers {INTO} escape sequence to simplify and unify RETURNING handling for Firebird, Oracle and PostgreSQL:

ADQuery1.SQL.Text := 'insert into MyTab (f2, f3) values (:f2, :f3) returning f1 {into :f1}';
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.Params[1].AsInteger := 100;
ADQuery1.ExecSQL;
ADQuery1.Params[2].Value; // Value of a first parameter, listed in INTO

The parameters inside of {INTO} will be defined as ptInputOutput. FireDAC will use RETURNING {INTO} as part of the INSERT/UPDATE SQL commands, automatically generated to post updates to a database.

Note, FireDAC cannot support the Firebird INTO phrase directly, because it is supported only by PSQL, but not by DSQL, which is used by FireDAC. But you can use {INTO} escape clause. Other option with Firebird is to use Open method instead of ExecSQL:

ADQuery1.SQL.Text := 'insert into MyTab (f2, f3) values (:f2, :f3) returning f1';
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.Params[1].AsInteger := 100;
ADQuery1.Open;
ADQuery1.Fields[0].Value; // Value of a first field, listed in RETURNING
What do you think about this topic? Send feedback!


Executing Command

Executing Command
Working with Commands See Also Send Feedback

FireDAC offers TADQuery, TADCommand components and some TADConnection methods to execute SQL commands. The SQL commands are the main way to talk to SQL database.

Group

Working with Commands

Links
Working with Commands, See Also
Description
Using TADConnection

TADConnection offers ExecSQL methods. These are simple to use overloaded methods useful when:

  • no result sets are returned;
  • a SQL command will be executed only once, so does not need to be stored in prepared state;
  • no need for advanced parameters setup;
  • no need for design-time SQL command setup.

For example to execute few DDL commands:

ADConnection1.ExecSQL('drop table testtab');
ADConnection1.ExecSQL('create table testtab (id integer, name varchar(10))');
ADConnection1.ExecSQL('insert into testtab values (1, ''FireDAC'')');

To execute a parameterized query use the other overloaded method:

ADConnection1.ExecSQL('insert into testtab values (:id, :name)', [1, 'FireDAC']);

Also, TADConnection offers ExecSQLScalar methods different from ExecSQL methods, that they are returning a single result set value:

sName := ADConnection1.ExecSQLScalar('select name from testtab where id = :id', [1]);

Using TADQuery

In general, the TADQuery may be setup at design-time and / or at run-time.

Setting query at design time

To setup it at design-time, drop TADQuery on a form. TADQuery.Connection will be automatically set to point to a TADConnection on this form, if any. Then double click on TADQuery to invoke the FireDAC Query Editor:

There you can specify SQL text, optionally specify parameter and macro values and set options. Press "Query Builder" button to invoke the graphical SQL query builder tool. Note, to enable syntax highlighting check QU4 at GUI Questions.

Press "Execute" button to execute the query. If a command returns a result set, then it will be output on "RecordSet" pane and the result set structure on the "Structure" pane. If DBMS returns any messages or warnings for a command, they will be put to "Messages" pane. The "Next RecordSet" button allows to walk through all result sets returned by command.

When you are testing DML commands, like a UPDATE / INSERT / DELETE, consider to mark "Auto Rollback" check box to automatically rollback actions performed by a command.

Press OK to store changes in the TADQuery.

Using parameters

The parameterized query usage is one of the best practices at SQL database application development. Main benefits are:

  • you may compose single SQL command and use it few times with different parameter values. DBMS will build command execution plan only once. That reduces the DBMS engine load.
  • when you will execute the command next time, only parameter values will be transferred to the DBMS engine. That reduces network load.
  • you will not care about correct SQL constant formats, for example - how to properly write a date constant in Microsoft Access SQL.

To put a parameter marker into the SQL text use :<name> syntax. Then assign corresponding values using Params collection. For example:

ADQuery1.SQL.Text := 'select * from tab where code = :Code';
ADQuery1.ParamByName('code').AsString := '123';
ADQuery1.Open;

Before query will be executed each parameter Name, DataType and ParamType must be filled. Also Position may be need to set.

When you assign SQL property and ResourceOptions.ParamCreate is True, the Params collection will be automatically filled in. Note, that TADParam.Name and TADParam.Position only will be set. The DataType, ParamType and other properties must be set by application. The parameters in Params collection appears in the same order as in the SQL command.

Also you can fill the Params by code. For that you have to turn off automatic parameters creation by setting ResourceOptions.ParamCreate to False. For example:

ADQuery1.ResourceOptions.ParamCreate := False;
ADQuery1.SQL.Text := 'select * from tab where code = :Code';
with ADQuery1.Params do begin
  Clear;
  with Add do begin
    Name := 'CODE';
    DataType := ftString;
    Size := 10;
    ParamType := ptInput;
  end;
end;

The parameters may be bind to the SQL command either by name, either by position. Use the Params.BindMode property to control that:

  • pbByName - the parameters in Params collection will be bind by the Name property to the corresponding parameter markers. If SQL command has few the same named parameter markers, then only single instance will appear in Params.
  • pbByNumber - the parameters in Params collection will be bind by the Position property to the markers in SQL command text. If SQL command has few the same named parameter markers, then every one occurrence will appear in Params. When Position is not set for parameters, it will be assigned automatically at command preparation using parameter indexes. The Position starts from 1.

The DataType may be specified either explicitly, either implicitly by assigning a parameter value to the Value or AsXxxx properties. Otherwise, the FormatOptions.DefaultParamDataType will be used.

When ParamType is not specified, the ResourceOptions.DefaultParamType will be used. By default all parameters are input only. If some of the parameters are output, then this must be specified explicitly.

The input parameter values must be set before query execution. That may be done using one of the ways:

  • by explicitly assigning parameter values:

ADQuery1.ParamByName('code').AsString := 'DA1001';
ADQuery1.Open;

  • by using one of the overloaded ExecSQL or Open methods:

ADQuery1.Open('', ['DA1001']);

To set parameter value to Null, specify parameter data type, then call Clear method:

with ADQuery1.ParamByName('name') do begin
  DataType := ftString;
  Clear;
end;
ADQuery1.ExecSQL;

The output parameter values are accessible after query is executed. Some SQL commands and DBMS may require first to process all command result sets, then output parameter values will be received. To force the output parameter values delivery use the TADAdaptedDataSet.GetResults method. Also, read "RETURNING unified support" article about output parameters in Firebird and Oracle RETURNING phrase.

Preparing the query

Before a query will be executed it must be prepared. For that FireDAC automatically performs the following actions:

  • brings the connection to active or online mode;
  • checks that all parameters are set correctly;
  • preprocesses command text;
  • optionally applies RecsSkip and RecsMax to the command text;
  • optionally starts a transaction for Firebird / Interbase DBMS, if there is no one active;
  • transfers the final command text to the DBMS API. The final text may be get using TADQuery.Text property.

While the command is prepared the connection must be active and the query will keep server resources. To unprepare query and release all resources use Unprepare or Disconnect methods.

When you need to execute a command only once, you may set ResourceOptions.DirectExecute to True. For some DBMS (SQL Server, SQL Anywhere) that will speed up execution, because will avoid the costly operation of SQL command preparation.

Executing the query

To execute a query, which does not return a result set, use the ExecSQL methods. If a query returns a result set, then exception "[FireDAC][Phys][MSAcc]-310. Cannot execute command returning result sets" will be raised.

To execute a query, returning a result set and open this result set, use the Open methods. If a query returns no result sets, then exception "[FireDAC][Phys][MSAcc]-308. Cannot open / define command, which does not return result sets" will be raised.

To execute an add-hock query, use ExecuteOrOpen method. Note, that query may be executed asynchronously. If the query is a command batch, then check "Command Batches" for details.

"Parameter data type is changed" Exception

When the parameter type was changed after the first query Prepare / ExecSQL / Open call, then FireDAC will raise an exception on a subsequent call:

[FireDAC][Phys][IB]-338. Parameter [Xxxx] data type is changed.
Query must be reprepared.

FireDAC at first Prepare / ExecSQL / Open call remembers the parameter data type. The data type may be specified either explicitly by setting TADParam.DataType property, either implicitly by assigning value using TADParam.AsXxxx or TADParam.Value properties. When before next ExecSQL / Open call an application changes parameter data type, then on the next ExecSQL / Open call "Parameter [xxxxx] data type is changed" will be raised.

The TADParam.Value property does not change parameter data type on the consequent calls. It casts the assigning value to the current data type. So, to avoid the above exception use:

  • TADParam.Value property value;
  • TADParam.AsXxxx property, as Xxxx was used for first time.

Getting DBMS feedback

Use the TADQuery.RowsAffected property to get the number of rows processed by the command. For example, the number of deleted rows by the DELETE command. Note, at MS SQL Server RowsAffected may be unexpectedly equal to -1 when a stored procedure or a table trigger omits [image] SET NOCOUNT ON. And use the TADQuery.RecordCount property to get the number of fetched rows. Note, FireDAC does not provide "N rows processed" messages, if needed the application has to build it.

If the command will return an error, an exception will be raised. See the "Handling Errors" topic for more details. The exception may be processed using one of 3 ways:

  • using try / except / end construction. For example:

try
  ADQuery1.ExecSQL;
except
  on E: EADDBEngineException do
    ; // do something here
end;

  • setting TADQuery.OnError event handler;
  • setting TADConnection.OnError event handler. For example:

procedure TForm1.ADConnection1Error(ASender: TObject; const AInitiator: IADStanObject;
  var AException: Exception);
begin
  if (AException is EADDBEngineException) and (EADDBEngineException(AException).Kind = ekRecordLocked) then
    AException.Message := 'Please, try the operation later. At moment, the record is busy';
end;

ADConnection1.OnError := ADConnection1Error;

Note, in case of the Array DML, the error handling may be more complex.

Also the command may return warnings, hints and messages, depending on a DBMS. To enable messages processing set ServerOutput to True. To process them use the TADConnection.Messages property. For example:

var
  i: Integer;
begin
  ADConnection1.ResourceOptions.ServerOutput := True;
  ADQuery1.ExecSQL;
  if ADConnection1.Messages <> nil then
    for i := 0 to ADConnection1.Messages.ErrorCount - 1 do
      Memo1.Lines.Add(ADConnection1.Messages[i].Message);
end;

Some DBMS, like SQL Server, returns messages as an additional result set. So, to process messages the application will need to process multiple result sets. And more complex example, providing status and messages for SQL Server. As you see, we are using TADMemTable to store result set with rows.

var
  i: Integer;
begin
  ADConnection1.ResourceOptions.ServerOutput := True;
  ADQuery1.FetchOptions.AutoClose := False;
  ADQuery1.Open('select * from Region; print ''Hello''');
  ADMemTable1.Data := ADQuery1.Data;
  Memo1.Lines.Add(Format('%d rows processed', [ADMemTable1.RecordCount]));
  ADQuery1.NextRecordSet;
  if ADConnection1.Messages <> nil then
    for i := 0 to ADConnection1.Messages.ErrorCount - 1 do
      Memo1.Lines.Add(ADConnection1.Messages[i].Message);
end;

Query execution and transactions

By default all SQL command executions are performed in auto-commit mode. That means, when right before command execution there was no active transaction, then it will be started. And right after command execution this implicit transaction will be finished:

  • by Commit for successful execution;
  • by Rollback for failure.

In case of Firebird and Interbase an implicit transaction will be started right before query preparation. Note, that there is no need to surround a single command execution into explicit transaction, just use the auto-commit mode.

Advanced

Most database applications have backend administration utilities, which must execute SQL script. These scripts are written using lines appropriate to the DBMS SQL script syntax. To execute SQL scripts use TADScript component.

Sometimes a database application may need to execute heterogeneous queries using tables from different databases or to execute SQL commands on TDataSet descendants instead of the database tables. To execute such queries use Local SQL engine and TADLocalSQL component.

See Also

Executing Stored Procedure, Browsing Table, Command Batches, Asynchronous Execution, Local SQL, TADQuery Class

What do you think about this topic? Send feedback!


Executing Stored Procedure

Executing Stored Procedure
Working with Commands See Also Send Feedback

FireDAC offers TADStoredProc component to execute database stored procedures, as a stored procedure may be executed directly.

Group

Working with Commands

Links
Working with Commands, See Also
Description
Using TADStoredProc

In general, the TADStoredProc may be setup at design-time and / or at run-time. The TADStoredProc transparently generates a SQL command to call a stored procedure basing on the TADStoredProc property values. Before executing FireDAC sends the parameter values to a DBMS, then executes a stored procedure and receives the output parameter values.

Note, FireDAC does not support parameters with the default values.

Setting stored proc at design time

To execute a stored procedure drop a TADStoredProc component on a form. TADStoredProc.Connection will be automatically set to point to a TADConnection on this form, if any.

Then optionally set CatalogName, SchemaName, PackageName properties or choose their values from a drop down list. After setting StoredProcName and when fiMeta is included into FetchOptions.Items, the Params collection will be filled in automatically.

To unify parameter names, set ResourceOptions.UnifyParams to True. For example, this will exclude '@' prefix from the SQL Server stored procedure parameter names.

Setting stored proc at run time

That is similar to design time, just must be done using code:

ADStoredProc1.StoredProcName := 'my_proc';
ADStoredProc1.Prepare;
// now the Params collection is filled in

The Prepare call fills the Params collection using the mkProcArgs meta data, when fiMeta is included into FetchOptions.Items. Note:

  • mkProcArgs querying may be time consuming;
  • application cannot change parameter definitions after the Params is filled. For example, assignment to TADParam.AsXxxx properties implicitly sets the parameter data type.

To avoid above issues, exclude fiMeta from FetchOptions.Items, to avoid automatic rebuilding of Params collection at Prepare call. And semi-automatically fill the Params collection before the Prepare or ExecProc calls using the code:

ADStoredProc1.StoredProcName := 'my_proc';
ADStoredProc1.FetchOptions.Items := ADStoredProc1.FetchOptions.Items - [fiMeta];
ADStoredProc1.Command.FillParams(ADStoredProc1.Params);

Or manually:

ADStoredProc1.StoredProcName := 'my_proc';
ADStoredProc1.FetchOptions.Items := ADStoredProc1.FetchOptions.Items - [fiMeta];
with ADStorecProc1.Params do begin
  Clear;
  with Add do begin
    Name := 'Par1';
    ParamType := ptInput;
    DataType := ftString;
    Size := 50;
  end;
  with Add do begin
    Name := 'Par2';
    ParamType := ptOutput;
    DataType := ftInteger;
  end;
end;

Using packaged procedures

To use a packaged procedure, application must specify the package name. That must be done by either of ways:

  • set PackageName. The package name may be specified in [<catalog name>.][<schema name>.]<package name> format.
  • set StoredProcName. The stored procedure name may be specified in [<catalog name>.][<schema name>.]<package name>.<stored proc name> format.

To choose the overloaded procedure, application must specify the Overload property. For example:

ADStoredProc1.PackageName := 'SYS.DBMS_SQL';
ADStoredProc1.Overload := 1;
ADStoredProc1.StoredProcName := 'BIND_VARIABLE';

Executing the stored procedure

To execute a stored procedure, which does not return a result set, use the ExecProc methods. To execute a stored function, use the ExecProc or ExecFunc methods, where ExecFunc returns the function value. If a stored procedure returns a result set, then exception "[FireDAC][Phys][Oracl]-310. Cannot execute command returning result sets" will be raised.

Note, there are few overloaded ExecProc and ExecFunc methods, allowing to avoid TADStoredProc property usage and specify all required information as method arguments. For example:

ADStoredProc1.StoredProcName := 'MY_PROC';
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].Value := 100;
ADStoredProc1.Params[1].Value := 'audi';
ADStoredProc1.ExecProc;

Or more compact:

ADStoredProc1.ExecProc('MY_PROC', [100, 'audi']);

To execute a stored procedure, returning a result set and open this result set, use the Open methods. If a stored procedure returns no result sets, then exception "[FireDAC][Phys][Oracl]-308. Cannot open / define command, which does not return result sets" will be raised. If the stored procedure returns multiple result sets, then check "Command Batches" for details.

Note, that stored procedure may be executed asynchronously.

Using TADQuery

The main difference of TADStoredProc from a TADQuery, is that TADStoredProc automatically generates a stored procedure call using the parameters information. The SQL code calling a stored procedure may be executed directly using any FireDAC method of the SQL command execution. For example, call an Oracle packaged proc using TADQuery:

with ADQuery1.SQL do begin
  Clear;
  Add('begin');
  Add('  sys.dbms_sql.bind_variable(:c, :name, :value');
  Add('end;');
end;
ADQuery1.Params[0].AsInteger := 1;
ADQuery1.Params[1].AsString := 'p1';
ADQuery1.Params[2].AsInteger := 100;
ADQuery1.ExecSQL;

Using TADCommand

Finally, you can use TADCommand to execute a stored procedure. Most of the above discussions may be applied to the TADCommand too.

See Also

Executing Command, Command Batches, Asynchronous Execution, TADStoredProc Class

What do you think about this topic? Send feedback!


Browsing Table

Browsing Table
Working with Commands See Also Send Feedback

FireDAC offers TADTable component to browse database table data, filter and sort records, and edit the table data.

Group

Working with Commands

Links
Working with Commands, See Also
Description
Using TADTable

To browse a single database table, sort and filter records, and edit the data the FireDAC offers TADTable component. The TADTable transparently generates a SELECT statement basing on the TADTable property values and called methods and send it to a DBMS.

The TADTable has two main operation modes:

  • Live Data Window mode. Allows bi-directional navigation through large data volumes with a minimal memory usage.
  • Standard mode. This mode is similar to TADQuery. TADTable generates a single SELECT command and uses the result set to walk through table records.

To open a table, the TableName property must be specified. Additionally may be set IndexFieldNames or IndexName properties. Note, to use IndexName property, the fiMeta must be included into FetchOptions.Items. For example:

ADTable1.TableName := 'CUSTOMERS';
ADTable1.IndexFieldNames := 'CustNo';
ADTable1.Open;

To force TADTable to quote field names set FormatOptions.QuoteIdentifiers to True.

Live Data Window mode

In Live Data Window (LDV) mode FireDAC queries and keeps in memory only 2 * FetchOptions.RowsetSize of records - a window into the table data. When application navigates through the table data, FireDAC automatically scrolls or positions the LDW to the required position. That gives benefits:

  • minimizes memory usage and allows to work with large data volumes, similar to an unidirectional dataset;
  • enables bi-directional navigation, in contrast to an unidirectional dataset;
  • gives always fresh data, reducing the need to refresh dataset;
  • does not give a delay to fetch all result set data, required to perform sorting, record location, jumping to last record, etc.

The Filter property, range filtering, IndexFieldNames and IndexName properties, Locate and Lookup methods, key locating, setting RecNo, setting a bookmark, etc are performed by additional SELECT commands or by setting additional phrases for the main SELECT command. After changing of Filter, IndexFieldNames or IndexName the current position in dataset may change. To preserve it save a bookmark before changing and restore it after changing.

In LDV mode the Filter property value is substituted as is into WHERE phrase. To make expression compatible with the DBMS and the local expression engine, application may use FireDAC escape sequences. For example:

ADTable1.Filter := 'DateField = {d ' + FormatDateTime('yyy-mm-dd', Trunc(MonthCalendar1.Date)) + '}';
ADTable1.Filtered := True;

LDV by design always applies ORDER BY phrase to the SELECT commands. The key requirement for correct LDV work are:

  • a table must have unique or primary key. See Unique Identifying Fields for more details.
  • the server side sort collation and client side sort collation must be the same. Otherwise TADTable may produce duplicated rows and raise "unique key violation" error.

Although FireDAC minimizes the number of generated and executed SQL commands in LDV mode, still it produces more heavy DB load than TADQuery. So, application developers should carefully choose when to use TADTable and LDV.

Setting LDV

The LDV is used when all the following conditions are met, otherwise the standard mode is used:

  • CachedUpdates = False (default value);
  • FetchOptions.Unidirectional = False (default value);
  • FetchOptions.CursorKind in [ckAutomatic, ckDynamic] (ckAutomatic is default value);
  • table has primary or unique key.

The mode may be changed only when TADTable is inactive. Consequently, for example, the CachedUpdates may be changed only when table is inactive. Additionally, the performance may be improved by changing FetchOptions.LiveWindowParanoic (False is default value) and LiveWindowFastFirst (False is default value).

Avoiding "unique key violation" error in LDV

To make the database sort order the same as the client side sort order, the FormatOptions.SortLocale and SortOptions may be used to adjust the client side sort order. For example, German speaking developers may setup TADTable to query the Firebird database with ISO8859_1 character set containing German language string data:

uses
  Windows;
...
// Set locale ID to German phone book collation
ADTable1.FormatOptions.SortLocale := MAKELCID(MAKELANGID (LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
// Use the the punctuation and other symbols insensitive sorting
ADTable1.FormatOptions.SortOptions := [soNoSymbols];
ADTable1.IndexFieldNames := 'NAME';
ADTable1.TableName := 'CUSTOMERS';
ADTable1.Open;

Depending on a DBMS the following additional settings may be made:

DBMS | Settings
MySQL | May be required to include soNoSymbols into SortOptions.
Oracle | May be required to execute ALTER SESSION SET NLS_COMP=ANSI.
SQLite | Set SortLocale to 0.

For example, Oracle developers may execute the command:

ADConnection1.Connected := True;
ADConnection1.ExecSQL('ALTER SESSION SET NLS_COMP=ANSI');

Also FormatOptions.StrsEmpty2Null and StrsTrim we recommend to set to False.

Note, when a developer fails to adjust the client side sort collation, then the LDV may be turned off by setting FetchOptions.CursorKind to ckDefault, ckStatic or ckForwardOnly.

See Also

Object Names, Executing Command, TADTable, TADFetchOptions

What do you think about this topic? Send feedback!


Database Alerts

Database Alerts
Example Working with Commands See Also Send Feedback

FireDAC offers the TADEventAlerter component to listen for database alerts, send the alerts and manage them.

Group

Working with Commands

Links
Example, Working with Commands, See Also
Description
General

The DBMS alert refers to a database notification or alert sent by a database trigger or stored procedure with intent to notify a database client about some events at database side.

An alert is identified by the name and may include additional arguments. The clients are registering with the alerts. Multiple clients may register with a single alert, and single client may register with the multiple alerts. When an alert is signaled in a database, then all registered clients will be notified about that. When application is not more interested in an alert, it unregisters with the alert.

The classic examples of the alerts are:

  • a table data change. In this case an application may refresh a dataset returning this table data.
  • a notification that some condition in data is met.
  • a notification to other application that one application will perform some special task, like data archiving or backup.

Each DBMS implements DBMS alerts on their own. There is no standard for alerts mechanisms.

Using TADEventAlerter

FireDAC offers unified alerts API as the TADEventAlerter component. Some DBMS may implement few DBMS alert mechanisms. Each TADEventAlerter object may listen for few alerts by specifying their names in TADEventAlerter.Names property, and using single mechanism specified by TADEventAlerterOptions.Kind property.

FireDAC listens for alerts in a background thread using an additional private connection to the database. The additional connection is created automatically by FireDAC for each TADEventAlerter component. When the application creates multiple TADEventAlerter objects, consider to use pooled connections to improve performance.

To start receive the event alerts, fill in TADEventAlerter.Names property with required event names. Set Options.Kind to the event alerter kind or leave it empty to use the default alerter. Specify OnAlert event handler, which will be fired when an event is occurred. And set Active to True or call Register method. To stop receive the event alerts, set Active to False or call Unregister.

The OnAlert event handler may be called in the main or background thread contexts. Use Options.Synchronize property to control that. Note, application should minimize the run time of the background thread handler.

Application may set timeout for alerts by specifying Options.Timeout property. When there are no alerts for specified time, then the OnTimeout event handler will be called.

For example, to register for "Customers" alert using "DBMS_ALERT" mechanism on Oracle database and standard Firebird mechanism, use the code:

ADEventAlerter1.Names.Clear;
ADEventAlerter1.Names.Add('Customers');
case ADConnection1.RDBMSKind of
  mkOracle:    ADEventAlerter1.Options.Kind := 'DBMS_ALERT';
  mkInterbase: ADEventAlerter1.Options.Kind := 'Events';
end;
ADEventAlerter1.Options.Synchronize := True;
ADEventAlerter1.Options.Timeout := 10000;
ADEventAlerter1.OnAlter := DoAlert;
ADEventAlerter1.OnTimeout := DoTimeout;
ADEventAlerter1.Active := True;
........

procedure TForm1.DoAlert(ASender: TADCustomEventAlerter;
  const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh;
end;

procedure TForm1.DoTimeout(ASender: TObject);
begin
  // do something
end;

And the server side code for Oracle:

CREATE OR REPLACE TRIGGER TR_CUSTOMERS
AFTER INSERT OR UPDATE OR DELETE ON CUSTOMERS
BEGIN
  SYS.DBMS_ALERT.SIGNAL('Customers', '123');
END;

And for Firebird:

CREATE TRIGGER TR_CUSTOMERS FOR CUSTOMERS
ACTIVE AFTER INSERT OR UPDATE OR DELETE
BEGIN
  POST_EVENT 'Customers';
END;

DBMS alert mechanisms

As noted, every DBMS implements database alerts on her own. The alter mechanism kind is identified by TADEventAlerterOptions.Kind property value. If it is empty, then default mechanism will be used. For most mechanisms the client side functionality will be the same. The database side will differ.

The following table lists the DBMS and their alter mechanisms, supported by FireDAC drivers:

DBMS
Event alerter kind
Description
Advantage Database
Events (*)
Is used the standard Events (Notifications) functionality. To initiate an event, use sp_SignalEvent stored procedure. For example:
sp_SignalEvent('Customers', true, 0, '123');
Note, that sp_SignalEvent may be called only from a stored procedure or a trigger. It cannot be called directly from the SQL command.
Sybase SQL Anywhere
Message (*)
Is used the MESSAGE statement functionality. To initiate an event, the specially formatted message must be sent: _AD_$$<event name>[$$<argument>]. For example:
MESSAGE '_AD_$$Customers$$123'
DataSnap server
Callbacks (*)
Is used DataSnap “heavyweight” callbacks ( [image] more). The TADEventAlerter.Names content should have one of the following formats:
  • <channel name>. FireDAC will register a callback for the specified channel. Use TDSAdminClient.BroadcastToChannel to broadcast an event to all TADEventAlerter registered for the specified channel.
  • <channel name>=<callback name>. FireDAC will register a callback with the specified name for the specified channel. See above to initiate an event.
Firebird / Interbase
Events (*)
Is used the standard FB/IB mechanism for event notifications. To initiate an event, use POST_EVENT <name> statement. For example:
EXECUTE BLOCK AS
BEGIN
POST_EVENT 'Customers';
END;
Microsoft SQL Server
Query Notification (*)
Is used the Query Update Notification service. The TADEventAlerter.Names content should have one of the following formats:
  • CHANGE<index>=<message>;<SELECT query>. The event will be fired when the data returned by the SELECT query will be updated and the <message> will be returned as the event name. To fire an event an UPDATE statement against the selected data must be executed.
  • <message>. FireDAC will create _AD_EVENTS table. The event will be fired when VALUE of the NAME=<message> row will be updated. To fire an event an UPDATE statement must be performed.
Additionally parameters may be specified in the Names:
  • SERVICE=<name>. The name of the service to use. '?' - means to create an uniquely named service and drop it after usage.
  • QUEUE=<name>. The name of the message queue to use. '?' - means to create an uniquely named queue and drop it after usage.
Note, to enable query notification execute the command:
ALTER DATABASE <your db name> SET ENABLE_BROKER
Oracle
DBMS_ALERT (*)
Is used the DBMS_ALERT package. Before the usage a DBA must execute GRANT EXECUTE ON DBMS_ALERT TO <user or group>. To initiate an event, use DBMS_ALERT.SIGNAL call. For example:
BEGIN
SYS.DBMS_ALERT.SIGNAL('Customers', '123');
END;
DBMS_PIPE
Is used the DBMS_PIPE package. Before the usage a DBA must execute GRANT EXECUTE ON DBMS_PIPE TO <user or group>. To initiate an event, use DBMS_PIPE.SEND_MESSAGE call. For example:
BEGIN
SYS.DBMS_PIPE.PACK_MESSAGE(123);
SYS.DBMS_PIPE.SEND_MESSAGE('Customers');
END;
PostgreSQL
Notifies (*)
Is used the standard event notification mechanism. To initiate an event, use NOTIFY <name> statement. PostgreSQL 9.0 supports payload argument, use NOTIFY <name> [, <paylod>]. For example:
NOTIFY Customers
SQLite
Events (*)
Is used the custom function POST_EVENT. To initiate an event, use POST_EVENT(<name>, [arg1 [,arg2 [,arg3 [,arg4]]]]). For example:
SELECT POST_EVENT('Customers', 123)

Note, the asterisk marks the default event alerter kind.

See Also

TADEventAlerter, TADEventAlerterOptions, Multi Threading

Example

See FireDAC demo FireDAC\Samples\Comp Layer\TADEventAlerter\Main.

What do you think about this topic? Send feedback!


Fetching Rows

Fetching Rows
Working with Commands See Also Send Feedback

When a SQL command is executed it may create a cursor returning the result set. FireDAC offers wide range of features to effectively process the cursor and fetch rows into the client records cache.

Group

Working with Commands

Links
Working with Commands, See Also
Description
Handling cursors

When a SQL command is executed and it has to return rows, the DBMS creates a cursor on the DBMS server. An application uses the cursor to retrieve rows from a database. Depending on the DBMS there may be few cursor kinds. To choose the cursor kind use the FetchOptions.CursorKind property. By default FireDAC will choose most fast cursor kind (ckAutomatic). At first this property is meaningful for the Microsoft SQL Server.

The DBMS cursors are sensitive to the transaction context, where they were opened. For more details read the "Managing Transactions" chapter.

Rowset fetching

Rowset Fetching allows you to specify the number of records that will be fetched from the server in one network round trip. You can optimize this separately for each SELECT statement that you execute, thereby minimizing the number of network round trips by specifying the RowsetSize option. For example, Zeos DBO does not support Rowset Fetching, so FireDAC is a few times faster than Zeos DBO at fetching.

The row set size is controlled by the FetchOptions.RowsetSize property. Than higher is the number, then faster FireDAC will fetch the full result set, but the delay to fetch next row set will be higher too. Also, starting from some "high" value the performance stops to grow and even may start to degrade. The practically "high" value is 2000-3000.

Not all DBMS are supporting row set fetching. If so, FireDAC will emulate it. Even emulation speedups fetching for <= 50%.

FireDAC is fetching row sets according to the FetchOptions.Mode property:

  • fmOnDemand - row sets will be fetched automatically, when dataset is trying to move the current position beyond the last fetched record.
  • fmAll - all row sets will be fetched automatically right after executing the SQL command. This is similar to call the FetchAll method.
  • fmManual - programmer will manually fetch row sets using the FetchNext or FetchAll methods.
  • fmExactRecsMax - all rows sets will be fetched automatically right after executing the SQL command. If the number of rows will be different from FetchOptions.RecsMax, then an exception will be raised.

When the FetchOptions.Unidirectional is True, then before fetching the next row set, the previous one will be discarded from memory. That allows to preserve the PC memory when fetching large result sets.

When all records are fetched, then TADDataSet.SourceEOF will be True, and depending on the FetchOptions.AutoClose the underlying command will be closed. This will not close the dataset itself. Also, read "Command Batches" for more details.

Application may get access to each fetched record using TADDataSet.AfterGetRecord event handler.

Rows paging

The FetchOptions.RecsSkip and RecsMax allows to page through the result set. After the cursor will be opened, the first RecsSkip records will be skipped, then the next up to RecxMax records will be fetched. Changing RecsSkip and RecsMax property values has no effect, when a statement is prepared. So, before to fetch the next rows page, the command must be unprepared, then executed again. For example:

ADQuery1.FetchOptions.RecsSkip := 0;
ADQuery1.FetchOptions.RecsMax := 100;
ADQuery1.Open;
// process rows

ADQuery1.Disconnect;
ADQuery1.FetchOptions.RecsSkip := 100;
ADQuery1.Open;
// process rows

ADQuery1.Disconnect;
ADQuery1.FetchOptions.RecsSkip := 200;
ADQuery1.Open;
// process rows

When RecsSkip and / or RecsMax properties are specified, FireDAC if possible will modify the original SELECT command, to apply TOP / ROWS and similar phrases.

Delayed fetching

The result set may include BLOB or / and nested datasets columns. In general, such columns slowdowns result set fetching. FireDAC allows to postpone such columns fetching until they values will be really needed. The FetchOptions.Items property controls that:

  • when fiBlobs is excluded, then FireDAC will delay BLOB values fetching. The FetchBlobs method performs BLOB values fetching for the current dataset record. Alternatively, the first reading of a BLOB value will automatically call FetchBlobs, when Mode <> fmManual.
  • when fiDetails is excluded, then FireDAC will delay nested dataset fetching. The FetchDetails method performs nested dataset fetching for the current record. Also, fiDetails controls the master-details handling.

For the delayed fetching SQL command generation, read the "Update Command Generation" chapter.

Note, that excluding fiBlobs or fiDetails from FetchOptions.Items do not modify the SELECT list of a SQL command. If a DBMS transfers BLOB values by-value (eg, Oracle LONG, MySQL, SQL Server, SQLite), then in any case the BLOB values will be delivered to the client other the network. But they will be not stored in the client records cache. But if a DBMS transfers BLOB values by-reference (eg, Oracle CLOB / BLOB, Interbase, Firebird), then the BLOB values will be not delivered and not stored.

Refetching rows

Sometimes an application may need to append new result set to the existing one or to refetch rows or etc. For that the FetchAgain method may be used. Note, use the Refresh method for dataset refreshing.

General usage cases

The following table provides the common usage case and corresponding FetchOptions setup:

Case | Description
Minimal fetching time of large volume of records with limited memory usage. | CursorKind = ckDefault or ckForwardOnly Mode = fmOnDemand RowsetSize = 1000 Unidirectional = True
Minimal fetching time with delay at query opening. | CursorKind = ckDefault Mode = fmAll RowsetSize = 1000
Minimal delay at query opening. | CursorKind = ckDynamic Mode = fmOnDemand RowsetSize = 50 Exclude fiMeta from Items.
Read-only dataset. | Exclude fiMeta from Items. Or set UpdateOptions.RequestLive to False.
Batch command with multiple result sets. | AutoClose = False
Minimal fetching time of large volume of records with multiple large BLOB values with limited memory usage. | Exclude fiBlobs from Items. Combine with above.
See Also

Executing Command, Executing Stored Procedure, Command Batches, Update Command Generation

What do you think about this topic? Send feedback!


Command Batches

Command Batches
Working with Commands See Also Send Feedback

FireDAC supports SQL command batches. Command batches allowing to execute multiple SQL commands in a single step and to process multiple result sets in a sequence.

Group

Working with Commands

Links
Working with Commands, See Also
Description
General

A Command Batch is a group of SQL statements sent at one time from an application to a DBMS for execution. DBMS compiles the statements of a batch into a single execution plan. The statements in the execution plan are then executed one at a time. This minimizes network traffic and server workload. After execution, the DBMS returns to the client result sets produced by the commands.

Processing result sets

FireDAC allows you to process all result sets one by one, using the NextRecordSet method. To enable processing of all result sets you should set FetchOptions.AutoClose to False before executing a command. Otherwise right after reaching EOF at first cursor, it will be closed and other cursors will be discarded.

For example with SQL Server:

ADQuery1.FetchOptions.AutoClose := False;
ADQuery1.SQL.Add('select * from [Orders]');
ADQuery1.SQL.Add('select * from [Order Details]');
ADQuery1.Open; // [Orders] table rows are accessable here
ADQuery1.NextRecordSet; // [Order Details] table rows available here

An application may store each result set into a separate dataset, using TADMemTable and Data property. For example:

ADQuery1.FetchOptions.AutoClose := False;
ADQuery1.SQL.Text := 'select * from orders; select * from customers';

ADQuery1.Open;
ADQuery1.FetchAll;
// assign orders records to ADMemTable1
ADMemTable1.Data := ADQuery1.Data;

ADQuery1.NextRecordSet;
ADQuery1.FetchAll;
// assign customers records to ADMemTable2
ADMemTable2.Data := ADQuery1.Data;

FireDAC automatically skips empty result sets that do not have columns and rows.

DMBS and batches

A DBMS must support command batches to execute them using FireDAC. If a DBMS does not support batches, then you can use SQL scripting. The DBMS supporting batches are:

DBMS | Notes
IBM DB2 | Commands must be separated by ';'.
Firebird | Use the EXECUTE BLOCK construction.
Microsoft SQL Server | Commands may be optionally separated by ';'.
MySQL | Commands must be separated by ';'.
Oracle | Use the BEGIN END anonymous block construction.
PostgreSQL | Commands must be separated by ';'. A batch without parameters may be executed with ResourceOptions.DirectExecute=True. With PostgreSQL v >= 9.0 use the DO BEGIN END anonymous block construction.
SQLite | Commands must be separated by ';'.
SQL Anywhere | Commands may be optionally separated by ';'.

Also, FireDAC fully supports commands returning multiple result sets. Some examples:

  • Oracle stored procedures with REF CURSOR's;
  • Oracle result sets with nested cursors;
  • PostgreSQL varieties of cursor returning statements.

Note, to execute multiple INSERT / UPDATE / DELETE commands, consider to use Array DML feature, which is far more effective for large batches.

See Also

Array DML

What do you think about this topic? Send feedback!


Array DML

Array DML
Example 1 Example 2 Working with Commands See Also Send Feedback

FireDAC offers high performance Array DML feature. It allows to move large volumes of data to a database using standard INSERT or UPDATE SQL commands.

Group

Working with Commands

Links
Example 1, Example 2, Working with Commands, See Also
Description
General

The Array DML execution technique submits a single DBMS command with an array of parameters. Each command parameter has array of values and all parameters have arrays of the same length. Then FireDAC requests the DBMS to execute a command once for each row in arrays. This technique reduces the amount of communication between DBMS and client, enables DBMS to stream command execution. That speeds up a execution in times.

Following picture shows that:

In FireDAC terms "batch command execution" and "Array DML execution" are used often as synonyms. Array DML may be used almost for all parameterized commands, including stored procedure calls. FireDAC implements Array DML using native DBMS API capabilities or emulates Array DML execution, if the DBMS API does not support it.

The following table lists DBMS and Array DML features:

DBMS
Array DML Implementation
Array DML Mode
Array DML Limit Symptoms
Advantage Database
Emulation
aeUpToFirstError
DataSnap server
Emulation
aeUpToFirstError
IBM DB2
Native
aeCollectAllErrors
Interbase
Native / Emulation
aeUpToFirstError
Firebird v < 2.1
Emulation
aeUpToFirstError
Firebird v >= 2.1
Native (EXECUTE BLOCK)
aeOnErrorUndoAll
"Too many contexts" error
Microsoft SQL Server
Native
aeCollectAllErrors
Possible "Access violation" error
Microsoft Access database
Emulation
aeUpToFirstError
MySQL Server
Native (INSERT with multiple VALUES)
aeOnErrorUndoAll
Oracle Server
Native (OCI Array DML)
aeUpToFirstError
Application hangs up.
Explicit limit - 65K of array items.
PostgreSQL v < 8.1
Emulation
aeUpToFirstError
PostgreSQL v >= 8.1
Native (INSERT /MERGE with multiple VALUES)
aeOnErrorUndoAll
SQLite database v < 3.7.11
Emulation
aeUpToFirstError
SQLite database v >= 3.7.11
  • Emulation, when Params.BindMode = pbByName
  • Native (INSERT with multiple VALUES), when Params.BindMode = pbByNumber
  • aeUpToFirstError
  • aeOnErrorUndoAll
Sybase SQL Anywhere
Native
aeUpToFirstError

Note:

  • "Array DML Mode" description see in "Error Handling" chapter.
  • "Array DML Limit Symptoms" description see in "Troubleshooting" chapter.

Command execution

Before Array DML execution, the application code must setup parameter value arrays. First, setup array length by assigning value to Params.ArraySize. Assigning this property value, implicitly assigns specified array length to all parameters ArraySize property. So, Params collection must be not empty before assigning to Params.ArraySize. Second, assigns values to parameter arrays. TADParam class has a set of AsXXXs[AIndex: Integer] properties, similar to AsXXX properties. And other properties and methods accepting as first parameter array index. For example:

ADQuery1.SQL.Text := 'insert into MyTab values (:p1, :p2, :p3)';
// here ADQuery1.Params collection is filled by 3 parameters
ADQuery1.Params.ArraySize := 100;
for i := 0 to 100-1 do begin
  ADQuery1.Params[0].AsIntegers[i] := i;
  ADQuery1.Params[1].AsStrings[i] := 'qwe';
  ADQuery1.Params[2].Clear(i);
end;

TADCustomCommand, TADQuery and TADStoredProc have the Execute(ATimes: Integer = 0; AOffset: Integer = 0) method. Here, ATimes defines the length of the array. AOffset is index of first item in the array. So, the command will be executed (ATimes - AOffset) times, starting from AOffset row. ATimes must be equal or less Params.ArraySize. For example:

ADQuery1.Execute(100, 0);

After Array DML execution, the property RowsAffected has the number of successful executions, not the total number of affected rows by all executions. For example:

ShowMessage(IntToStr(ADQuery1.RowsAffected));

Error handling

TADAdaptedDataSet, TADQuery and TADStoredProc have ability to trap errors using OnExecuteError event handlers. If the error handler is not assigned and an error happens, then Execute will raise an exception and RowsAffected will be updated.

If TADAdaptedDataSet.OnExecuteError event handler is assigned, it will get original exception object, current times and offset, and may return AAction value, talking what to do next. The AError.Errors[...] contains one or more errors. AError.Errors[i].RowIndex is a failed row index. Note, OnExecuteError will be not called for the syntax errors or when ATimes = 1.

For example:

procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AError: EADDBEngineException; var AAction: TADErrorAction);
begin
  if AError.Errors[0].Kind = ekUKViolated then
    AAction := eaSkip
  else
    AAction := eaFail;
end;

The exact behavior depends on a DBMS and its corresponding Array DML mode:

Array DML Mode | Description
aeOnErrorUndoAll | Execution stops on the first error. All successfully applied array items will be undone. Then FireDAC switches to one-by-one execute mode and re-executes the full array. This is similar to aeUpToFirstError. See aeUpToFirstError below.
aeUpToFirstError | Execution stops on the first error. All successfully applied array items will be saved. DBMS returns the index of the first failed array item. RowsAffected = number of successfully applied array items. Collection of errors in AError.Errors[...] contains one or more errors referring to a single failed row. AError.Errors[i].RowIndex is the failed row index.
aeCollectAllErrors | All array items are executed. All successfully applied array items will be saved. DBMS returns one-by-one the index of each failed array item. RowsAffected = number of successfully applied array items. Collection of errors in AError.Errors[...] contains one error for each failed row. AError.Errors[i].RowIndex is a failed row index.

Note, setting ResourceOptions.ArrayDMLSize to 1 implicitly sets array execution mode to aeUpToFirstError. To get currently connected DBMS Array DML mode use:

if ADConnection1.ConnectionMetaDataIntf.ArrayExecMode = aeOnErrorUndoAll then
  ....

Troubleshooting

It is important to properly setup parameters, including setting property Size for the string parameters. For example, FireDAC in case of Oracle will allocate 4000 bytes for each ftString / ftWideString parameter, when Size is not explicitly specified. So, for 10,000 of values will be allocated 40 Mb buffer. If there are many parameters, then application can eat all the system memory.

Most DBMS have implicit limit for the Array DML size. It depends on the DBMS client library buffer size or the maximum allowed network packet. When a limit is reached use ResourceOptions.ArrayDMLSize option to transparently split large Array DML into few lesser slices.

See Also

Command Batches

Example 1

Array DML with IADPhysCommand:

var
  oCmd: IADPhysCommand;
……
  with oCmd do begin
    CommandText := 'insert into Customers (ID, Name) values (:ID, :Name)';
    // Set up parameter types
    Params[0].DataType := ftInteger;
    Params[1].DataType := ftString;
    Params[1].Size := 40;
    // Set up parameters' array size
    Params.ArraySize := 10000;
    // Set parameter values
    for i := 0 to 10000 - 1 do begin
      Params[0].AsIntegers[i] := i;
      Params[1].AsStrings[i] := 'Somebody ' + IntToStr(i);
    end;
    // Execute batch
    Execute(10000, 0);
  end;
Example 2

Array DML with TADQuery and error handling:

procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AException: EADDBEngineException; var AAction: TADErrorAction);
begin
  case AException.Errors[0].Kind of
  ekPKViolated:
    begin
      // fix ID to be unique
      ADQuery.Params[0].AsIntegers[AException.Errors[0].RowIndex] := AException.Errors[0].RowIndex;
      AAction := eaRetry;
    end;
  ekFKViolated:
    // if Region with RegionID is not found, then just skip row
    AAction := eaSkip;
  else
    AAction := eaFail;
  end;
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  with ADQuery1 do begin
    SQL.Text := 'insert into Customers (ID, RegionID, Name, Note) values (:ID, :RegionID, :Name, :Note)';
    // Set up parameter types
    Params[0].DataType := ftInteger;
    Params[1].DataType := ftInteger;
    Params[2].DataType := ftString;
    Params[2].Size := 40;
    Params[3].DataSize := ftMemo;
    // Set up parameters' array size
    Params.ArraySize := 10000;
    // Set parameter values
    for i := 0 to 10000 - 1 do begin
      if i mod 100 = 0 then
        // force PK violation
        Params[0].AsIntegers[i] := i - 1
      else
        Params[0].AsIntegers[i] := i;
      Params[1].AsIntegers[i] := GetRegionIdForCustomer(i);
      Params[2].AsStrings[i] := 'Somebody ' + IntToStr(i);
      Params[3].Clear(i);
    end;
    // Execute batch
    Execute(10000, 0);
  end;
end;
What do you think about this topic? Send feedback!


Asynchronous Execution

Asynchronous Execution
Working with Commands Send Feedback

FireDAC offers multiple features for asynchronous operation execution. In addition to being ready for use in multi-threaded applications, FireDAC makes it easy for the developer to not have to worry about multi-threading in the first place by allowing you to control the timing aspects of the data access operation execution. This includes Execute, Open and Fetch operations.

Group

Working with Commands

Links
Working with Commands
Description
General

A programmer may choose between four operation modes using the ResourceOptions.CmdExecMode property:

Mode | Description
amBlocking | The calling thread and GUI are blocked until an action will be finished.
amNonBlocking | The calling thread is blocked until an action will be finished. The GUI is not blocked.
amCancelDialog | The calling thread and GUI are blocked until an action will be finished. FireDAC shows dialog, allowing to cancel an action.
amAsync | The calling thread and GUI are not blocked. The called method will return immediately.

An application may check TADCommand.State or TADAdaptedDataSet.Command.State for an operation status:

Status | Description
csInactive | A command is not prepared.
csPrepared | A command is prepared. A result set is not accessible.
csExecuting | A command execution is in progress.
csOpen | A command execution is finished. A result set is accessible and not yet fetched in full.
csFetching | A result set fetching is in progress.
csAborting | A command execution abortion is in progress.

For example:

ADQuery1.ResourceOptions.CmdExecMode := amAsync;
ADQuery1.Open;
while ADQuery1.Command.State = csExecuting do begin
  // do something while query is executing
end;

With help of TADGUIxAsyncExecuteDialog component, in the amCancelDialog mode a user may be notified about long running operations and have an ability to cancel operation:

To use the dialog component, drop it on a form. No additional setup is required. Read more about modes and operation notification events at ResourceOptions.CmdExecMode property description.

Asynchronous open and fetching

When an application needs to open a query pure asynchronously (amAsync) and the query is bind to the GUI using TDataSource, then before opening the query TDataSource must be disconnected from the query and after opening connected back. For example:

procedure TForm1.BeforeOpen(DataSet: TDataSet);
begin
  DataSource1.DataSet := nil;
end;

procedure TForm1.AfterOpen(DataSet: TDataSet);
begin
  DataSource1.DataSet := ADQuery1;
  ADQuery1.ResourceOptions.CmdExecMode := amBlocking;
end;

ADQuery1.BeforeOpen := ADQuery1BeforeOpen;
ADQuery1.AfterOpen := ADQuery1AfterOpen;
ADQuery1.ResourceOptions.CmdExecMode := amAsync;
ADQuery1.Open;

That is not required when amCancelDialog is used. Also fetching with GUI cannot be performed in amAsync mode. To perform opening a query and fetching large result set asynchronously set FetchOptions.Mode = fmAll. Then both operations will be performed as a single background task. Note, that it is only valid when you need a bi-directional dataset.

To asynchronously execute Firebird query use separated transaction for this query.

Canceling long running operations

A programmer can specify the timeout for the data access operation using the ResourceOptions.CmdExecTimeout property. When an operation execution requires more than the specified time, then the execution will be canceled and exception will be raised. To catch a command timeout use the code:

try
  // set timeout to 5 seconds
  ADQuery1.ResourceOptions.CmdExecTimeout := 5000;
  ADQuery1.ExecSQL;
except
  on E: EADDBEngineException do
    if E.Kind = ekCmdAborted then
      ; // command is aborted
end;

Alternatively application may cancel operation execution by calling dataset or command AbortJob method from other thread. Or call connection AbortJob method to cancel all operations on this connection.

Note, that not all FireDAC drivers and DBMS are supporting execution cancellation. Also the cancellation may be performed not immediately, when A DBMS is performing some critical operations. The following table lists supported combinations:

DBMS | Notes
Advantage |
Firebird | v 2.5 or higher
IBM DB2 |
Interbase | v 7.0 or higher
MySQL | v 5.0 or higher
Oracle |
PostgreSQL |
SQL Anywhere |
SQL Server |
SQLite |

Multiple asynchronous queries

Execution of the multiple asynchronous queries in parallel is not supported by FireDAC, due to the general multi-threading principle. To workaround that consider the options:

  • group few queries into a stored procedure and call the procedure asynchronously;
  • use a dedicated connection for each asynchronous query running in parallel;
  • launch next asynchronous query after previous one is finished. For that use the AfterOpen and AfterExecute event handlers;
  • finally application may create own threads and execute the DB tasks in these threads.
What do you think about this topic? Send feedback!


Executing SQL Scripts

Executing SQL Scripts
Working with Commands See Also Topics Send Feedback

Most database applications have backend administration utilities, which must execute SQL script. These scripts are written using lines appropriate to the DBMS SQL script syntax. TADScript is the FireDAC SQL script processor.

Group

Working with Commands

Topics
Topic | Description
SQL Script Control Commands | TADScript and ADExecutor utility support extended list of the SQL script execution control commands.
Developing Custom Commands | TADScript allows to extend the set of SQL script control execution commands.
Links
Working with Commands, See Also, Topics
Description
General

A SQL script is a set of separated SQL, execution control and logging commands. The SQL scripts are useful for the backend maintenance tasks, such as backend SQL objects creation, dropping, upgrading, initial data loading and so on.

Many DBMS's allow to execute few SQL commands in a single TADQuery.ExecSQL call as a batch, but with limitations. The differences between SQL script and SQL command batch are:

  • script allows to use all possible SQL commands in single script. The batch may have limitation, depending on a DBMS. For example, Oracle anonymous PL/SQL block cannot contain a DDL commands.
  • script may be split into few transactions. The batch must be performed in a single transaction.
  • script allows to use non-SQL and custom commands. The batch may include only commands understanding by a DBMS.
  • script may be split into subscripts. The batch may call stored procedures as a separated code blocks.
  • script execution is fully controlled by the client. The batch execution is controlled only by the DBMS.
  • script execution may be logged. The batch execution does not.
  • script provides execution progress feedback. The batch execution does not.

TADScript has many advantages over standard utilities, like the ability to be completely integrated into the FireDAC application and the ability to extend the set of commands by the custom script commands. The TADScript component is aware of several industry standard SQL script syntaxes, including:

  • Oracle SQL*Plus;
  • Microsoft ISQL / OSQL;
  • MySQL mysql.exe / mysqldump.exe;
  • Firebird / Interbase ISQL.

For example, the following Firebird script creates a database, and may be executed using TADScript:

SET SQL DIALECT 3;
SET NAMES UTF8;
SET CLIENTLIB 'C:\fb25\bin\fbclient.dll';
CREATE DATABASE 'E:\Test2.ib'
  USER 'sysdba' PASSWORD 'masterkey'
  PAGE_SIZE 16384
  DEFAULT CHARACTER SET NONE;

SET TERM ^ ;

CREATE PROCEDURE MY_PROC RETURNS (aParam INTEGER) AS
BEGIN
  aParam = 10;
END^

Executing the script

TADScript allows to execute a script from a file pointed by SQLScriptFileName, if it specified. Otherwise from a script with a zero index from the SQLScripts collection. Note, a file with SQL script may be executed also using the ADExecutor utility. For example, to execute a script file:

with ADScript1 do begin
  SQLScriptFileName := 'c:\create.sql';
  ValidateAll;
  ExecuteAll;
end;

To execute a script in a memory:

with ADScript1 do begin
  SQLScripts.Clear;
  SQLScripts.Add;
  with SQLScripts[0].SQL do begin
    Add('INSERT INTO Brands VALUES (1, ''Audi'')');
    Add('INSERT INTO Brands VALUES (2, ''BMW'')');
  end;
  ValidateAll;
  ExecuteAll;
end;

Also there are few other methods, simplifying SQL script execution. You can control many other script execution aspects as from a Delphi code using ScriptOptions, as using corresponding script control commands.

The script may also call other scripts, like a subroutines, using @ <script>, @@ <script>, START <script> or INPUT <script> commands. There <script> is either the item name from the SQLScripts collection, either the external file name. For example, the 'root' script executes 'first' and 'second' subscripts:

with ADScript1.SQLScripts do begin
  Clear;
  with Add do begin
    Name := 'root';
    SQL.Add('@first');  // explicitly call 'first' script
    SQL.Add('@second'); // explicitly call 'second' script
  end;
  with Add do begin
    Name := 'first';
    SQL.Add('create table t1 (...);');
    SQL.Add('create table t2 (...);');
  end;
  with Add do begin
    Name := 'second';
    SQL.Add('create procedure p1 (...);');
    SQL.Add('create procedure p2 (...);');
  end;
end;
ADScript1.ValidateAll;
ADScript1.ExecuteAll;

A SQL script may be executed as in full with a subscripts, using ExecuteAll method. As in step-by-step mode, using ExecuteStep method. The last method is useful for the GUI applications, allowing to execute add-hoc queries. The next command will be extracted and executed from the Position position in the script. To abort the script execution call the AbortJob method.

Separating commands

Each SQL command must be terminated by a command separator. The separator default value is a ';' and for MS SQL Server it is 'GO'. A control command does not need to be terminated by a command separator. The separator may be changed as from a Delphi code using CommandSeparator option, as from a SQL script using SET CMDSEP <sep> or DELIMiter <sep> commands. For example for SQL Server:

INSERT INTO Brands VALUES (1, 'Audi')
GO
INSERT INTO Brands VALUES (2, 'BMW')
GO

For Oracle:

INSERT INTO Brands VALUES (1, 'Audi');
INSERT INTO Brands VALUES (2, 'BMW');

Using a custom separator:

SET CMDSEP #
INSERT INTO Brands VALUES (1, 'Audi')#
INSERT INTO Brands VALUES (2, 'BMW')#

When a script contains a DB programming language commands or blocks, then additional consideration must be made:

DBMS
SQL commands
Description
Firebird
  • CREATE FUNCTION
  • EXECUTE BLOCK <code block>
Must be terminated by '/', or a separator different from ';' must be set.
Oracle
  • CREATE PROCEDURE / FUNCTION / PACKAGE / etc
  • BEGIN <code block> END
Must be terminated by '/', or a separator different from ';' must be set.
PostgreSQL
  • CREATE FUNCTION
  • DO <code block>
No actions is required.

For example with Firebird:

SET CMDSEP #;
EXECUTE BLOCK ... #
SET CMDSEP ;#
INSERT INTO Brands VALUES (3, 'Mercedes');

Otherwise application may raise an error likes this:

[FireDAC][IB] Unexpected end of command line 3

Using parameters

A SQL script may reference to:

  • parameters from the TADScript.Params collection. To define a parameter in script use VARiable <name><type>=<value> command. To define a parameter in the code add a parameter to the TADScript.Params before script execution.
  • macros from the TADScript.Macros collection. To define a macro in script use DEFine <name>=<value> command. To define a macro in the code add a macro to the TADScript.Macros before script execution. To enable macro processing set MacroExpand to True (default) or execute SET DEFINE ON or SET SCAN ON.
  • arguments using &<argument number> syntax. The arguments may be specified in the TADScript.Arguments property, as an argument to the TADScript.ExecuteFile or ExecuteScript methods, or as part of the @ / @@ commands.

For example to define and use parameters:

with ADScript1.SQLScripts[0].SQL do begin
  Add('VARIABLE name CHAR IN = ''aaa''');
  Add('VARIABLE id NUMBER INOUT');
  Add('INSERT INTO master (name) VALUES (:name) RETURNING id {INTO :id};');
  Add('INSERT INTO detail (fk_id, name) VALUES (:id, ''bbb'');');
end;

To define and reference a macro:

DEF tab=Brands
INSERT INTO !tab VALUES (1, 'Audi');
INSERT INTO !tab VALUES (2, 'BMW');

To define and use arguments:

ADScript1.Arguments.Add('Brands');
...
with ADScript1.SQLScripts[0].SQL do begin
  Add('INSERT INTO &1 VALUES (1, ''Audi'')');
  Add('INSERT INTO &1 VALUES (2, ''BMW'')');
end;

Getting feedback

To produce an execution log, you can enable spooling as from Delphi code using SpoolOutput and SpoolFileName options, as from a SQL script using SPOol <name> or OUTput <name> commands. The content of the spool output is controlled by the EchoCommands, FeedbackCommands, AutoPrintParams, FeedbackScript, IgnoreError, Timing, ColumnHeadings, PageSize, ServerOutput options.

You can use TADGUIxScriptDialog component to allow to a script execution engine to communicate with an end-user using a dialog. To interact with the end-user TADScript uses events, like the OnConsoleGet, OnConsolePut, OnGetText, OnPause, etc. And this dialog provides a standard implementation for these events. To show an execution progress, TADScript needs to know the total length of all scripts to execute. For that call the ValidateAll method before starting a script execution.

Resolving incompatibilities

The list of known TADScript incompatibilities with the original scripting utilities:

  • Firebird ISQL works in non auto commit mode. TADScript / TADConnection by default has auto commit mode turned on. For better compatibility set ADConnection.TxOptions.AutoCommit to False before script execution. Or execute SET AUTOCOMMIT OFF script command.
  • Microsoft ISQL outputs the PRINT command result. TADScript / TADConnection by default does not. To enable PRINT output set ResourceOptions.ServerOutput to True. Or execute SET SERVEROUTPUT ON script command.
See Also

TADScript, ADExecutor, SQL Script Control Commands, Developing Custom Commands

What do you think about this topic? Send feedback!


SQL Script Control Commands

SQL Script Control Commands
Executing SQL Scripts See Also Send Feedback

TADScript and ADExecutor utility support extended list of the SQL script execution control commands.

Group

Executing SQL Scripts

Links
Executing SQL Scripts, See Also
Description
Command
Description
(@ | @@ | START | INput) <script> [<arguments>]
Starts execution of the specified script.
'@@' executes a script with a file name relative to parent script path.
<arguments> is a comma-separated list of values. If not specified, then the parent arguments will be inherited.
ACCept <var> (NUMber|CHAR|DATE) [FORmat <fmt>] [DEFault <def>] [PROmpt '<prompt>' | NOPRompt] [HIDE]
Asks user to enter a parameter value.
NUMber|CHAR|DATE - optional value type.
FORmat <fmt> - Delphi format string used to parse DATE values.
DEFault <def> - default value, when a user entered empty string.
PROmpt '<prompt>' | NOPRompt - prompt to output to console.
CONnect <FireDAC connection string>
Connects to the specified DBMS - OpenConnection.
COPY FROM (FILE '<file>' | SQL '<sql>' [CONnect '<connection>'])
TO (FILE '<file>' | TABle '<table name>' [CONnect '<connection>'])
[TRUNCate | CLEar | ALWAYSinsert | APPend | UPDate | APPENDUPDate | DELete]
[LOG (OFF | (SPOol|OUTput) | ([APPend] <log file name>)]
[USING (FILE 'config file' | PARAMS '<definition>')]
Moves data between databases or text files. There:
  • FILE '<file>' - a name of a file with text data;
  • SQL '<sql>' - SELECT command or a DB table name;
  • TABle '<table name>' - name of a DB table;
  • CONnect '<connection>' - FireDAC connection string;
  • TRUNcate - truncate the destination DB table before loading the data;
  • CLEar - clear the destination DB table before loading the data;
  • ALWAYSinsert | APPend | UPDate | APPENDUPDate | DELete - the action to perform with the destination DB table;
  • USING PARAMS '<definition>' - there definition is a serialized TADDataMove component, as it is stored in a DFM. For example: "object TADDataMove TextFileName = 'Data.txt' LogFileName = 'Data.log' .... end"
  • USING FILE 'config file' - there config file is a external file, containing a serialized TADDataMove component.
DEFine [<name> | <name>=<value>]
DEFINE without name - prints all macros;
DEFINE <name> - prints the specified macro;
DEFINE <name>=<value> - sets the specified macro value.
DELIMiter <text>
Sets script command separator - ScriptOptions.CommandSeparator.
DISconnect
Disconnects from the DBMS - CloseConnection.
(EXECute | CALL) <procedure>
Executes the specified stored procedure.
EXIT
Stops script execution and commits changes.
QUIT
Stops script execution and rollback changes.
STOP
Stops script execution.
HELP
Shows help for all registered commands.
(HOst | !! | SHELL) <command>
Executes host shell command. For Windows is used call ShellExecute('open', ACommand).
PAUse <prompt>
Prints specified prompt and pauses script execution.
PROmpt <prompt>
Prints specified text.
PRInt <var 1> [..., <varN>]
Prints value of the specified parameters.
REMark <text>
Adds comment to the script.
SET ARRAY <value>
Specifies the rowset size - FetchOptions.RowsetSize.
SET AUTOcommit OFF|ON|<value>
Sets auto commit off, on or to commit each N commands - ScriptOptions.CommitEachNCommands.
SET AUTOPrint OFF|ON
Shows parameter values after command execution - ScriptOptions.AutoPrintParams.
SET BREAK OFF|ON
Stops script execution on error - ScriptOptions.BreakOnError.
SET (CMDSeparator | TERMinator) <value>
Specifies commands separators - ScriptOptions.CommandSeparator. TERM is for IB/FB only.
SET (DEFine | SCAN) OFF|ON
Controls macros expansion - ScriptOptions.MacroExpand.
SET DROPnonexistent ON|OFF
Allows to drop non-existent objects - ScriptOptions.DropNonexistObj.
SET ECHO OFF|(ON [SQL|ALL] [TRIM 50|<value>])
Outputs command text before it executing with optional trimming - ScriptOptions.EchoCommands, EchoCommandTrim.
SET ENCoding ANSI | UTF8 | UTF16
Sets SQL script and log files encoding - ScriptOptions.FileEncoding.
SET (FEEDback|COUNT) 6|<value>|OFF|ON
Outputs feedback after command execution - ScriptOptions.FeedbackCommands.
SET HEAding OFF|ON
Outputs column names for a result set - ScriptOptions.ColumnHeadings.
SET LINESize 0|<value>
Sets line width - ScriptOptions.LineSize.
SET LONG 80|<value>
Outputs up to a specified amount of characters for a character or BLOB value - ScriptOptions.MaxStringWidth.
SET PAGESize 24|<value>
Sets the page length when printing a result set - ScriptOptions.PageSize.
SET PARAMARRAY 1|<value>
Specifies the size of the parameter array - ScriptOptions.ParamArraySize, Params.ArraySize.
SET SERVEROUTPUT OFF|(ON [SIZE <value>])
Shows server output after command execution - ResourceOptions.ServerOutput, ServerOutputSize.
SET (TERMout|CONsole) OFF|ON
Enables output to the console, including the command result sets, parameter values, statuses, errors, etc - ScriptOptions.ConsoleOutput.
SET TIMing OFF|ON
Outputs a command execution time - ScriptOptions.Timing.
SET TRIMout OFF|ON
Trims spaces from strings at console output - ScriptOptions.TrimConsole.
SET TRIMSpool ON|OFF
Trims spaces from strings at spool output - ScriptOptions.TrimSpool.
SET VERify OFF|ON
Outputs SQL command before execution with substituted macros - ScriptOptions.Verify.
(SPOol | OUTput) [OFF|[APPend] <spool name>]
without arguments - prints spooling status;
OFF - turns spooling off;
<spool name> - turns spooling on and redirects it to the specified item name in SQLScripts collection or to a file name.
UNDEFine <var1> [..., <varN>]
Undefines specified macros.
VARiable [<name> (NUMber|CHAR|NCHAR [(<size>)]] [TABle <size>]
[IN|OUT|INOUT] [=<value>]
without arguments - prints all parameter values;
<name> - defines a parameter with specified data type, size and direction;
= <value> - assigns a value to the parameter.
CREATE DATABASE <db file name> [PAGE_SIZE <n>]
[DEFAULT CHARACTER SET '<ch set>'] [USER '<user>'] [PASSWORD 'pwd']
Used for Firebird / Interbase connections to create database.
DROP DATABASE
Used for Firebird / Interbase connections to drop database.
See Also

Executing SQL Scripts, ADExecutor, TADScript, TADScriptOptions,

What do you think about this topic? Send feedback!


Developing Custom Commands

Developing Custom Commands
Executing SQL Scripts See Also Send Feedback

TADScript allows to extend the set of SQL script control execution commands.

Group

Executing SQL Scripts

Links
Executing SQL Scripts, See Also
Description

The set of the script control execution commands may be extended by the custom commands. You can find the sources of the existing commands in the uADCompScriptCommands unit and use them as a template for your own commands. The command class must be registered at the commands registry. For example, the SPOOL command code:

type
  TADSpoolScriptCommand = class(TADScriptCommand)
  private
    FMode: Integer;
    FFileName: String;
    FAppend: Boolean;
  public
    class function Help(): String; override;
    class procedure Keywords(AKwds: TStrings); override;
    function Parse(const AKwd: String): Boolean; override;
    procedure Execute(); override;
    // -1 - off, 0 - show, 1 - file
    property Mode: Integer read FMode;
    property Append: Boolean read FAppend;
    property FileName: String read FFileName;
  end;

{-------------------------------------------------------------------------------}
class function TADSpoolScriptCommand.Help(): String;
begin
  Result := '(SPOol | OUTput) [OFF|[APPend] <spool name>] - turns spooling off, print it status'#13#10 +
            '                                               or redirect it to the name';
end;

{-------------------------------------------------------------------------------}
class procedure TADSpoolScriptCommand.Keywords(AKwds: TStrings);
begin
  AKwds.Add('SPOol');
  AKwds.Add('OUTput');
end;

{-------------------------------------------------------------------------------}
function TADSpoolScriptCommand.Parse(const AKwd: String): Boolean;
var
  iLastBmk: Integer;
  ucS: string;
begin
  iLastBmk := Parser.GetBookmark;
  ucS := Parser.GetUCWord;
  if ucS = 'OFF' then
    FMode := -1
  else if ucS = '' then
    FMode := 0
  else begin
    FMode := 1;
    FAppend := ADKeyWordMatch(ucS, 'APPEND', 3);
    if not FAppend then
      Parser.SetBookmark(iLastBmk);
    FFileName := Parser.GetLine();
    if FFileName = '' then
      FMode := -1;
  end;
  Result := True;
end;

{-------------------------------------------------------------------------------}
procedure TADSpoolScriptCommand.Execute();
begin
  case FMode of
  -1:
    begin
      Engine.ScriptOptions.SpoolOutput := smNone;
      EngineIntf.UpdateSpool;
    end;
   0:
    if Engine.ScriptOptions.SpoolOutput <> smNone then
      EngineIntf.ConPut('currently spooling to ' + Engine.ScriptOptions.SpoolFileName, soInfo)
    else
      EngineIntf.ConPut('not spooling currently', soInfo);
   1:
    begin
      if FAppend then
        Engine.ScriptOptions.SpoolOutput := smOnAppend
      else
        Engine.ScriptOptions.SpoolOutput := smOnReset;
      Engine.ScriptOptions.SpoolFileName := EngineIntf.ExpandString(FileName);
      EngineIntf.UpdateSpool;
    end;
  end;
end;

initialization
  ADScriptCommandRegistry().AddCommand(TADSpoolScriptCommand);
See Also

Executing SQL Scripts, TADScript, TADScriptCommand

What do you think about this topic? Send feedback!


Local SQL

Local SQL
Example 1 Example 2 Example 3 Working with Commands See Also Send Feedback

FireDAC offers flexible Local SQL feature. It allows to execute SQL queries against TDataSet descendants as the data sources.

Group

Working with Commands

Links
Example 1, Example 2, Example 3, Working with Commands, See Also
Description
General

The Local SQL feature allows to execute SQL commands, where the TDataSet descendants are used instead of the DB tables. The Local SQL is based on the SQLite database and supports most of the [image] SQLite SQL dialect. As a table name it uses name of a TDataSet (Name property value) or alternatively specified name. Each queryable dataset must be registered with TADLocalSQL - the Local SQL engine.

All read and write operations are performing through the TDataSet API with some extensions. The engine supports as FireDAC, as non-FireDAC datasets. Local SQL is more effective with FireDAC datasets. For non-FireDAC datasets optionally may be implemented the IADPhysLocalQueryAdapter interface as an adapter class and registered it with the Local SQL engine.

The Local SQL possible applications are:

  • Heterogeneous queries. Where queryable datasets have result sets from different DB's.
  • In-memory database. There TADMemTable's are serving as the datasets.
  • Advanced offline mode. There although the main DB is not accessible, an application still can perform the SQL queries.
  • Advanced DataSnap client. There the data delivered by DataSnap driver to the client may be queried locally.
  • Simplified migration. A developer may use the 3d party TDataSet objects in application and use FireDAC API to work with these data sources.

Configuring

FireDAC uses SQLite driver as the Local SQL engine. So first, application should have an SQLite "local" connection. That may be as a file-based read-write connection, as an in-memory connection. We recommend to use in-memory connection. To setup it:

  • drop TADPhysSQLiteDriverLink component on a form;
  • drop TADConnection;
  • set it DriverName to SQLite.

Then application should connect the datasets to the Local SQL engine. For that:

  • drop TADLocalSQL component on a form;
  • set it Connection property to a local SQLite connection object;
  • verify / assign value to a dataset Name property. Required step for the datasets created dynamically in the code;
  • for an FireDAC dataset set TADAdaptedDataSet.LocalSQL property to the TADLocalSQL instance;
  • or for an FireDAC and non-FireDAC dataset use TADLocalSQL.DataSets collection to register TDataSet and optional adapter with Local SQL engine. Also DataSets collection allow to specify alternative dataset name.

Finally activate objects:

  • activate local SQLite connection;
  • activate Local SQL engine by setting TADLocalSQL.Active to True.

Note, if application is using base datasets and local datasets connected to the same SQLite connection, then the connection must be activated explicitly before any dataset on this connection will be opened / executed / prepared. Otherwise exception will be raised.

Alternatively datasets may be submitted to Local SQL engine using TADLocalSQL.OnGetDataSet event handler.

All associated datasets will be registered with the engine when both local connection and Local SQL engine are active. Associating a new dataset does not require to reopen something, and it will be registered automatically. When a dataset is registered, then it will be opened. A TADMemTable must have a defined structure before it will be opened. When application performs a massive datasets registration, it is recommended to deactivate Local SQL engine before and activate it after the task.

The application may setup TADLocalSQL.SchemaName to a schema prefix, which will be used in the SQL queries. Application may use multiple TADLocalSQL's connected to the same connection with or without schema name specified. But each TADLocalSQL.SchemaName in a single SQLite connection must be unique. A schema name allows to organize datasets into the logical groups. When a schema name is specified then dataset in a SQL command may be referenced as <dataset> or <schema>.<dataset>.

The application may optionally set TADLocalSQL.MultipleCursors to False to avoid dataset cloning / copying. SQLite creates a cursor to execute a SQL command referring to a dataset. TDataSet API can keep only a single position. To overcome that FireDAC clones FireDAC dataset using TADMemTable. And copies a non-FireDAC dataset to a TADMemTable. When programmer is sure, that a dataset will be used only a single time in each moment of the time, then MultipleCursors may be set to False to improve performance. We do not recommend to set MultipleCursors to False, when there are unidirectional datasets.

Querying

To perform a Local SQL query, application should use TADQuery / TADCommand. And set Connection / ConnectionName to the local SQLite connection, which is set also for the TADLocalSQL.Connection. Now application can execute SQL queries, the same as with non-Local SQL connections.

While a query is processing a queryable dataset is disabled by DisableControls, and enabled at end of processing. To keep a dataset enabled, set TADLocalSQL.DisableControls to False. Before a dataset will be read the TADLocalSQL.OnReadDataSet event handler will be called.

Local SQL engine supports [image] SQLite SQL dialect with some limitations. The following SQL commands are not supported for the TDataSet data sources:

  • ALTER TABLE ... ADD COLUMN. Instead change the dataset structure.
  • DROP TABLE. When a dataset will be unlinked from Local SQL engine, then it will be dropped automatically (not freed).
  • CREATE INDEX / DROP INDEX. Instead of the SQL indexes use the dataset indexes.
  • CREATE TRIGGER / DROP TRIGGER. Instead of the triggers use the dataset events.

Local SQL engine does not support datasets with multiple result sets.

Local SQL engine supports INSERT / UPDATE / DELETE SQL commands, as transactions and savepoints. And transforms corresponding SQL commands into the TDataSet API calls.

Compatibility

The Local SQL engine uses TDataSet API with some extensions provided by IADPhysLocalQueryAdapter interface. FireDAC datasets implement this interface. For non-FireDAC datasets a developer optionally may create a class implementing the interface, and assign it instance to the TADLocalSQL.DataSets[..].Adapter property.

Also, to perform the Local SQL operations a dataset must conform to the following requirements:

Operation
Requirements
INSERT
Mandatory:
  • Append method;
  • Post method.
Optionally:
  • PSGetKeyFields must return primary key fields.
UPDATE
Mandatory:
  • Edit method;
  • Post method;
  • Locate method.
Optionally:
  • PSGetKeyFields must return primary key fields.
DELETE
Mandatory:
  • Delete method;
  • Locate method.
Optionally:
  • PSGetKeyFields must return primary key fields.
Sorting / ORDER BY
Optionally:
  • afIndexFieldNames in IADPhysLocalQueryAdapter.Features, then IADPhysLocalQueryAdapter.IndexFieldNames property will be used for sorting dataset.
Filtering / WHERE
Optionally:
  • afRanges in IADPhysLocalQueryAdapter.Features, then IADPhysLocalQueryAdapter.SetRange method will be used to filter dataset;
  • afFilters in IADPhysLocalQueryAdapter.Features, then Filter property will be used too.
Savepoints
Mandatory:
  • afCachedUpdates, afSavePoints in IADPhysLocalQueryAdapter.Features, then IADPhysLocalQueryAdapter.Savepoint property will be used.
Transactions
Mandatory:
  • PSStartTransaction method;
  • PSEndTransaction method.
See Also

Using SQLite with FireDAC, Executing Command, TADLocalSQL

Example 1

Heterogeneous query using SQL Anywhere and Oracle tables and FireDAC TADQuery's:

// setup connection and query to "Orders" table in SQL Anywhere DB
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;
ADQuery1.Connection := ADConnection1;
ADQuery1.SQL.Text := 'select * from Orders';
// link dataset to Local SQL engine
ADQuery1.LocalSQL := ADLocalSQL1;

// setup connection and query to "Order Details" table in Oracle DB
ADConnection2.ConnectionDefName := 'Oracle_Demo';
ADConnection2.Connected := True;
ADQuery2.Connection := ADConnection2;
ADQuery2.SQL.Text := 'select * from "Order Details"';
// link dataset to Local SQL engine
ADQuery2.LocalSQL := ADLocalSQL1;

// setup SQLite in-memory connection
ADConnection3.DriverName := 'SQLite';
ADConnection3.Connected := True;
// link Local SQL to SQLite connection
ADLocalSQL1.Connection := ADConnection3;
ADLocalSQL1.Active := True;

// execute SELECT query on above datasets
ADQuery3.Connection := ADConnection3;
ADQuery3.SQL.Text := 'SELECT * FROM ADQuery1 LEFT JOIN ADQuery2 ON ADQuery1.OrderID = ADQuery2.OrderID';
ADQuery3.Active := True;
Example 2

Heterogeneous query using ADO TADOQuery's and FireDAC TADQuery's:

// setup connection and query to "Orders" table
ADOQuery1.SQL.Text := 'select * from Orders';
// link dataset to Local SQL engine
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADOQuery1;
  Name := 'Orders';
end;

// setup connection and query to "Order Details" table
ADOQuery2.SQL.Text := 'select * from "Order Details"';
// link dataset to Local SQL engine
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADOQuery2;
  Name := 'Order Details';
end;

// setup SQLite in-memory connection
ADConnection1.DriverName := 'SQLite';
ADConnection1.Connected := True;
// link Local SQL to SQLite connection
ADLocalSQL1.Connection := ADConnection1;
ADLocalSQL1.Active := True;

// execute SELECT query on above datasets
ADQuery1.Connection := ADConnection1;
ADQuery1.SQL.Text := 'SELECT * FROM Orders o LEFT JOIN "Order Details" od ON o.OrderID = od.OrderID';
ADQuery1.Active := True;
Example 3

See demos:

- Cross DBMS query - FireDAC\Samples\Comp Layer\TADLocalSQL\xDBMS

- In-memory database - FireDAC\Samples\Comp Layer\TADLocalSQL\InMemDB

What do you think about this topic? Send feedback!


Working with DataSets

Working with DataSets
FireDAC Topics Send Feedback

A set of articles describing how to work with FireDAC dataset classes, including how to edit the dataset content.

Group

FireDAC

Topics
Topic | Description
Sorting Records | FireDAC offers few methods to sort the records. The dataset sorting allows to get the required records order without requering a DB.
Filtering Records | FireDAC offers few methods to filter the records. The dataset filtering allows to get records subsets basing on a condition.
Master-Detail Relationship | FireDAC has flexible support for master-detail relationship between datasets.
Finding a Record | FireDAC offers few methods to find a specific record in the dataset.
Calculated and Aggregated Fields | FireDAC offers few kinds of calculated fields.
Writing Expressions | FireDAC offers powerful client expressions engine, used for filtering, indexing and calculated fields.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Sorting Records

Sorting Records
Example Working with DataSets See Also Send Feedback

FireDAC offers few methods to sort the records. The dataset sorting allows to get the required records order without requering a DB.

Group

Working with DataSets

Links
Example, Working with DataSets, See Also
Description
General

All FireDAC datasets are offering few approaches to locally sort the records. Before sorting the records, FireDAC will fetch all records from the result set. Internally FireDAC builds and maintains a list of sorted records. So, on large record volumes the sorting may be long, but subsequent records navigation will be the same fast as without sorting.

Standard sorting

To sort dataset by the field values application may use IndexFieldNames property. It supports multiple fields, case-insensitive and descending modes. Also use FormatOptions.SortOptions to modify the sort order properties. For example:

ADQuery1.IndexFieldNames := 'ORDERID';

or

ADQuery1.IndexFieldNames := 'OrderDate:D;Price';

Alternatively, when a dataset has few indexes defined in the Indexes collection, then one of the indexes may be current. To do that use IndexName property. For example:

with ADQuery1.Indexes.Add do begin
  Name := 'By OrderDate';
  Fields := 'OrderDate';
  Active := True;
end;
ADQuery1.IndexName := 'By OrderDate';

Dataset views

FireDAC allows to define views of the dataset records using the Indexes collection. The following properties control the view:

  • Sorting by fields (Fields, CaseInsFields, DescFields, Options).
  • Sorting by expression (Expression, Options).
  • Records filter (Filter, FilterOptions).
  • Records distinction flag (Distinct).

The view is identified by the Name property. It must be unique across dataset.

The view is a list of records maintained by FireDAC, when application fetches or edits records. The view is maintained when its Active is True and dataset IndexesActive is True. When view has soUnique or soPrimary in Options and the application needs to enforce record uniqueness, set dataset ConstraintsEnabled to True.

When view is current, then dataset represents the record list maintained by this view. To make view current, set it Selected property to True or set dataset IndexName property to the view name. For example:

with ADQuery1.Indexes.Add do begin
  Name := 'May sale dates';
  Fields := 'OrderDate';
  Filter := 'MONTH(OrderDate) = 5';
  Distinct := True;
  Active := True;
  Selected := True;
end;

Other options

Some of navigation methods, like the Locate / Lookup / SetRange are using the current sort order to optimize its operations. Note, that Filter property does not use the views to optimize filtering.

Application may use fkInternalCalc and fkAggregate fields in sorting. FireDAC does not support sorting on fields of the fkCalculated and fkLookup kinds. As a workaround the application may create fkInternalCalc field, fill it in OnCalcFields event handler by the value of the fkCalculated or fkLookup field, then sort on this fkInternalCalc field.

TADTable and sorting

The TADTable sorting is performed at server side (ORDER BY). Note, that FireDAC will automatically and transparently add primary key fields to the sorting order. That is required for proper live data window functionality.

See Also

Writing Expressions, Filtering Records, Finding a Record, Calculated and Aggregated Fields, Master-Detail Relationship, Browsing Table

Example

For additional details see demos:

  • FireDAC\Samples\Comp Layer\TADQuery\Indices
  • FireDAC\Samples\Comp Layer\TADMemTable\Main
What do you think about this topic? Send feedback!


Filtering Records

Filtering Records
Example Working with DataSets See Also Send Feedback

FireDAC offers few methods to filter the records. The dataset filtering allows to get records subsets basing on a condition.

Group

Working with DataSets

Links
Example, Working with DataSets, See Also
Description
General

All FireDAC datasets are offering few approaches to locally filter the records. After applying a filter, FireDAC will not requery records, but will filter records in local dataset cache. Internally FireDAC builds and maintains a list of filtered records. So, on large record volumes the filter activation may be long, but subsequent records navigation will be the same fast as without filtering.

Standard filtering

FireDAC datasets offer few options to filter records using a standard approach:

  • Filter property allows to specify an conditional expression as a string. After specifying Filter value set Filtered property to True to activate the filter. For example:

ADQuery1.Filter := 'OrderID in (10150, 10151, 10152)';
ADQuery1.Filtered := True;

  • OnFilterRecord event handler allows to implement filtering as a Delphi code. After specifying Filter value set Filtered property to True to activate the filter. For example:

ADQuery1.OnFilterRecord := Form1FilterRecord;
ADQuery1.Filtered := True;

procedure TForm1.Form1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
var
  iOrderID: Integer;
begin
  iOrderID := DataSet.FieldByName('OrderID').AsInteger;
  Accept := (iOrderID = 10150) or (iOrderID = 10151) or (iOrderID = 10152);
end;

Filtering by a range

When dataset is sorted using the field list, then application may apply filtering by a field values range. This is most effective way to limit records, as it is using the dataset internal index structures.

The following methods control the filtering:

  • SetRangeStart - brings dataset to a mode allowing to set range minimal values and erasing the previous values;
  • EditRangeStart - brings dataset to a mode allowing to set range minimal values preserving the previous values;
  • SetRangeEnd - brings dataset to a mode allowing to set range maximal values and erasing the previous values;
  • EditRangeEnd - brings dataset to a mode allowing to set range maximal values preserving the previous values;
  • ApplyRange - activates range filtering after specifying minimal and maximal values;
  • SetRange - combines SetRangeStart, SetRangeEnd and ApplyRange into a single method;
  • CancelRange - cancels the range filtering.

And properties:

  • IsRanged - allows to get the current range filtering mode.
  • KeyExclusive - get / set the inclusion of minimal and maximal values into filtered range;
  • KeyFieldCount - get / set the number of index fields to use in range filtering.

For example:

ADQuery1.IndexFieldNames := 'ORDERID;ORDERDATE';
ADQuery1.SetRangeStart;
ADQuery1.KeyExclusive := False;
ADQuery1.KeyFieldCount := 1;
ADQuery1.FieldByName('OrderID').AsInteger := 10150;
ADQuery1.SetRangeEnd;
ADQuery1.KeyExclusive := False;
ADQuery1.KeyFieldCount := 1;
ADQuery1.FieldByName('OrderID').AsInteger := 10152;
ADQuery1.ApplyRange;

Filtering by a record status

The FilterChanges property allows to filter records, depending on their change status. This filtering may be used only in Cached Updates mode. For example, to show only modified and deleted records:

ADQuery1.FilterChanges := [rtModified, rtDeleted];

To filter records, failed to process at ApplyUpdates call, use FilterChanges with rtHasErrors.

Other options

There are other options allowing to limit the visible records:

  • Using master-detail datasets relation;
  • Combine sorting and filtering using local dataset indexes.

Also note, FireDAC does not support filtering on fields of the fkCalculated and fkLookup kinds. But application may use fkInternalCalc and fkAggregate fields in filtering.

TADTable and filtering

TADTable in live data window mode uses server side filtering (WHERE) for:

  • Filter property. Note, that the Filter property content is sent to a DB as is. You may use FireDAC escape sequences to make an expression compatible with a DBMS and with the local expression engine;
  • a detail TADTable in the master-detail relationship;
  • when a range is applied to a TADTable.

And client side filtering for:

  • OnFilterRecord event;
  • FilterChanges property.
See Also

Writing Expressions, Sorting Records, Finding a Record, Calculated and Aggregated Fields, Master-Detail Relationship, Browsing Table

Example

See the following demos for additional details:

  • FireDAC\Samples\Comp Layer\TADQuery\Filter
  • FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail
What do you think about this topic? Send feedback!


Master-Detail Relationship

Master-Detail Relationship
Example Working with DataSets See Also Send Feedback

FireDAC has flexible support for master-detail relationship between datasets.

Group

Working with DataSets

Links
Example, Working with DataSets, See Also
Description
General

The master-detail relationship allows automatically filter a detail dataset basing on a current master dataset record. For example, the master dataset has "Order" records, and the detail dataset has "Order Line" records. So the detail dataset shows only lines for the current order.

Special setup is not required for a master dataset. FireDAC offers two base methods to setup a detail dataset in a master-detail relationship:

  • Parameter based. The master dataset field values are assigned to the detail TADQuery or TADStoredProc parameters, then detail dataset query is reexecuted.
  • Range based. The master dataset field values are used to apply a range to the detail dataset. The detail dataset may be any FireDAC dataset with current active index.

These methods may be combined. To choose between them consider the table:

Feature | Parameter based | Range based
The detail query returns a limited number of records. | + |
The detail records are fresh. | + |
Reduced traffic and DBMS workload on each master change. |  | +
The cached updates preserved on the master change. |  | +
Works in offline mode. |  | +
Supports Centralized Cached Updates with propagation |  | +

Also, FireDAC offers two cached updates modes for the datasets in master-detail relationship:

  • Decentralized Cached Updates mode, when each dataset tracks the changes independently on others;
  • Centralized Cached Updates mode, when few datasets in master-detail relationship share a single change log. And master dataset may propagate changes to the detail datasets in cascading fashion, including auto-incrementing field values.

Parameters based M/D

To setup the parameters based M/D relationship, perform the following steps:

  1. Drop TADQuery (or any other FireDAC dataset) on a form. Name it qOrders. That will be a master dataset. Setup it - lets assign the SQL:

SELECT * FROM {id Orders}

  2. Drop TDataSource on a form. Name it dsOrders. Set it DataSet to qOrders.
  3. Drop TADQuery on a form. Name it qOrderDetails. That will be a detail dataset. Setup it - lets assign the SQL:

SELECT * FROM {id Order Details} WHERE OrderID = :OrderID

Then set MasterSource to dsOrders. The base setup is finished.

So, how it works ? FireDAC builds for qOrderDetails a list of pairs - qOrders fields and qOrderDetails parameters. Elements in each pair:

  • when MasterFields is not specified, then have the same name;
  • otherwise - have the same position, fields in MasterFields list, parameters in Params collection.

When the current qOrders record is changed, FireDAC assigns for each parameter a corresponding field value. In our case qOrderDetails :OrderID parameter gets the qOrder OrderID field value. After that the qOrders is reexecuted.

Note, the BeforeOpen and AfterOpen events do not fire for detail dataset. Use OnMasterSetValue instead.

Range based M/D

To setup the range based M/D relationship, perform the following steps:

  1. Drop TADQuery (or any other FireDAC dataset) on a form. Name it qOrders. That will be a master dataset. Setup it - lets assign the SQL:

SELECT * FROM {id Orders}

  2. Drop TDataSource on a form. Name it dsOrders. Set it DataSet to qOrders.
  3. Drop TADQuery on a form. Name it qOrderDetails. That will be a detail dataset. Setup it - lets assign the SQL:

SELECT * FROM {id Order Details}

Then set MasterFields to ORDERID, IndexFieldNames to ORDERID and MasterSource to dsOrders. The base setup is finished.

So, how it works ? FireDAC builds for qOrderDetails a list of pairs - qOrders and qOrderDetails fields, where fields in each pair have the same position, master fields in MasterFields, detail fields in IndexFieldNames.

When the current qOrders record is changed, FireDAC applies the range to qOrderDetails, where details fields are equal to corresponding master fields. In our case qOrderDetails OrderID field is equal to qOrder OrderID field.

Combining methods

To combine both methods an application should use both Parameters and Range based setups and include fiDetails into FetchOptions.Cache. Then FireDAC at first will use range based M/D. And if a dataset is empty, then FireDAC will use parameters based M/D. The new queried records will be appended to the internal records storage.

Also the OnMasterSetValues event handler may be used to override M/D behavior.

Editing detail dataset

When a new record is inserted into detail dataset, the fields participating in a M/D relationship will be filled automatically by the corresponding master dataset field values. The detail dataset field list is defined:

  • For parameter based M/D - DetailFields, if specified. Otherwise - the fields with the same names as the parameters.
  • For range based M/D - the index fields.

To insert a detail record, the master dataset must be in the browsing state (dsBrowse). It is impossible to have both master and detail dataset in inserting (dsInsert) or editing (dsEdit) state.

When master and details datasets are in the cached updates mode, then application may use TADSchemaAdapter to enable Centralized Cached Updates with propagation. For that master and details datasets SchemaAdapter property must point to the same TADSchemaAdapter and detail dataset FetchOptions.DetailCascade is True.

Navigating in M/D

When an application needs to navigate in a master dataset, on each master record change the detail dataset will be refreshed. That consumes the resources and the navigation may be slow. To temporary disable M/D synchronization, application may call DisableControls / EnableControls for the master dataset:

qOrders.DisableControls;
try
  qOrders.First;
  while not qOrders.Eof do begin
    .....
    qOrders.Next;
  end;
finally
  qOrders.EnableControls;
end;

To force disabled M/D synchronization, call ApplyMaster method on the master dataset. To temporary disable M/D synchronization for a specific detail dataset, use DisableScroll / EnableScroll methods of the dataset MasterLink property:

qOrderDetails.MasterLink.DisableScroll;
try
  qOrders.First;
  while not qOrders.Eof do begin
    if qOrders.FieldByName('OrderID').AsInteger = 100 then begin
      qOrderDetails.ApplyMaster;
      // read qOrderDetails dataset - it is synchronized with qOrders
    end;
    qOrders.Next;
  end;
finally
  qOrderDetails.MasterLink.EnableScroll;
end;

The GUI applications may benefit from delayed M/D synchronization. So, when an user scrolls in a grid, a detail dataset will be refreshed not immediately, but after some delay and if there were no other navigations. To use that set FetchOptions.DetailDelay for a detail dataset. To temporary disable delayed M/D synchronization for a specific detail dataset and use immediate synchronization, use DisableDelayedScroll / EnableDelayedScroll methods of the MasterLink property.

By default a state change, a non-key field values change, refreshing of master dataset will not lead to detail dataset refreshing. This avoids extra refreshes of detail dataset. If your application expects always refresh detail dataset, then set FetchOptions.DetailOptimize to False.

See Also

Sorting Records, Filtering Records, Browsing Table, Caching Updates

Example

See the following demos for additional details:

  • FireDAC\Samples\Comp Layer\TADQuery\MasterDetail;
  • FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail.
What do you think about this topic? Send feedback!


Finding a Record

Finding a Record
Working with DataSets See Also Send Feedback

FireDAC offers few methods to find a specific record in the dataset.

Group

Working with DataSets

Links
Working with DataSets, See Also
Description
General

All FireDAC datasets are offering few approaches to find a record in a local dataset records cache. Depending on the current sorting, the record search may be optimized.

Standard locating

FireDAC datasets offer few options to locate a record or lookup a value for a specified key. These method may use the current dataset index, if it is appropriate for the method call.

  • Locate method allows to find a record for the specified key values:

ADQuery1.IndexFieldNames := 'ORDERID';
if ADQuery1.Locate('ORDERID', 10150, []) then
  ShowMessage('Order is found')
else
  ShowMessage('Order is not found');

  • Lookup method allows to lookup a value for the specified key values.

Extended locating

FireDAC datasets offer few extended methods to locate a record. These method may use the current dataset index, if it is appropriate for the method call.

  • LocateEx method is similar to Locate method, but offers far more options, like search forward or backward, search from beginning or from current records, search using textual predicate (expression). For example:

if ADQuery1.LocateEx('Price >= 1000 and Price <= 2000', []) then
  ShowMessage('Order is found')
else
  ShowMessage('Order is not found');

  • LookupEx method is similar to Lookup method, but offers similar to LocateEx options.

Locating using a filter

This approach to locate a record was introduced into FireDAC for compatibility with BDE components. It may be completely replaced with LocateEx method. The approach is using the methods:

  • FindFirst - find first record satisfying the predicate;
  • FindNext - find next record after current one satisfying the predicate;
  • FindPrior - find previous record after current one satisfying the predicate;
  • FindLast - find last record satisfying the predicate.

To start a search the application must specify predicate as a boolean expression in the Filter property. Note, that this method cannot be used to locate a record in a filtered dataset. Also, the filter is not activated and is used only for locating a record. For example:

ADQuery1.Filter := 'Price >= 1000 and Price <= 2000';
if ADQuery1.FindFirst then
  ShowMessage('Found !');
...
if ADQuery1.FindNext then
  ShowMessage('Found !');

Locating using an index and a key value

This approach to locate a record was introduced into FireDAC for compatibility with BDE components. But we found it helpful. The approach is using the methods:

  • SetKey - set dataset to dsSetKey mode, allowing to specify the index field values;
  • GotoKey - search for an exact record using the index field values, specified after SetKey method call;
  • GotoNearest - search for an exact or next record using the index field values, specified after SetKey method call;
  • FindKey - find an exact record using specified index field values;
  • FindNearest - find an exact or next record using specified index field values.

Before calling these methods the current index must be set. For example:

ADQuery1.IndexFieldNames := 'ORDERID';
ADQuery1.SetKey;
ADQuery1.FieldByName('ORDERID').AsInteger := 10150;
if ADQuery1.GotoKey then
  ShowMessage('Order is found')
else
  ShowMessage('Order is not found');

Other options

Most of the search methods are returning True, when a record is found. Alternatively application may check the dataset Found property.

Also note, FireDAC does not support locating on fields of the fkCalculated and fkLookup kinds. But application may use fkInternalCalc and fkAggregate fields in locating.

See Also

Writing Expressions, Sorting Records, Filtering Records, Calculated and Aggregated Fields, Master-Detail Relationship, Browsing Table

What do you think about this topic? Send feedback!


Calculated and Aggregated Fields

Calculated and Aggregated Fields
Working with DataSets See Also Send Feedback

FireDAC offers few kinds of calculated fields.

Group

Working with DataSets

Links
Working with DataSets, See Also
Description
General

Calculated fields are the virtual fields, whose values are not fetched / stored in database. Instead they are calculated on the client. FireDAC supports calculated fields of all TField.FieldKind types:

  • fkCalculated - a simple calculated field. The value is calculated in TDataSet.OnCalcFields event handler.
  • fkInternalCalc - an advanced calculated field. The value may be assigned as to regular fields and is stored in the dataset records cache. The value is calculated in TDataSet.OnCalcFields event handler or using expression specified by TField.DefaultExpression.
  • fkLookup - a lookup fields. The value is calculated automatically, providing a value from a lookup dataset for a key value from this dataset.
  • fkAggregate - an aggregate calculating field. The values is calculated using expression specified by TAggregateField.Expression, which includes COUNT, SUM, MIN, MAX, AVG aggregate functions.

Only fkInternalCalc and fkAggregate fields may be used in filtering, sorting or locating. Also they will be stored with other dataset fields into persistent stream or file. The calculated field values cannot be posted to a database in automatic mode.

Standard calculated fields

fkCalculated and fkInternalCalc calculated field values may be assigned by the TDataSet.OnCalcFields event handler. A calculated field may be defined:

  • at design-time using the dataset "Fields Editor ..." menu item;
  • at run-time using the code. For example, to create a calculated field, that contains upper cased name:

procedure TForm1.Form1CalcFields(ADataSet: TDataSet);
begin
  ADataSet.FieldByName('UName').AsString := UpperCase(ADataSet.FieldByName('Name').AsString);
end;

var
  oField: TField;
  i: Integer;
...
ADQuery1.FieldDefs.Updated := False;
ADQuery1.FieldDefs.Update;
for i := 0 to ADQuery1.FieldDefs.Count - 1 do
  ADQuery1.FieldDefs[i].CreateField(Self);

oField := TStringField.Create(ADQuery1);
oField.Size := 50;
oField.FieldName := 'UName';
oField.FieldKind := fkInternalCalc; // or fkCalculated
oField.DataSet := ADQuery1;

ADQuery1.OnCalcFields := Form1CalcFields;
ADQuery1.Open;

Expression calculated fields

fiInternalCalc fields may be calculated automatically by an expression specified by the TField.DefaultExpression. The OnCalcFields event handler and explicit value assignment is not needed then. The expression cannot be changed when the dataset is active. For example:

var
  oField: TField;
  i: Integer;
...
ADQuery1.FieldDefs.Updated := False;
ADQuery1.FieldDefs.Update;
for i := 0 to ADQuery1.FieldDefs.Count - 1 do
  ADQuery1.FieldDefs[i].CreateField(Self);

oField := TStringField.Create(ADQuery1);
oField.Size := 50;
oField.FieldName := 'UName';
oField.FieldKind := fkInternalCalc;
oField.DefaultExpression := 'UPPER(Name)';
oField.DataSet := ADQuery1;

ADQuery1.Open;

Aggregate fields

fkAggregate aggregate fields management is similar to the expression calculated fields. FireDAC calculates aggregate fields when TADDataSet.AggregatesActive is True, by default it is False. The aggregate expression cannot be changed when the dataset is active. For example to create an aggregated field:

var
  oField: TAggregateField;
  i: Integer;
...
ADQuery1.FieldDefs.Updated := False;
ADQuery1.FieldDefs.Update;
for i := 0 to ADQuery1.FieldDefs.Count - 1 do
  ADQuery1.FieldDefs[i].CreateField(Self);

oField := TAggregateField.Create(ADQuery1);
oField.FieldName := 'Total';
oField.Expression := 'SUM((ItemPrice + ItemTaxes) * ItemCount)';
oField.DataSet := ADQuery1;

ADQuery1.AggregatesActive := True;
ADQuery1.Open;

An aggregated field may define grouping. Then a value is calculated for records with the same index field values, instead of all records. To define grouping set:

  • TAggregateField.IndexName to a name of the index to use for grouping. By default - the current index is used.
  • TAggregateField.GroupingLevel to a number of indexed fields to use for grouping. By default - 0 (no fields and no grouping).

Note, aggregated field always return Null value, when a dataset is in dsInsert state.

Aggregate values

Also, FireDAC application may use TADDataSet.Aggregates collection to define aggregated values. They are more light-weighted than fields and may define at any time, including when dataset is active. For example:

with ADQuery1.Aggregates.Add do begin
  Name := 'Total';
  Expression := 'SUM((ItemPrice + ItemTaxes) * ItemCount)';
  Active := True;
end;
ADQuery1.AggregatesActive := True;
...
Label1.Caption := VarToStr(ADQuery1.Aggregates[0].Value);
See Also

Sorting Records, Filtering Records, Writing Expressions

What do you think about this topic? Send feedback!


Writing Expressions

Writing Expressions
Example Working with DataSets Send Feedback

FireDAC offers powerful client expressions engine, used for filtering, indexing and calculated fields.

Group

Working with DataSets

Links
Example, Working with DataSets
Description
General

FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%);
  • ODBC escape functions.

To add Oracle-like, ODBC-like and regular expression functions, you should include uADStanExprFuncs unit into any application uses clause. Otherwise you can get error, like "Column with name [NVL] is not found". The registered functions are:

  • Character macro functions;
  • Numeric macro functions;
  • Date and time macro functions;
  • System macro functions;
  • Convert macro function.

Expression engine does not support ODBC escape {fn xxx} syntax for calling of functions. But practically the full set of the escape functions is supported. To call a function just call it in the expression string, as you do in Delphi.

The dataset fields may be referenced in an expression, as the identifiers. For example:

ADQuery1.Filter := 'upper(name) like ''bill%''';
ADQuery1.Filtered := True;

Or:

ADQuery1.Filter := '(upper(rtrim(name)) like ''bill%'') or (upper(rtrim(name)) like ''john%'')';
ADQuery1.Filtered := True;

If you need to create your own function and register it with FireDAC, see uADStanExprFuncs.pas unit for details.

Note, expression engine supports FireDAC escape sequences.

Using expression for custom purposes

An application may use FireDAC expression evaluator to perform text formula calculations. There are two basic options:

  • use TADDataSet.CreateExpression method to perform calculations on the dataset fields. For example:

var
  oEval: IADStanExpressionEvaluator;
...
oEval := ADMemTable1.CreateExpresison('(sal + comm) * tax / 100');
Label1.Caption := oEval.Evaluate;
...
ADMemTable1.Next;
oEval.DataSource.Position := ADMemTable1.GetRow;
Label1.Caption := oEval.Evaluate;
...
oEval := nil;
ADMemTable1.Close;

  • use API to extend the evaluator by custom data source. For example:

uses
  uADStanIntf, uADStanFactory, uADStanExpr, uADStanExprFuncs;

type
  TMyVariable = class (TInterfacedObject, IADStanExpressionDataSource)
  private
    FName: String;
    FpValue: PDouble;
  protected
    function GetVarIndex(const AName: String): Integer;
    function GetVarType(AIndex: Integer): TADDataType;
    function GetVarScope(AIndex: Integer): TADExpressionScopeKind;
    function GetVarData(AIndex: Integer): Variant;
    ...........
  public
    constructor Create(AName: String; var AValue: Double);
  end;

{ TMyVariable }

constructor TMyVariable.Create(AName: String; var AValue: Double);
begin
  inherited Create;
  FName := AName;
  FpValue := @AValue;
end;

function TMyVariable.GetVarIndex(const AName: String): Integer;
begin
  if CompareText(AName, FName) = 0 then
    Result := 0
  else
    Result := -1;
end;

function TMyVariable.GetVarType(AIndex: Integer): TADDataType;
begin
  if AIndex = 0 then
    Result := dtDouble
  else
    Result := dtUnknown;
end;

function TMyVariable.GetVarScope(AIndex: Integer): TADExpressionScopeKind;
begin
  if AIndex = 0 then
    Result := ckConst
  else
    Result := ckUnknown;
end;

function TMyVariable.GetVarData(AIndex: Integer): Variant;
begin
  if AIndex = 0 then
    Result := FpValue^
  else
    Result := Null;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  d: Double;
  oDS: IADStanExpressionDataSource;
  oParser: IADStanExpressionParser;
  oEval: IADStanExpressionEvaluator;
begin
  oDS := TMyVariable.Create('x', d);

  ADCreateInterface(IADStanExpressionParser, oParser);
  oEval := oParser.Prepare(oDS, '(2*x)+cos(sin(90)+10)', [], [poDefaultExpr], '');

  d := 1.2;
  ShowMessage(oEval.Evaluate);

  d := 3.4;
  ShowMessage(oEval.Evaluate);
end;
Example

See FireDAC demos for more details:

  • FireDAC\Samples\Comp Layer\TADQuery\Filter;
  • FireDAC\Samples\DatS Layer\CalcColumnWithFuncs.
What do you think about this topic? Send feedback!


Editing the Data

Editing the Data
FireDAC Topics Send Feedback

A set of articles describing how to use FireDAC to edit the dataset data, post changes to a database and setup the updates posting.

Group

FireDAC

Topics
Topic | Description
Changing DataSet Data | FireDAC supports dataset records editing, including automatic updates posting to a database.
Caching Updates | FireDAC supports deferred updates posting, so called Cached Updates.
Unique Identifying Fields | FireDAC uses unique identifying columns for generating the efficient update and refresh SQL commands.
Auto-Incremental Fields | FireDAC supports correct appending of the new records with auto-incrementing fields and automatic refreshing of the database assigned values.
Update Command Generation | FireDAC will automatically generate SQL commands to post changes from a dataset to a database, using the obtained meta information for the columns and update table.
Overriding Posting Updates | FireDAC allows to selectively override the automatically generated update SQL commands by using TADUpdateSQL or completely override the posting algorithm by using OnUpdateRecord event handler.
Specifying Default Values | FireDAC allows to specify default field values for new records.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Changing DataSet Data

Changing DataSet Data
Editing the Data See Also Send Feedback

FireDAC supports dataset records editing, including automatic updates posting to a database.

Group

Editing the Data

Links
Editing the Data, See Also
Description
General

FireDAC datasets, including TADQuery, TADTable, TADStoredProc, TADMemTable, are supporting inserting, editing and deleting of records, using the standard TDataSet methods. By default editing and posting updates are enabled for FireDAC datasets.

Controlling editing

A dataset editing is enabled, when UpdateOptions.ReadOnly is False. The particular operations are enabled:

  • appending when UpdateOptions.EnableInsert is True:

ADQuery1.Append;
ADQuery1.FieldsByName('id').AsInteger := 100;
ADQuery1.FieldsByName('name').AsString := 'Audi A6';
ADQuery1.Post;

  • editing when UpdateOptions.EnableUpdate is True:

ADQuery1.Edit;
ADQuery1.FieldsByName('name').AsString := 'Audi A6 Avant';
ADQuery1.Post;

  • deleting when UpdateOptions.EnableDelete is True:

ADQuery1.Delete;

To avoid "Field value is required" at Post call, set UpdateOptions.CheckRequired to False (default is True).

Posting updates

To post updates to a database, FireDAC will automatically generate updating SQL commands, when the original SQL query conforms to:

  • The command must be SELECT.
  • The first table in FROM clause must preserve primary key (PK).
  • The PK fields must be in SELECT list.
  • The SELECT must be without DISTINCT, GROUP BY, UNION, etc phrases. That is rather a logical rule, than "a must".

Also the correct metadata must be provided, including unique identifying fields. Most simple to enable the automatic updates posting for TADQuery is to set UpdateOptions.RequestLive to True (default is True). There is no automated possibility to check that a query is updatable, the programmer must evaluate that himself.

If query does not conform to above rules, or posting must be overridden by the application, then you can use TADUpdateSQL component or OnUpdateRecord event handler.

The updates may be posted to a database immediately on Post or Delete methods call, or may be cached and posted later. The deferred updates posting may be used together with offline connections.

See Also

Unique Identifying Fields, Update Command Generation, Overriding Posting Updates

What do you think about this topic? Send feedback!


Caching Updates

Caching Updates
Example Editing the Data See Also Send Feedback

FireDAC supports deferred updates posting, so called Cached Updates.

Group

Editing the Data

Links
Example, Editing the Data, See Also
Description
General

The Cached Updates mode allows to defer posting updates to a database to a later time, than Post / Delete methods are called. That allows to post multiple updates in a single batch, optionally enclosed into a transaction.

To set a dataset to the Cached Updates mode set CachedUpdates property to True. Then the dataset will track all changes made after last setting to True or CancelUpdates / CommitUpdates calls. Those changes made up the change journal, where all changes are ordered by the time when a change was made. FireDAC does not track multiple versions of the same record. The last change overrides previous one and moves the record to the end of the change order.

FireDAC supports Decentralized and Centralized Cached Updates modes:

  • Decentralized Cached Updates mode, when each dataset tracks the changes independently on others. This is classical and default mode.
  • Centralized Cached Updates mode, when few datasets share a single change log and changes are in historical order.

Centralized cached updates

When application needs to log and apply multiple dataset changes in a chronological order, then Centralized Cached Updates may be used. For that a single TADSchemaAdapter instance must be assigned to few datasets SchemaAdapter property. There TADSchemaAdapter serves as a central storage for the rows and their changes for few datasets.

At first, Centralized Cached Updates is useful in master-detail relationships, where a master dataset propagates changes to the cascading detail datasets, including auto-incrementing field values. To enable propagation for a detail dataset it FetchOptions.DetailCascade must be set to True. This allows:

  • synchronized master-detail changes, so the changes of master and detail datasets will be recorded and applied in the chronological order. Eg, first inserted master record, then inserted corresponding detail records;
  • propagation of a master identity column value to a detail dataset. Eg, when detail dataset is linked to identity column of master dataset and on applying updates the corresponding detail records must get actual master identity column value;
  • cascading deletion of the detail records when a master record is deleted. Eg, when master record is deleted then all corresponding detail records will be deleted too and that will be recorded in the change log;
  • cascading propagation of the master field changes to a detail dataset.

Propagation works when the following conditions are met:

  • datasets are in master-detail relationship;
  • range based M/D is used;
  • master dataset is an FireDAC dataset (TADQuery, TADStoredProc, TADMemTable);
  • detail dataset is not TADTable in Live Data Window Mode.

To enable Centralized Cached Updates with propagation, perform the following steps (expected that range based M/D is setup and CachedUpdates property is True):

  • Drop TADSchemaAdapter on a form.
  • Set master dataset SchemaAdapter property to a TADSchemaAdapter.
  • Set detail dataset SchemaAdapter property to a TADSchemaAdapter.
  • Set detail dataset FetchOptions.DetailCascade to True.

In the same time this enables an in-memory referential constraint for a detail dataset. This is similar to a SQL command:

ALTER TABLE <detail> ADD CONSTRAINT
FOREIGN KEY (<detail fields>)
REFERENCES <master> (<master fields>)
ON DELETE CASCADE
ON UPDATE CASCADE

To apply updates the application should use TADSchemaAdapter.ApplyUpdates method instead of dataset ApplyUpdates. To reconcile errors use TADSchemaAdapter.Reconcile method instead of dataset Reconcile.

See FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\Centralized demo application for more details.

Tracking updates

When your application is working in cached updates mode, you can track the changes and optionally revert the changes for each dataset. To track changes, use the properties:

  • UpdatesPending - returns True, if change log is not empty;
  • ChangeCount - returns the total number of changes;
  • UpdateStatus - returns the change kind for the current record;
  • FilterChanges - allows to filter records by the modification kinds.

To revert existing changes, use the properties and methods:

  • SavePoint - set/get the current change log state;
  • RevertRecord - reverts current record to it previous (original) state;
  • UndoLastChange - jumps to the last modified record and reverts it to it previous (original) state;
  • CancelUpdates - reverts all records in the change log.

For example, to implement simple Undo functionality, you may create an actUndo action and attach the following event handlers:

procedure TForm1.actUndoUpdate(Sender: TObject);
begin
  actUndo.Enabled := ADQuery1.UpdatesPending;
end;

procedure TForm1.actUndoExecute(Sender: TObject);
begin
  ADQuery1.UndoLastChange(True);
end;

For other example, to implement in-memory transaction, with ability to undo group of changes, you may do:

ADQuery1.CachedUpdates := True;
iSavePoint := ADQuery1.SavePoint;
try
  ADQuery1.Append;
  ...
  ADQuery1.Post;
  ADQuery1.Append;
  ...
  ADQuery1.Post;
  ADQuery1.Append;
  ...
  ADQuery1.Post;
except
  ADQuery.SavePoint := iSavePoint;
end;

Note, in cached updates mode the following methods and properties are working with updates journal:

  • Data property includes all records, even deleted, and their changes;
  • Delta property returns deleted, inserted or updated records in updates journal;
  • CopyRecord, CopyDataSet methods create new changes and do not copy change journal;
  • LoadFromStream, LoadFromFile, SaveToStream, SaveToFile load / save data with updates journal.

Note, in cached updates mode some methods or property settings will raise an exception, if there are changes in updates journal. They must be saved then commited or canceled. Those are:

  • Refresh;
  • setting CachedUpdates to False.

Applying updates

To apply updates to a database use the ApplyUpdates method. If some record applying raised an exception, then it will be associated with the record. Note, that ApplyUpdates method:

  • does not raise an exception, instead it returns the number of raised exceptions;
  • does not wrap updates applying into a transaction, an application may do that itself;
  • uses the same updates posting logic as the immediate updates.

After applying updates the changed records still remains in the changes log. To remove them from the changes log and mark as unmodified call the CommitUpdates method. For example:

ADQuery1.CachedUpdates := True;
ADQuery1.Append;
...
ADQuery1.Post;
ADQuery1.Append;
...
ADQuery1.Post;
ADQuery1.Append;
...
ADQuery1.Post;
ADConnection1.StartTransaction;
iErrors := ADQuery1.ApplyUpdates;
if iErrors = 0 then begin
  ADQuery1.CommitUpdates;
  ADConnection1.Commit;
end
else
  ADConnection1.Rollback;

Reviewing errors

If an error happens inside of ApplyUpdates call, then ApplyUpdates records the error into the internal data record structure. And continues to process updates until the errors number will be equal or greater than AMaxErrors. ApplyUpdates does not raise exceptions. To process all erroneous records after ApplyUpdates call, use either reconciling process, either filter erroneous records.

To reconcile records assign OnReconcileError event handler and call the Reconcile method. The OnReconcileError event handler allows to analyze error, read / change the current record field values. On exit it should assign action, which FireDAC code should take on the current record with the error. After the Reconcile method call the ApplyUpdates may be called again to try to post again erroneous record changes.

To filter erroneous records include rtHasErrors into FilterChanges. Then navigate through dataset and read RowError property to get an exception object associated with the current record. For example:

var
  oErr: EADException;
...
if ADQuery1.ApplyUpdate > 0 then begin
  ADQuery1.FilterChanges := [rtModified, rtInserted, rtDeleted, rtHasErrors];
  try
    ADQuery1.First;
    while not ADQuery1.Eof do begin
      oErr := ADQuery1.RowError;
      if oErr <> nil then begin
        // process exception object
        ...
      end;
      ADQuery1.Next;
    end;
  finally
    ADQuery1.FilterChanges := [rtUnmodified, rtModified, rtInserted];
  end;
end;
See Also

Update Command Generation, Overriding Posting Updates

Example

See the demos for more details:

- FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates

- FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord

- FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\Centralized

What do you think about this topic? Send feedback!


Unique Identifying Fields

Unique Identifying Fields
Editing the Data See Also Send Feedback

FireDAC uses unique identifying columns for generating the efficient update and refresh SQL commands.

Group

Editing the Data

Links
Editing the Data, See Also
Description
General

The set of columns unique identifying each dataset record are the unique identifying columns. When a dataset is a single table SELECT, then the set is a FROM table primary key. Often an auto-incrementing field is a table primary key.

Usage

Unique identifying fields are used to build WHERE clause for:

  • posting updates (Edit/Post) and deletes (Delete) from a dataset, when UpdateOptions.UpdateMode is upWhereKeyOnly or upWhereChanged;
  • refreshing the current dataset record (RefreshRecord);
  • selecting deferred BLOB (FetchBlobs) values and nested datasets (FetchDetails).

Providing

The TADQuery, TADTable, TADMemTable, TADCommand automatically retrieve the unique identifying columns (mkPrimaryKeyFields) for the main (first) table in the SELECT ... FROM ... statements, when fiMeta is included into FetchOptions.Items. Note:

  • mkPrimaryKeyFields querying may be time consuming;
  • application may need to explicitly specify unique identifying columns, when FireDAC fails to determine them correctly.

To explicitly specify columns, exclude fiMeta from FetchOptions.Items, and use one of the options:

  • set UpdateOptions.KeyFields, as a ';' separated list of the column names;
  • or include pfInKey into corresponding TField.ProviderFlags property.

Note, when application is using persistent fields, then creating them the ProviderFlags will be set correctly. After that automatic retrieval will be ignored. Update ProviderFlags to adjust column list. Also, if the primary key consists of few fields then all of them must be included into persistent fields.

Row identifying columns

Alternatively a row identifying column may be included into SELECT list. When FireDAC founds such column, then it will not retrieve mkPrimaryKeyFields metadata and will use this column. The supported DBMS's:

DBMS | The row identifying column
Firebird | DB_KEY
Interbase | DB_KEY
Oracle | ROWID
PostgreSQL | OID. Note, the table must be created with OID's.
SQLite | ROWID

For example on Oracle:

SELECT T.*, ROWID FROM Orders T
See Also

Update Command Generation, Auto-Incremental Fields, KeyFields, Items, UpdateMode, ProviderFlags

What do you think about this topic? Send feedback!


Auto-Incremental Fields

Auto-Incremental Fields
Editing the Data See Also Send Feedback

FireDAC supports correct appending of the new records with auto-incrementing fields and automatic refreshing of the database assigned values.

Group

Editing the Data

Links
Editing the Data, See Also
Description
General

FireDAC allows to insert a new record with an auto-incrementing column and get back a new value of this column. That works as for immediate updates, as for cached updates. Depending on a DBMS, the auto-incrementing fields may be implemented either using a special IDENTITY (or similar) column data type, either using a generator (or a sequence) and a table trigger:

DBMS
Auto-incrementing column implementation
Recognizing
Advantage Database
AUTOINC data type
Automatic as auto-incrementing data type.
Firebird / Interbase
  • Generator and BEFORE INSERT trigger
  • Firebird 3.0: GENERATED BY DEFAULT AS IDENTITY
Automatic and manual specifying. See below.
IBM DB2
GENERATED AS IDENTITY data type
Automatic as auto-incrementing data type.
Informix
SERIAL data type
Automatic as auto-incrementing data type.
MS Access
COUNTER data type
Automatic as auto-incrementing data type.
MS SQL Server
IDENTITY data type
Automatic as auto-incrementing data type.
MySQL
AUTO_INCREMENT data type
Automatic as auto-incrementing data type.
Oracle
Sequence and BEFORE INSERT FOR EACH ROW trigger
Manual specifying. See below.
PostgreSQL
SERIAL data type
Automatic as auto-incrementing data type.
SQL Anywhere
IDENTITY data type
Automatic as auto-incrementing data type.
SQLite
INTEGER PRIMARY KEY AUTOINCREMENT data type
Automatic as auto-incrementing data type.
Sybase Adaptive Server Enterprise
IDENTITY data type
Automatic as auto-incrementing data type.

Automatic recognition

FireDAC automatically recognizes a column of an auto-incrementing data type, and defines it as dtIntXxx, [caAutoInc, caReadOnly, caAllowNull]. This leads to TField setup:

  • TField.DataType = ftAutoInc (TADAutoIncField) when dtInt32 or dtUInt32; otherwise one of the numeric ftXxxx data types;
  • TField.Required = False;
  • TField.ReadOnly = True;
  • TField.ProviderFlags = [pfInWhere], or [pfInWhere, pfInKey] when the column is part of a primary key.

FireDAC automatically recognizes limited set of the Firebird auto-incrementing columns, and defines them as dtIntXxx, [caAutoInc, caAllowNull] when:

  • extended metadata is enabled;
  • a table has a BEFORE INSERT trigger;
  • the trigger depends on a single column and a single generator. This column is recognizing as auto-incrementing.

Manual specifying

For Oracle, other Firebird / Interbase cases, and other columns the auto-incrementing mode may be specified by programmer, using one of the options:

  • set UpdateOptions.AutoIncFields to the list of the auto-incrementing column names. When a column is of dtInt32 / dtUInt32 data type, then TADAutoIncField field will be created.
  • create an TADAutoIncField field at design or run time. The column must be of ftAutoInc / ftInteger / ftLongWord field type. For other data types consider to use data type mapping to TargetDataType = dtInt32.
  • set TField.AutoGenerateValue to arAutoInc for an auto-incrementing field. This method does not create TADAutoIncField, works with any field type, and may require additional field properties setup, eg setting ProviderFlags, Required and ReadOnly.

All these methods at end leads to TField.AutoGenerateValue = arAutoInc.

Client auto-incrementing

By default FireDAC uses the client side auto-incrementing for the auto-incrementing columns. After calling dataset Insert / Append method, the auto-incrementing column will get -1 value. With each next method call, the value will be incremented with the -1 (negative) step. That was made to distinguish the client assigned values and the DBMS assigned values.

When UpdateOptions.RefreshMode <> rmManual, then after posting a new record the auto-incrementing column will get an actual positive value.

The TADAutoIncField properties allows to adjust the client side auto-incrementing:

  • ClientAutoIncrement to enable or disable;
  • AutoIncrementSeed to specify an initial value;
  • AutoIncrementStep to specify a step.

Client sequence filling

When a DBMS supports sequences or generators (here they are synonyms), then FireDAC may fill an auto-incrementing column from a sequence on a client. This is alternative to client-side auto-incrementing.

The auto-incrementing column must have pfInUpdate in TField.ProviderFlags and one of the UpdateOptions.FetchGeneratorsPoint values:

  • gpImmediate - a next value is fetched from a generator in TDataSet.Insert / Append method. And the value is already accessible in TDataSet.OnNewRecord event handler. When the TDataSet.Cancel method is called, then the value is lost.
  • gpDeferred - a next value is fetched in TDataSet.Post method.

Set the UpdateOptions.GeneratorName or TADAutoIncField.GeneratorName to a generator name, which will be used to get next sequence value.

Universal setup

The following auto-incrementing column setup will work with any DBMS, including supporting native auto-incremental columns, and using sequences and triggers:

  • UpdateOptions.FetchGeneratorsPoint = gpNone. The client sequence filling is disabled.
  • not (pfInUpdate in TField.ProviderFlags). The column is excluded from INSERT / UPDATE clause.
  • fiMeta in FetchOptions.Items. The column, when it is possible is recognized as auto-incremental.

For Oracle, Firebird and Interbase is required to manually specify auto-incremental columns. For databases supporting native auto-incremental data types, no additional setup is required. But specifying will work in both cases.

Master-detail handling

When master and detail datasets are linked by an auto-incrementing master column and cached updates is enabled, then consider to use Centralized Cached Updates mode with propagation of changes from master to detail datasets.

See Also

Unique Identifying Fields, Update Command Generation, Caching Updates, FetchGeneratorsPoint, GeneratorName, AutoIncFields, TADAutoIncField

What do you think about this topic? Send feedback!


Update Command Generation

Update Command Generation
Editing the Data See Also Send Feedback

FireDAC will automatically generate SQL commands to post changes from a dataset to a database, using the obtained meta information for the columns and update table.

Group

Editing the Data

Links
Editing the Data, See Also
Description
General

When the database application calls dataset methods:

  • Insert / Edit / Post / Delete - in immediate updates mode,
  • ApplyUpdates - in cached updates mode,

then updating data SQL commands will be automatically generated by FireDAC. The FireDAC SQL commands generator is aware of the database identity fields, sequences, triggers, special data types (Oracle BLOB / CLOB / BFILE), pessimistic locking commands, etc. And generates a most efficient SQL command, depending on the connected DBMS. This reduces the number of cases where a developer must use the hand made SQL commands. FireDAC does not force a developer to use TADUpdateSQL, which may be used to override the update SQL commands.

For example, when posting a new record to an Oracle table, where ID field is filled by a trigger from a sequence and IMAGE is of BLOB type, FireDAC will generate the SQL command:

INSERT INTO OracleTab (NAME, DT, IMAGE)
VALUES (:NEW_NAME, :NEW_DT, EMPTY_BLOB())
RETURNING :NEW_ID, :NEW_IMAGE

1. FROM, INTO and UPDATE phrases

FireDAC will use the main (first) table in the SELECT ... FROM ... statement, as an updating table name. Also, this table will be used to retrieve mkPrimaryKeyFields metadata. Use UpdateOptions.UpdateTableName to explicitly specify the updating table. This is required, when:

  • a dataset is TADStoredProc;
  • TADQuery has not a SELECT query;
  • FireDAC fails to get the updating table name correctly from the query;
  • application needs to redirect updates to a specific table.

2. WHERE phrase

The UpdateOptions.UpdateMode controls the WHERE clause generation for posting updates and deletions. The default value upWhereKeyOnly uses in WHERE phrase only the unique identifying columns and provides most efficient and safe way to locate the updating row. When no unique identifying columns is specified and no row identifying column is found, FireDAC will switch UpdateOptions.UpdateMode to upWhereAll. And some fields included into WHERE clause may lead to no rows found:

  • DOUBLE, FLOAT, TIME, DATETIME fields and other floating point fields may lead to a precision lost at value comparison;
  • textual fields may have an invalid encoding or extra spaces leading to unsuccessful comparision;
  • other similar failures may happen.

In such cases application gets an exception:

[FireDAC][DApt]-400. Update command updated [0] instead of [1] record.

Similarly, when columns in WHERE are not unique identifying a row, more than single record may be updated. Then an exception is:

[FireDAC][DApt]-400. Update command updated [4] instead of [1] record.

To resolve these issues consider to:

  • provide correct unique identifying columns;
  • disable some fields WHERE usage by excluding pfInWhere from corresponding TField.ProviderFlags property;
  • suppress these errors by setting UpdateOptions.CountUpdatedRecords to False.

Note, to avoid the above issues with a SQL Server table, which also has triggers, the triggers should have SET NOCOUNT ON specified at the beginning. If that is not possible, then set UpdateOptions.CountUpdatedRecords to False.

3. SET and VALUES phrases

The UpdateOptions.UpdateChangedFields controls the fields to include into UPDATE SET ... or INSERT VALUES ... phrases. Setting to True will include only changed fields, what helps:

  • to minimize the traffic at updates posting;
  • to avoid not-needed constraints validations;
  • to avoid extra trigger firings;
  • to minimize redo log generation.

Setting to False will include all fields, what helps:

  • to reuse the same generated statement for posting all updates and minimize DBMS work to prepare a statements.

To disable updates to some columns exclude pfInUpdate from corresponding TField.ProviderFlags property.

4. RETURNING and additional SELECT's

The UpdateOptions.RefreshMode = rmOnDemand controls automatic refreshing of the column values, which may be changed by the DBMS after inserting or updating a record. The columns, which may require refreshing after record inserting are:

  • auto-incrementing columns;
  • database calculated columns;
  • columns with default values;
  • row identifying columns;
  • timestamp columns;
  • columns updated by a trigger.

The columns, which may require refreshing after record updating are:

  • database calculated columns;
  • timestamp columns;
  • columns updated by a trigger.

Depending on a DBMS features, the additional phrases / commands will be generated, returning the refreshing column values:

  • Oracle, Firebird, PostgreSQL - RETURNING phrase;
  • DB2 - SELECT ... FROM FINAL TABLE phrase;
  • SQL Server, SQL Anywhere, SQLite - SQL batch with additional SELECT command;
  • otherwise - an additional SELECT command.

5. Updates command caching

For some DBMS, environment and task the UpdateChangedFields = False may give a better performance. And combined with few other settings as a UpdateOptions.FastUpdates property, it allows to get even better performance at updates posting, by avoiding the additional queries and enabling to cache the generated update commands.

The FastUpdates = True is equivalent to:

  • UpdateChangedFields = False;
  • UpdateMode = upWhereKeyOnly;
  • LockMode = lmNone;
  • RefreshMode = rmManual;
  • CheckRequired = False.
See Also

Editing the Data, TADUpdateOptions

What do you think about this topic? Send feedback!


Overriding Posting Updates

Overriding Posting Updates
Editing the Data See Also Send Feedback

FireDAC allows to selectively override the automatically generated update SQL commands by using TADUpdateSQL or completely override the posting algorithm by using OnUpdateRecord event handler.

Group

Editing the Data

Links
Editing the Data, See Also
Description
General

Although FireDAC is able to automatically generate updating SQL commands, in some cases this can not be done correctly:

Original SQL command
Generated SQL command possible issues
Possible actions
SELECT with JOIN's
Includes columns from the joined tables.
  • Exclude non-base table column from update commands, by excluding pfInUpdate from TField.ProviderFlags and setting TField.ReadOnly to True;
  • Set UpdateOptions.UpdateNonBaseFields to False (default value).
SELECT with grouping operations
Updates more than one record.
  • Redirect updates to a correct table by setting UpdateOptions.UpdateTableName;
  • Disable updated record count checking, by setting UpdateOptions.CountUpdatedRecords to False;
  • Use custom SQL commands.
SELECT with common table expressions
Fails to get updating table name.
  • Redirect updates to a correct table by setting UpdateOptions.UpdateTableName;
  • Use custom SQL commands.
SELECT with aliased columns and expressions
Includes incorrect column names.
  • Optionally, exclude non-base table column from update commands, by excluding pfInUpdate from TField.ProviderFlags and setting TField.ReadOnly to True.
  • Optionally, specify base column name, by specifying TField.Origin.
Stored procedure call
All above SELECT issues.
Cursor expressions and variable
All above SELECT issues.
Other non-SELECT commands
All above SELECT issues.

Note, the above is not a must, instead check first, what really happens.

FireDAC can detect a base table and column names for an aliased or joined columns:

DBMS | Setup
Advantage Database | Is not supported.
Firebird / Interbase | Required ExtendedMetadata=True connection definition parameter.
IBM DB2 | Automatically.
MS Access | Automatically.
MS SQL Server | Required ExtendedMetadata=True connection definition parameter.
MySQL | Automatically.
Oracle | Is not supported.
PostgreSQL | Required ExtendedMetadata=True connection definition parameter.
SQL Anywhere | Automatically.
SQLite | Automatically.

Specifying update table name

In some cases application needs to specify alternative DB table name, to which the updates will be posted. To do that set UpdateOptions.UpdateTableName to a required table name.

Specifying update column names and modes

In some cases application needs to exclude columns from an updating SQL command. To do that exclude pfInUpdate from TField.ProviderFlags. And set TField.ReadOnly to prohibit field value modification.

To specify alternative DB column name, set TField.Origin to a required value.

Using TADUpdateSQL

The TADUpdateSQL component allows to:

  • selectively override the update SQL commands generated by FireDAC;
  • enable updates posting, when FireDAC cannot generate the update commands, like a complex SELECT's or stored procedure calls.

In general, the TADUpdateSQL is a collection of SQL update commands, each of them handles specific task, like a inserting a new record into database. The TADUpdateSQL may be setup at design-time and / or at run-time.

Setting at design time

To setup at design-time, drop TADUpdateSQL on a form. Set dataset UpdateObject property to point to this component. Then double click on TADUpdateSQL to invoke the FireDAC Update SQL Editor:

The editor will automatically get the updating table name from the associated dataset and setup columns according to the dataset columns TField.ProviderFlags and TField.AutoGenerateValue.

To change setup, use:

  • the "Table Name" combo to specify updating table name;
  • the "Key Fields" list box to specify unique identifying columns (corresponds to pfInKey in ProviderFlags);
  • the "Updating Fields" list box to specify columns to include into update (corresponds to pfInUpdate in ProviderFlags);
  • the "Refreshing Fields" list box to specify columns those values must be refreshed after posting update (corresponds to AutoGenerateValue <> arNone).

The "Describe From DB" button provides setup for the specified table, by retrieving its metadata from the database. The "Revert To Defaults" button provides setup using the dataset field properties. The additional options may be specified on the "Options" page.

When setup is finished press the "Generate SQL" button to generate full set of the updating SQL's. Also, the editor may be used to manually edit update SQL commands on the "SQL Commands" page.

Press OK to store changes in the TADUpdateSQL.

Settings at run time

To specify the TADUpdateSQL SQL commands at run-time, the application should use XxxxSQL properties. To reference in a SQL to a specific column value use the parameter markers:

  • new column value - ':NEW_<column name>';
  • old column value - ':OLD_<column name>';
  • current column value - ':<column name>'.

These parameter values will be assigned automatically by FireDAC. Do not assign a value to them, because their values will be overridden. FireDAC will ignore parameters with other names.

The command parameters and command macros may be setup only at run-time. For that you have to use TADUpdateSQL.Commands property, which returns references to the TADCommand objects. For example:

ADUpdateSQL1.InsertSQL.Text := 'insert into &tab (id, name) values (:new_id, :new_name)';
ADUpdateSQL1.Commands[arInsert].Macros[0].AsRaw := 'Orders';

Using OnUpdateRecord

This event allows to completely override posting updates from a dataset. The event handler code can read the dataset fields properties:

  • OldValue - returns the original field value, as it was fetched or as it is after last CommitUpdates / CancelUpdates call;
  • CurValue / Value - returns the current field value.

Also, you can combine TADUpdateSQL's and OnUpdateRecord approaches, to enable semi-automatic updates posting to different tables or databases.

For details see OnUpdateRecord event description and the FireDAC demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main
See Also

Update Command Generation, TADUpdateSQL, OnUpdateRecord

What do you think about this topic? Send feedback!


Specifying Default Values

Specifying Default Values
Editing the Data See Also Send Feedback

FireDAC allows to specify default field values for new records.

Group

Editing the Data

Links
Editing the Data, See Also
Description
Using OnNewRecord event handler

The standard way in Delphi to assign the default values to the new record fields is to use OnNewRecord event handler. This event handler fires after the auto-incremental and detail record linking fields get their values and automatic default values are assigned. The event handler may override the above values or to assign initial value using some complex custom logic.

The event handler may be assigned to the dataset at any time.

Specifying default expression value

FireDAC allows to assign an expression to the TField.DefaultExpression property. This expression will be evaluated one time as part of the Insert / Append method call and assigned as an initial value to the corresponding field. Later this value may be overridden by the application. Note, when a field has TField.FieldKind = fkInternalCalc, then the DefaultExpression will be used to calculate the field value.

When a value to a field DefaultExpression assigned when a dataset is closed, then it will be actualized automatically. When a dataset is opened, then call UpdateAttributes method to actualize changes. For example:

ADQuery1.Open;
...
ADQuery1.FieldByName('ObjGUID').DefaultExpression := 'NEWGUID()';
ADQuery1.UpdateAttributes;

FireDAC does not automatically fetch column default expression from the database dictionary. The most simple way to assign an expression is to use Fields Editor at design-time:

Refreshing default value

FireDAC automatically recognizes that a result set column has a default value for the following DBMS:

DBMS | Description
Interbase / Firebird | fiMeta is in FetchOptions.Items and ExtendedMetadata = True
MySQL |
PostgreSQL | fiMeta is in FetchOptions.Items and ExtendedMetadata = True

When FireDAC recognizes a column with a default value then TField.AutoGenerateValue is set to arDefault. If that does not happen, then AutoGenerateValue may be set by hands. If a corresponding field value was not assigned at adding a new record, then FireDAC automatically refreshes the field value after posting a new record.

See Also

Writing Expressions, Calculated and Aggregated Fields

What do you think about this topic? Send feedback!


Working with Metadata

Working with Metadata
FireDAC Topics Send Feedback

The set of articles describing how to work with database meta data in FireDAC. The metadata contains information about database structure.

Group

FireDAC

Topics
Topic | Description
Querying Metadata | FireDAC offers TADMetaInfoQuery components and some TADConnection methods to retrieve metadata from a database.
Extended Metadata | Depending on a DBMS the metadata may include advanced data type recognition for the columns.
Metadata Structure | The chapter describes the structures of the metadata returned by FireDAC TADMetaInfoQuery.
Object Names | FireDAC supports quoted object names and full object names. The chapter describes how to work with object names.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Querying Metadata

Querying Metadata
Working with Metadata See Also Send Feedback

FireDAC offers TADMetaInfoQuery components and some TADConnection methods to retrieve metadata from a database.

Group

Working with Metadata

Links
Working with Metadata, See Also
Description

Using TADConnection

TADConnection offers few GetXxxxNames simple to use methods returning the database object names list:

  • GetCatalogNames - the catalog list;
  • GetSchemaNames - the schema list;
  • GetTableNames - the table and view list;
  • GetFieldNames - the table field list;
  • GetKeyFieldNames - the table primary key list;
  • GetGeneratorNames - the generator / sequence list;
  • GetPackageNames - the package list;
  • GetStoredProcNames - the stored procedure list.

These method are useful when:

  • application needs object names;
  • application does not need additional info about these objects.

For example, GetTableNames method retrieves the table, view and synonym names from the current database and schema. To call it use the code:

ADConnection1.GetTableNames('Northwind', 'dbo', '', Memo1.Lines);

Use the ACatalogName and / or ASchemaName arguments to restrict the returned list to the specified catalog and / or schema. If they are not specified, then all "visible" objects will be returned or the objects in the current database / schema. That depends on the DBMS. Note, some DBMS (MS Access) may return error if the schema / catalog is specified and it is not supported by the DBMS.

Additionally, the application may restrict object list using AScopes argument, basing on the object scope. And the APattern argument, which is the LIKE search mask, which will be applied to object names.

The similar method you can found at TADCustomManager class.

See the FireDAC demo for more details: FireDAC\Samples\Comp Layer\TADConnection\GetFieldNames.

Using TADMetaInfoQuery

The TADMetaInfoQuery is the dataset component allowing to query and browse the metadata lists. To do that set the Connection, MetaInfoKind and optionally the CatalogName, SchemaName, BaseObjectName, ObjectName properties, and open the dataset. To get the tables list use the code:

ADMetaInfoQuery1.Connection := ADConnection1;
ADMetaInfoQuery1.MetaInfoKind := mkTables;
ADMetaInfoQuery1.Open;

For the dataset structure description read the "Metadata Structure" chapter. If a DBMS does not support some particular metadata kind, for example SQL Server does not support mkGenerators, then empty dataset will be returned. The metadata dataset is read-only and cannot be edited.

Metadata caching

The fetched metadata is cached by FireDAC per each connection. That is controlled by including fiMeta into FetchOptions.Cache.

Excluding fiMeta from FetchOptions.Cache does not invalidate the metadata cache. All cached metadata remains in cache until it next usage. To refresh the metadata cache for a specified object or in full use the TADConnection.RefreshMetadataCache.

Current catalog and schema

To get current catalog and schema name, use TADConnection.ConnectionIntf.CurrentCatalog and CurrentSchema. To change current catalog or schema, assign new value to these properties.

MetaCurCatalog and MetaCurSchema allows to override the information returned by the database session. For some databases it may be required to use these parameters to specify correct values, because API returns incorrect ones.

See Also

Metadata Structure, Unique Identifying Fields, TADConnection, TADMetaInfoQuery

What do you think about this topic? Send feedback!


Extended Metadata

Extended Metadata
Working with Metadata See Also Send Feedback

Depending on a DBMS the metadata may include advanced data type recognition for the columns.

Group

Working with Metadata

Links
Working with Metadata, See Also
Description

To enable this feature the connection definition parameter ExtendedMetadata=True must be added. And the DBMS's:

DBMS
Description
Firebird, Interbase
  • Columns with domain %BOOL% are recognized as ftBoolean;
  • Columns with domain %GUID% are recognized as ftGUID;
  • When table has a BEFORE INSERT trigger, which depends on a single sequence and a single table column, then this column is recognized as ftAutoInc;
  • Columns GENERATED BY DEFAULT AS IDENTITY are recognized as ftAutoInc;
  • Column COMPUTED BY are recognized as TField.AutoGenerateValue = arDefault.
PostgreSQL
  • Origin table and column name for each item in select list;
  • Columns optionality;
  • Columns updateability;
  • Columns with domain LO, LARGEOBJECT or BLOB are recognized as ftOraBlob (BLOB handled by the reference);
  • Columns with DEFAULT NEXTVAL('xxx') are recognized as ftAutoInc;
  • Columns with other default values are recognized as [caDefault];
  • Columns with system OID are recognized as [caROWID].
SQL Server
  • Origin table and column name for each item in select list.

Extended metadata recognition is supported only for the dataset columns and not for the mkTableFields metadata request.

Note, ExtendedMetadata=True executes additional queries. That may decrease application performance.

See Also

Overriding Posting Updates, Auto-Incremental Fields, Database Connectivity

What do you think about this topic? Send feedback!


Metadata Structure

Metadata Structure
Working with Metadata See Also Send Feedback

The chapter describes the structures of the metadata returned by FireDAC TADMetaInfoQuery.

Group

Working with Metadata

Links
Working with Metadata, See Also
Description
The catalog list (mkCatalogs)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.

The schema list (mkSchemas)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.

The table list (mkTables)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.
4 | TABLE_NAME | dtWideString | Table name.
5 | TABLE_TYPE | dtInt32 | Table type. Cast value to uADPhysIntf.TADPhysTableKind.
6 | TABLE_SCOPE | dtInt32 | Table scope. Cast value to uADPhysIntf.TADPhysObjectScope.

The table field list (mkTableFields)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.
4 | TABLE_NAME | dtWideString | Table name.
5 | COLUMN_NAME | dtWideString | Column name.
6 | COLUMN_POSITION | dtInt32 | Column position.
7 | COLUMN_DATATYPE | dtInt32 | Column data type. Cast value to uADStanIntf.TADDataType.
8 | COLUMN_TYPENAME | dtWideString | DBMS native column type name.
9 | COLUMN_ATTRIBUTES | dtUInt32 | Column attributes. Cast value to uADStanIntf.TADDataAttributes.
10 | COLUMN_PRECISION | dtInt32 | Numeric and date/time column precision.
11 | COLUMN_SCALE | dtInt32 | Numeric and date/time column scale.
12 | COLUMN_LENGTH | dtInt32 | Character and byte string column length.

Note, to cast COLUMN_ATTRIBUTES column value to TADDataAttributes use the code:

var
  i: Integer;
...
i := ADMetaInfoQuery1.FieldByName('COLUMN_ATTRIBUTES').AsInteger;
eAttrs := TADDataAttributes(Pointer(@i)^);

The table indexes (mkIndexes) and primary key list (mkPrimaryKey)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.
4 | TABLE_NAME | dtWideString | Table name.
5 | INDEX_NAME | dtWideString | Index name.
6 | PKEY_NAME | dtWideString | Primary key constraint name.
7 | INDEX_TYPE | dtInt32 | Index type. Cast value to uADPhysIntf.TADPhysIndexKind.

The table index fields (mkIndexFields) and primary key fields list (mkPrimaryKeyFields)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.
4 | TABLE_NAME | dtWideString | Table name.
5 | INDEX_NAME | dtWideString | Index name.
6 | COLUMN_NAME | dtWideString | Indexed column name.
7 | COLUMN_POSITION | dtInt32 | Column position in the index.
8 | SORT_ORDER | dtWideString | Column sort order. 'A' - ascending. 'D' - descending.
9 | FILTER | dtWideString | Optional column filter expression.

The table foreign key list (mkForeignKeys)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.
4 | TABLE_NAME | dtWideString | Table name.
5 | FKEY_NAME | dtWideString | Foreign key constraint name.
6 | PKEY_CATALOG_NAME | dtWideString | Referenced table catalog name.
7 | PKEY_SCHEMA_NAME | dtWideString | Referenced table schema name.
8 | PKEY_TABLE_NAME | dtWideString | Referenced table name.
9 | DELETE_RULE | dtInt32 | Foreign key delete rule. Cast value to uADPhysIntf.TADPhysCascadeRuleKind.
10 | UPDATE_RULE | dtInt32 | Foreign key update rule. Cast value to uADPhysIntf.TADPhysCascadeRuleKind.

The table foreign key fields list (mkForeignKeyFields)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.
4 | TABLE_NAME | dtWideString | Table name.
5 | FKEY_NAME | dtWideString | Foreign key constraint name.
6 | COLUMN_NAME | dtWideString | Column name.
7 | PKEY_COLUMN_NAME | dtWideString | Referenced table column name.
8 | COLUMN_POSITION | dtInt32 | Column position in constraint.

The packages list (mkPackages)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.
4 | PACKAGE_NAME | dtWideString | Package name.
5 | PACKAGE_SCOPE | dtInt32 | Package scope. Cast value to uADPhysIntf.TADPhysObjectScope.

The stored procedures list (mkProcs)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.
4 | PACK_NAME | dtWideString | Optional package name.
5 | PROC_NAME | dtWideString | Procedure name.
6 | OVERLOAD | dtInt32 | Overloaded procedure number.
7 | PROC_TYPE | dtInt32 | Procedure type. Cast value to uADPhysIntf.TADPhysProcedureKind.
8 | PROC_SCOPE | dtInt32 | Procedure scope. Cast value to uADPhysIntf.TADPhysObjectScope.
9 | IN_PARAMS | dtInt32 | Number of input parameters.
10 | OUT_PARAMS | dtInt32 | Number of output parameters.

The stored procedure arguments list (mkProcArgs)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtAnsiString | Catalog name.
3 | SCHEMA_NAME | dtAnsiString | Schema name.
4 | PACK_NAME | dtAnsiString | Optional package name.
5 | PROC_NAME | dtAnsiString | Procedure name.
6 | OVERLOAD | dtInt32 | Overloaded procedure number.
7 | PARAM_NAME | dtAnsiString | Parameter name.
8 | PARAM_POSITION | dtInt32 | Parameter position.
9 | PARAM_TYPE | dtInt32 | Parameter type. Cast value to DB.TParamType.
10 | PARAM_DATATYPE | dtInt32 | Parameter data type. Cast value to uADStanIntf.TADDataType.
11 | PARAM_TYPENAME | dtAnsiString | DBMS native parameter data type name.
12 | PARAM_ATTRIBUTES | dtUInt32 | Parameter attributes. Cast value to uADStanIntf.TADDataAttributes.
13 | PARAM_PRECISION | dtInt32 | Numeric and date/time parameter precision.
14 | PARAM_SCALE | dtInt32 | Numeric and date/time parameter scale.
15 | PARAM_LENGTH | dtInt32 | Character and byte string parameter length.

The generators / sequences list (mkGenerators)
# | Column name | Data type | Description
1 | RECNO | dtInt32 |
2 | CATALOG_NAME | dtWideString | Catalog name.
3 | SCHEMA_NAME | dtWideString | Schema name.
4 | GENERATOR_NAME | dtWideString | Generator / sequence name.
5 | GENERATOR_SCOPE | dtInt32 | Generator / sequence scope. Cast value to uADPhysIntf.TADPhysObjectScope.
See Also

Querying Metadata

What do you think about this topic? Send feedback!


Object Names

Object Names
Working with Metadata See Also Send Feedback

FireDAC supports quoted object names and full object names. The chapter describes how to work with object names.

Group

Working with Metadata

Links
Working with Metadata, See Also
Description
General

The following properties specify the database object names:

  • TADStoredProc: CatalogName, SchemaName, PackageName and StoredProcName;
  • TADTable: CatalogName, SchemaName and TableName;
  • TADBottomUpdateOptions: UpdateTableName;
  • TADUpdateOptions: GeneratorName;
  • TADAutoIncField: GeneratorName;
  • etc

A name may be specified:

  • without quotes and FireDAC will normalize name;
  • enclosed into quotes and FireDAC will use it as is.

For example on Firebird with SQL dialect 3:

DDL
Will work
Will fail
CREATE PROCEDURE Test
ADStoredProc1.StoredProcName := 'test';
ADStoredProc1.StoredProcName := 'TeSt';
ADStoredProc1.StoredProcName := '"TEST"';
ADStoredProc1.StoredProcName := '"test"';
CREATE PROCEDURE "Test"
ADStoredProc1.StoredProcName := '"Test"';
ADStoredProc1.StoredProcName := 'test';
ADStoredProc1.StoredProcName := 'TeSt';
ADStoredProc1.StoredProcName := 'Test';
ADStoredProc1.StoredProcName := '"TEST"';
CREATE PROCEDURE "Main Proc"
ADStoredProc1.StoredProcName := '"Main Proc"';
ADStoredProc1.StoredProcName := 'main proc';
ADStoredProc1.StoredProcName := 'Main Proc';

Quoted object names

FireDAC fully supports quoted object names, including different DBMS quoted characters. To write a quoted name in a SQL in a DBMS independent fashion use the {id <name>} syntax. For example:

SELECT * FROM {id Order Details}

To force TADTable to quote field names set FormatOptions.QuoteIdentifiers to True.

Full object names

FireDAC supports the full object names, which include the catalog and / or schema names.

When you are using the design-time editors, like a TADStoredProc.StoredProcName combo box, Query Builder, etc., they will return the full object name. To avoid catalog and / or schema names in the full object name, use the MetaDefCatalog and MetaDefSchema connection definition parameters. For example:

[MSSQL_Demo]
DriverID=MSSQL
...
MetaDefCatalog=Northwind
MetaDefSchema=dbo

When a short object name is specified to StoredProcName, TableName, etc, they will be expanded into the full object names, using the current catalog and / or schema names. To override or avoid usage of current catalog and / or schema names, use the MetaCurCatalog and MetaCurSchema connection definition parameters. For example:

[MSSQL_Demo]
DriverID=MSSQL
...
MetaCurCatalog=*
MetaCurSchema=*

Additionally, at design-time you may force FireDAC to return object names without catalog and/or schema. For that in IDE menu item FireDAC -> Preferences ... unmark "Use full object names".

See Also

Executing Stored Procedure, Browsing Table, Common connection parameters

What do you think about this topic? Send feedback!


Working with DBMS

Working with DBMS
FireDAC Topics Send Feedback

A set of articles describing how to work with a specific database from an FireDAC application.

Group

FireDAC

Topics
Topic | Description
Using SQLite with FireDAC | This article describes the aspects of developing [image] SQLite database applications using FireDAC for Delphi. FireDAC is the leading DBMS access engine for Delphi providing powerful API to unique SQLite features. The SQLite is an embedded SQL database engine, [image] most widely deployed in the world.
Using Oracle with FireDAC | This article describes the aspects of developing [image] Oracle database applications using FireDAC for Delphi. FireDAC is the leading DBMS access engine for Delphi providing powerful API to unique Oracle features. The [image] Oracle is an enterprise level relational database server, #1 in worldwide RDBMS software revenue share.
Using Data Abstract with FireDAC | This article describes the power of combining the FireDAC with the [image] RemObjects Data Abstract. FireDAC is the leading Delphi DBMS access engine and RemObjects Data Abstract is a very powerful multi-tier framework.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Using SQLite with FireDAC

Using SQLite with FireDAC
Working with DBMS See Also Send Feedback

This article describes the aspects of developing [image] SQLite database applications using FireDAC for Delphi. FireDAC is the leading DBMS access engine for Delphi providing powerful API to unique SQLite features. The SQLite is an embedded SQL database engine, [image] most widely deployed in the world.

Group

Working with DBMS

Links
Working with DBMS, See Also
Description
1. General

This reference article has few sections:

  • Introduction to SQLite: reviews SQLite features, missed features, possible applications, and applications not for SQLite.
  • Using SQLite Database: explains how to create, connect to and manage SQLite database in Delphi application.
  • SQLite Encrypted Database: the database encryption is one of the important SQLite features. The topic explains how it works and how to control it.
  • SQLite Data Types: SQLite has an unique data type system. Without understanding of how it works, will be hard to effectively store and retrieve the data in Delphi applications.
  • SQLite SQL Commands: main aspects of SQLite SQL dialect for the Delphi application developers.
  • SQLite Transactions, Locking and Cursors: explains how to work with transactions in SQLite environment.
  • Extending SQLite Engine: as an embedded DBMS, SQLite engine may be extended by the Delphi application code.
  • Advanced SQLite Techniques: finally we want to introduce some advanced SQLite concepts, like updates logging and SQL authorization.

This article requires the knowledge of the FireDAC basics and of the main library API's. For the beginners we will suggest to start from the Getting Started article and look into the FireDAC\Samples\Getting Started\SQLite demo.

2. Introduction to SQLite

2.1 SQLite Database

The [image] SQLite is an embedded SQL database engine, developed by SQLite Consortium. It is a [image] DBMS most widely deployed in the world with rough estimate of 500M installations. You can find it on all iOS and Android mobile devices, on Mac OS and Linux desktop's. It is used by Firefox, Skype and McAfee anti-virus.

2.2 SQLite features

The [image] source lists:

  • Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures.
  • Zero-configuration - no setup or administration needed.
  • Implements most of SQL92. Supports table triggers and views.
  • A complete database is stored in a single cross-platform disk file.
  • Supports terabyte-sized databases and gigabyte-sized strings and blobs.
  • Faster than popular client/server database engines for most common operations.
  • Self-contained: no external dependencies.
  • Cross-platform: Windows, Linux, Mac OS X, iOS and Android are supported out of the box.
  • Sources are in the public domain. Use for any purpose is free.
  • Very powerful API, allowing to extend engine in practically all areas.
  • SQLite achieves one of the best data access performances among other embedded, file-server and client-server database engines used by the Delphi applications. We are aware of many successful applications with multi gigabyte databases. For example Silwood Technology Saphir is built with SQLite, Delphi and FireDAC.

2.3 Missed SQLite features

According to our experience, the developers often trying to find the following features, not presented in SQLite:

  • Stored procedures. FireDAC offers custom functions API.
  • Reach set of build-in functions. FireDAC pre installs about 50 standard functions.
  • Security system, including an user and a right concepts. FireDAC offers password protected encrypted database, special callbacks to filter user actions.
  • Collations (only ASCII and binary). FireDAC allows to define custom collations.

2.4 SQLite applications

The [image] source lists:

  • Application File Format. SQLite has been used with great success as the on-disk file format for desktop applications.
  • Embedded devices and applications. Because SQLite database requires little or no administration, SQLite is a good choice for devices or services that must work unattended and without human support.
  • Websites. SQLite usually will work great as the database engine for low to medium traffic websites (which is to say, 99.9% of all websites).
  • Replacement for ad hoc disk files. SQLite works particularly well as a replacement for these ad hoc data files.
  • Internal or temporary databases. For programs sifting and sorting the data in diverse ways, may be more simple to load data into in-memory SQLite database and use full scale SQL command.
  • Stand-in for an enterprise database during demos or testing.
  • Database Pedagogy.

2.5 Applications NOT for SQLite

The same [image] source lists:

  • High Concurrency. SQLite uses reader/writer locks on the entire database file. That means if any process is reading from any part of the database, all other processes are prevented from writing any other part of the database. Similarly, if any one process is writing to the database, all other processes are prevented from reading any other part of the database.
  • Client/Server Applications. If you have many client programs accessing a common database over a network, you should consider using a client/server database engine instead of SQLite. SQLite will work over a network file system, but because of the latency associated with most network file systems, performance will not be great.
  • Very large datasets (N tb).

3. Using SQLite Database

3.1 Connecting to SQLite database from Delphi application

To link FireDAC SQLite driver into Delphi application add TADPhysSQLiteDriverLink to a form or data module. To connect to SQLite database, specify SQLite driver parameters, at least:

DriverID=SQLite
Database=<path to SQLite database>

By default, all SQLite driver settings are set for the high-performance single connection access to a database in a stable environment. The [image] PRAGMA command allows to configure SQLite. Many FireDAC SQLite driver parameters correspond to the pragma's. Additionally SQLiteAdvanced allows to specify multiple pragma's separated by ';' as a single connection parameter.

The additional SQLite use cases are:

N | Application specifics | Description
1 | Reading large DB. | Set CacheSize to a higher number of pages, which will be used to cache the DB data. The total cache size will be CacheSize * <db page size>.
2 | Exclusive updating of DB. | Consider to set JournalMode to [image] WAL ( [image] more).
3 | Long updating transactions. | Set CacheSize to a higher number of pages, that will allow to run transactions with many updates without overloading the memory cache with dirty pages.
4 | A few concurrent updating processes. | Set LockingMode to Normal to enable shared DB access. Set Synchronous to Normal or Full to make committed data visible to others. Set UpdateOptions.LockWait to True to enable waiting for locks. Increase BusyTimeout to raise a lock waiting time. Consider to set JournalMode to WAL.
5 | A few concurrent updating threads. | See (4). Also set SharedCache to False to minimize locking conflicts.
6 | A few concurrent updating transactions. | See (4) or (5). Also set TxOptions.Isolation to xiSnapshot or xiSerializible to avoid possible transaction deadlocks.
7 | High safety. | Set Synchronous to Full to protect DB from the committed data losts. Also see (3). Consider to [image] encrypt database to provide integrity.
8 | High confidentiality. | Encrypt database to provide confidentiality and integrity.
9 | Development time. | Set LockingMode to Normal to enable simultaneous use of SQLite DB in IDE and a debugged program.

3.2 Creating SQLite database from Delphi application

SQLite database will be created at a connection establishment if it does not exist. For explicit control the Delphi application may specify:

OpenMode=CreateUTF8 | CreateUTF16 | ReadWrite | ReadOnly

First two values allow the creation and differ by encoding that will be used for the new database. Also we recommend to set [image] page_size to 4096 or more for the database with multi row tables. That may be done by specifying at creation time:

SQLiteAdvanced=page_size=4096

Consider to specify parameters using SQLiteAdvanced:

  • auto_vacuum
  • default_cache_size

Note, after the database file is created it has the zero size. As result the database encoding, page size and other persistent parameters are not recorded in the database. To make such parameters persistent, the application should create at least one table.

3.3 Using SQLite in-memory database in Delphi application

Next SQLite unique feature is the ability to work with the [image] pure in-memory databases. That means, no files will be created to store database objects and all will be kept in the memory. So, more security, more performance, less requirements to the environment rights for a Delphi application.

To create and open a SQLite in-memory database use parameters:

DriverID=SQLite
Database=:memory:

Or just leave Database parameter empty:

DriverID=SQLite

One FireDAC customer had a SQLite database on a shared network resource. The database is a read/only products catalogue with many stored product attributes. To radically improve performance, the customer used TADSQLiteBackup to move the database in whole into the in-memory database. The sample code:

ADConnection1.DriverName := 'SQLite';
ADConnection1.Open;

ADSQLiteBackup1.Database := '\\srv\db\data.sdb';
ADSQLiteBackup1.DestDatabaseObj := ADConnection1.CliObj;
ADSQLiteBackup1.DestMode := smCreate;
ADSQLiteBackup1.Backup;

3.4 Working with Unicode and SQLite database

FireDAC supports Unicode Delphi's (starting with Delphi 2009) in full. For SQLite that means:

  • FireDAC automatically setups SQLite database to exchange all metadata in UTF-16 encoding, when Delphi 2009 or higher is used. In Delphi 2007 or less the metadata is ANSI encoded.
  • The data will be defined and exchanged as is described in the chapter "Mapping SQLite to FireDAC Data Types".

3.5 Using multiple SQLite databases in Delphi application

SQLite allows to use multiple databases in a single connection. A DB specified by the Database parameter is the main database. To attach additional databases, Delphi application should use [image] ATTACH command. For example:

ADConnection1.ExecSQL('ATTACH ''c:\hr.sdb'' AS hr');
ADConnection1.ExecSQL('ATTACH ''c:\cust.sdb'' AS cust');
ADQuery1.Open('select * from "Orders" o ' +
  'left join hr."Employees" e on o.EmployeeID = e.EmployeeID ' +
  'left join cust."Customers" c on o.CustomerID = c.CustomerID');

Note, that FireDAC interprets a database name as a catalog name.

3.6 Manage SQLite database from Delphi application

A good Delphi (and not only) SQLite database application must be aware of the following facts:

  • SQLite database may become fragmented and non-optimal after many "hard" record updates or deletes. The TADSQLiteValidate.Sweep method call optimizes the database. This method corresponds to the [image] VACUUM command and [image] PRAGMA auto_vacuum. And the example:

ADSQLiteValidate1.Database := 'c:\db.sdb';
ADSQLiteValidate1.Sweep;

  • SQLite query optimizer builds a better query execution plan when it has an up-to-date database statistic. SQLite does not automatically update the statistic. The TADSQLiteValidate.Analyze method call collects it. This method utilizes the [image] ANALYZE command. An application may collect statistic for the full database:

ADSQLiteValidate1.Database := 'c:\db.sdb';
ADSQLiteValidate1.Analyze;

  • SQLite database may become corrupted or malformed. To verify it integrity use the TADSQLiteValidate.CheckOnly method. Note, to repair a broken SQLite database, Delphi application needs to restore it from a backup. CheckOnly method uses OnProgress event handler to notify about issues. This method performs [image] PRAGMA integrity_check command.

procedure TForm1.ADSQLiteValidate1Progress(ASender: TADPhysDriverService; const AMessage: String);
begin
  Memo1.Lines.Add(AMessage);
end;

ADSQLiteValidate1.Database := 'c:\db.sdb';
ADSQLiteValidate1.OnProgress := Form1Progress;
ADSQLiteValidate1.CheckOnly;

  • SQLite database must be backed up regularly to preserve the data loss. The TADSQLiteBackup component performs the database backup copy. This is how the simplest backup code looks:

ADSQLiteBackup1.Database := 'c:\db.sdb';
ADSQLiteBackup1.DestDatabase := 'c:\db.backup';
ADSQLiteBackup1.DestMode := smCreate;
ADSQLiteBackup1.Backup;

4. SQLite Encrypted Database

4.1 Approach

One of the distinctive SQLite features is the high-speed strong database encryption. It allows to make database file content confidential and enforce integrity control on the database file.

The encrypted database format is not compatible with other similar SQLite encryption extensions. That means, you cannot use an encrypted database, encrypted with non-FireDAC libraries. If you need that, then you have to decrypt a database with original tool and encrypt it with FireDAC.

The encryption is provided through the officially supported SQLite approach - custom codec code and compilation with SQLITE_HAS_CODEC defined. All encryption routines are implemented on Delphi and embedded into sqlite3 code. As result, the encryption is correctly handled for:

  • ATTACH;
  • VACUUM;
  • database recovery;
  • database backup.

4.2 Encryption modes
Mode
Description
Usage
AES-NNN
The aes-NNN algorithms are generic compositions of AES-CTR and AES-CBC-MAC. This composition guarantees both Confidentiality and Integrity, meaning that only entities with access to the correct password will be able to read and modify the pages of the encrypted database. These algorithms will add a linear overhead of 32 bytes per page to your encrypted database.
This algorithm will help you detect most malicious attempts to inject data into the database, but it will not prevent such attempts and it will not help you undo such modifications. It is essentially a complement to frequent backups, but it is much better than most other database encryption schemes at alerting you when you have been subject to an attack and it is time to restore your database from the backup.
Please note that the aes-NNN algorithm, by itself, neither will detect deletion of entire pages at the end of the database (but it will detect deletions in the middle of the database), nor will it detect attacks that consist in reverting the database to an older version encrypted using the same password.
The AES-NNN provides the top strong Confidentiality and Integrity. But at a price of some performance reduction, noticeable across other encryption modes.
AES-CTR-NNN
The aes-ctr-NNN algorithms are AES-CTR only. It will not detect modifications to the database, but it will provide Confidentiality against passive attacks. That is, as long as the attacker does not have access to your password, and does not attempt to modify the database to see how your application reacts to the modifications, your data will remain as secret as your application allows.
Needless to say, the algorithms will only protect your database file against attackers that are not able to tap into your FireDAC application using e.g. a debugger and extract the password that way. In a similar way, if you store your password in a configuration file or as a constant in the software itself, it will be trivial for any not even moderately skilled attacker to find it and compromise your security.
The AES-CTR-NNN provides the top strong Confidentiality, but not an Integrity. For that you will get a better performance.
AEC-ECB-NNN
The aes-ecb-NNN algorithms are AES-ECB only. It will not detect modifications to the database, and it will not provide strong Confidentiality against passive attacks, in contrast to AES-NNN and AES-CTR-NNN.
The AES-ECB-NNN provides comparably weak Confidentiality, and no Integrity. But it has the best performance across other encryption modes.

There NNN is the key size, which may be 128, 192 or 256 bits.

4.3 Setting up Encryption

The encryption may be controlled:

  • through the connection definition parameters Encrypt, NewPassword and Password;
  • through the TADSQLiteSecurity service component.

The password connection definition parameters may have a form:

[aes-128 | aes-192 | aes-256 | aes-ctr-128 | aes-ctr-192 | aes-ctr-256 |
 aes-ecb-128 | aes-ecb-192 | aes-ecb-256:] password

There "aes-XXX-NNN:" is an optional prefix, controlling the cipher algorithm to use. If it is not specified, then will be used:

  • algorithm, specified by Encrypt parameter;
  • aes-256 if nothing is specified.

FireDAC supports encryption operations:

Operation
Using parameters
Using TADSQLiteSecurity
Open encrypted database
Password=xxxx
---
Encrypt unencrypted database
NewPassword=xxxx
ADSQLiteSecurity1.Database := '...';
ADSQLiteSecurity1.Password := 'xxxx';
ADSQLiteSecurity1.SetPassword;
Change encrypted database password
Password=xxxx
NewPassword=yyyy
ADSQLiteSecurity1.Database := '...';
ADSQLiteSecurity1.Password := 'xxxx';
ADSQLiteSecurity1.ToPassword := 'yyyy';
ADSQLiteSecurity1.ChangePassword;
Decrypt encrypted database
Password=xxxx
NewPassword=
ADSQLiteSecurity1.Database := '...';
ADSQLiteSecurity1.Password := 'xxxx';
ADSQLiteSecurity1.RemovePassword;
Verify encryption database status
---
ADSQLiteSecurity1.Database := '...';
ADSQLiteSecurity1.Password := 'xxxx';
ShowMessage(ADSQLiteSecurity1.CheckEncryption);

4.4 SQL Extension

The ATTACH command got an extension. The full syntax of the ATTACH now is:

ATTACH [DATABASE] 'filename' [AS name] [KEY 'password']

When KEY is omitted, then the password value will be inherited from the main database. To specify an empty password to attach an unencrypted database, use something like that:

ATTACH 'D:\tmp\test.db' AS tst KEY ''

5. SQLite Data Types

5.1 Mapping SQLite to FireDAC Data Types

SQLite has "type less" [image] data type system. Practically that means, that you can use any identifier as a column data type name. For example "DELPHI" will work too and will correspond to the string data type. To make SQLite approach more compatible with other DBMS's and Delphi, and more comfortable for the Delphi application developers, FireDAC recognizes data type names as described in the table:

Type name | Description
ROWID | _ROWID_ | OID | dtInt64, Attrs = [caSearchable, caAllowNull, caROWID]
BIT | BOOL | BOOLEAN | LOGICAL | YESNO | dtBoolean
TINYINT | SHORTINT | INT8 [UNSIGNED] | dtSByte / dtByte
BYTE | UINT8 | dtByte
SMALLINT | INT16 [UNSIGNED] | dtInt16 / dtUInt16
WORD | UINT16 | YEAR | dtUInt16
MEDIUMINT | INTEGER | INT | INT32 [UNSIGNED] | dtInt32 / dtUInt32
LONGWORD | UINT32 | dtUInt32
BIGINT | INT64 | COUNTER | AUTOINCREMENT | IDENTITY [UNSIGNED] | dtInt64 / dtUInt64
LONGLONGWORD | UINT64 | dtUInt64
REAL | FLOAT | DOUBLE | dtDouble
SINGLE [PRECISION] [(P, S)] | dtSingle / dtBCD / dtFmtBCD
DECIMAL | DEC | NUMERIC | NUMBER [UNSIGNED] [(P, S)] | dtSByte / dtInt16 / dtInt32 / dtInt64 dtByte / dtUInt16 / dtUInt32 / dtUInt64 dtBCD / dtFmtBCD
MONEY | SMALLMONEY | CURRENCY | FINANCIAL [(P, S)] | dtCurrency
DATE | SMALLDATE | dtDate
DATETIME | SMALLDATETIME | dtDateTime
TIMESTAMP | dtDateTimeStamp
TIME | dtTime
CHAR | CHARACTER [(L)] | dtAnsiString, Len = L, Attrs = [caFixedLen]
VARCHAR | VARCHAR2 | TYNITEXT | CHARACTER VARYING | CHAR VARYING [(L)] | dtAnsiString, Len = L
NCHAR | NATIONAL CHAR | NATIONAL CHARACTER [(L)] | dtWideString, Len = L, Attrs = [caFixedLen]
NVARCHAR | NVARCHAR2 | NATIONAL CHAR VARYING | STRING [(L)] | dtWideString, Len = L
RAW | TYNIBLOB | VARBINARY | BINARY | BINARY VARYING [(L)] | dtByteString, Len = L
BLOB | MEDIUMBLOB | IMAGE | LONGBLOB | LONG BINARY | LONG RAW | LONGVARBINARY | GENERAL | OLEOBJECT | TINYBLOB | dtBlob
TEXT | MEDIUMTEXT | LONGTEXT | CLOB | MEMO | NOTE | LONG | LONG TEXT | LONGCHAR | LONGVARCHAR | TINYTEXT | dtMemo
NTEXT | WTEXT | NCLOB | NMEMO | LONG NTEXT | LONG WTEXT | NATIONAL TEXT | LONGWCHAR | LONGWVARCHAR | HTML | dtWideMemo
XMLDATA | XMLTYPE | XML | dtXML
GUID | UNIQUEIDENTIFIER | dtGUID
Other data types | dtWideString

Note, with SQLite the FormatOptions.StrsTrim works for all string data types.

5.2 Special SQLite Data Types

To add an [image] auto incrementing column to a table, define a column as INTEGER PRIMARY KEY AUTOINCREMENT. This type is mapped to dtInt32, Attrs = [caAutoInc]. For more details about handling auto-incrementing columns read "Auto-Incremental Fields".

The columns with ROWID, _ROWID_ or OID type names are considered as [image] identifying row columns. This types are mapped to dtInt64, Attrs = [caSearchable, caAllowNull, caROWID]. For more details about handling row identifying columns read "Unique Identifying Fields". SQLite ROWID is the fastest way to get an access to a specific row:

SELECT * FROM Orders WHERE ROWID = :RID

5.3 Adjusting FireDAC Mapping

Some SQLite driver parameters allow for Delphi application to adjust the data representation:

Parameter | Description
StringFormat = Choose | Unicode | When Unicode, then all dtAnsiString and dtMemo will be represented to a client as dtWideString and dtWideMemo.
GUIDFormat = String | Binary | When Binary, then dtGUID will be stored in a database as a TGUID binary value. When String, then as a string in {xxxxxxx} format. Binary requires less space in DB, String is more readable.
DateTimeFormat = String | Binary | When Binary, then dtDate, dtTime, dtDateTime will be stored in a database as a double value in Julian date format. When String, then as a character string in 'yyyy-mm-dd hh24:mi:ss' format. Binary requires less space in DB, String is more readable.

Note, that changing GUIDFormat or DateTimeFormat, when the database is not empty, may lead to errors, as FireDAC may fail to read and parse the stored values.

For an expression in a SELECT list the SQLite avoids type name information. When result set is not empty, FireDAC will use the value data types from the first record. When empty, FireDAC will describe those columns as dtWideString. To explicitly specify the column data type, append ::<type name> to the column alias:

SELECT count(*) as "cnt::INT" FROM mytab

When Delphi application requires SQLite native data type representation, then use FireDAC mapping rules. For example, map TEXT columns to dtAnsiString and INT columns to dtInt64:

with ADQuery1.FormatOptions do begin
  OwnMapRules := True;
  with MapRules do begin
    SourceDataType := dtMemo;
    TargetDataType := dtAnsiString;
  end;
  with MapRules do begin
    SourceDataType := dtInt32;
    TargetDataType := dtInt64;
  end;
end;

5.4. High-Precision Numbers

Due to [image] SQLite type system, long numbers (>= 20 digits) will be recognized as having REAL type affinity. So, a value will be rounded to a REAL (double Delphi type) type with 15 digits precision. To resolve this issue an application should use TEXT or similar data type and a mapping rule casting dtAnsiString to dtFmtBCD or similar data type. Note, this is not a FireDAC issue and at moment cannot be resolved differently.

6. SQLite SQL Commands

6.1 SQL Dialect

Although SQLite closely follows to the ANSI SQL 92, some features and commands are not supported, and some powerful are added. You can find more info about SQLite SQL dialect at:

  • SQL As Understood By SQLite.
  • SQLite / ANSI SQL Commands and Features Not Supported.

6.2 SQLite SQL Command Batches

FireDAC SQLite driver supports the SQL command batches. SQL commands must be separated by ';'. SQLite allows to mix any commands in a batch, including DDL and DML. For example:

with ADQuery1.SQL do begin
  SQL.Clear;
  SQL.Add('create table dbms (id integer, name varchar(20));');
  SQL.Add('insert into tab values (1, ''sqlite'');');
  SQL.Add('insert into tab values (2, ''mysql'');');
  SQL.Add('insert into tab values (3, ''firebird'');');
  SQL.Add('create table langs (id integer, name varchar(20));');
  SQL.Add('insert into tab values (1, ''delphi'');');
  SQL.Add('insert into tab values (2, ''c'');');
  SQL.Add('insert into tab values (3, ''c++'');');
  SQL.Add('select * from dbms;');
  SQL.Add('select * from langs;');
end;
ADQuery1.Open;
// process here the DBMS list
ADQuery1.NextRecordSet;
// process here the programming languages list

6.3 SQL script dialect

FireDAC TADScript does not support SQLite syntax, where script control commands are starting from '.'.

6.4 Array DML

Starting from v 3.7.11 the SQLite supports [image] INSERT command with multiple VALUES. FireDAC uses this feature to implement Array DML, when Params.BindMode = pbByNumber. Otherwise FireDAC will emulate Array DML. For example:

// here ADQuery1.Params collection is filled by 3 parameters
ADQuery1.SQL.Text := 'insert into MyTab values (:p1, :p2, :p3)';
// set "by number" parameter binding mode
ADQuery1.Params.BindMode := pbByNumber;
ADQuery1.Params.ArraySize := 100;
for i := 0 to ADQuery1.Params.ArraySize - 1 do begin
  ADQuery1.Params[0].AsIntegers[i] := i;
  ADQuery1.Params[1].AsStrings[i] := 'qwe';
  ADQuery1.Params[2].Clear(i);
end;
ADQuery1.Execute(ADQuery1.Params.ArraySize);

7. SQLite Transactions, Locking, Threads and Cursors

7.1 Locking and concurrent updates

Read the following original SQLite articles:

  • BEGIN TRANSACTION
  • SQLite Shared-Cache Mode
  • Corruption Following Busy

SQLite, as a file-server DBMS, likes to lock the database tables at updates. The following settings affect the concurrent access:

  • when multiple threads are updating the same database, set SharedCache connection parameter to False. That will help to avoid some possible deadlocks.
  • when multiple processes or threads are updating the same database tables, set set LockingMode to Normal to enable concurrent access to the tables. Also set Synchronous connection parameter to Full or Normal. So, SQLite will update a database file right after the transaction is finished. And other connections will see the updates on the predictable basis.
  • to avoid locking conflicts between connections, set UpdateOptions.LockWait to True and set BusyTimeout to a higher value.
  • to avoid locking conflicts between long running updating transactions, set TADConnection.TxOptions.Isolation to xiSnapshot or xiSerializible.

7.2 Transactions and isolation modes

SQLite supports transactions in full, including check points. Further is a list of isolation modes supported by SQLite:

Mode | Corresponds to
xiDirtyRead | PRAGMA read_uncommitted = 1
xiReadCommitted | BEGIN TRANSACTION DEFERRED
xiRepeatableRead | The same as xiReadCommitted.
xiSnapshot | BEGIN TRANSACTION IMMEDIATE
xiSerializible | BEGIN TRANSACTION EXCLUSIVE

7.3 Transactions and DML commands

Surrounding writing commands into a transaction may radically improve SQLite performance. That is notable at large data modifications. The same is applicable to FireDAC Array DML feature. So, surround the data modification code into a transaction to get the best performance:

ADConnection1.StartTransaction;
try
  ADQuery1.SQL.Text := 'insert into tab values (:id, :name)';
  ADQuery1.Params.ArraySize := 10;
  for i := 0 to ADQuery1.Params.ArraySize - 1 do begin
    ADQuery1.Params[0].AsIntegers[i] := i;
    ADQuery1.Params[0].AsStrings[i] := 'name' + IntTostr(i);
  end;
  ADQuery1.Execute(ADQuery1.Params.ArraySize, 0);
  ADConnection1.Commit;
except
  ADConnection1.Rollback;
  raise;
end;

7.4 Transactions and cursors

SQLite does not allow to rollback a transaction, when there are commands with not yet fetched result sets. To workaround that, FireDAC will fetch all remaining records from a result set on a Rollback method call. See the FetchOptions.AutoFetchAll.

8. Extending SQLite Engine

8.1 Custom Functions

SQLite does not support stored procedure or function concept, as it allows to use the host language environment to extend the engine functionality. SQLite allows to register host language functions in SQLite engine and use them in the SQL commands. FireDAC simplifies this by introducing the TADSQLiteFunction component.

To build a function, the developer has to set FunctionName, ArgumentsCount and create the OnCalculate event handler. Setting Active to True will register custom function at SQLite engine. For example:

procedure TForm1.ADSQLiteFunction1Calculate(AFunc: TSQLiteFunction;
  AInputs: TSQLiteInputs; AOutput: TSQLiteOutput; var AUserData: TObject);
begin
  AOutput.AsInteger := AInputs[0].AsInteger * AInputs[1].AsInteger;
end;

ADSQLiteFunction1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteFunction1.FunctionName := 'XmY';
ADSQLiteFunction1.ArgumentsCount := 2;
ADSQLiteFunction1.OnCalculate := ADSQLiteFunction1Calculate;
ADSQLiteFunction1.Active := True;

This function usage:

ADQuery1.Open('select RegionID, XmY(RegionID, 10) from "Region"');

A function may call the FireDAC methods to query a database. To create a custom function with the default or different number of arguments you will need to specify the same FunctionName and different number of arguments. That will register an overloaded function inside the SQLite engine.

The above and other function samples you can find in FireDAC\Samples\DBMS Specific\SQLite\UserFunc folder.

FireDAC implements and installs to a SQLite connection about 50 functions, which are standard de-facto for many DBMS and are implemented by the FireDAC local expressions engine. Note, when you are creating SQLite connection at run-time, you should include uADStanExprFuncs unit into "uses" clause, otherwise you will get an exception:

[FireDAC][Phys][SQLite] ERROR: no such function: UCASE.

To make custom functions accessible at design-time, create a custom design-time package with a data module, drop the components on this module and setup properly. Create the module in the module unit initialization section, and destroy in the finalization section. Then install your package into Delphi IDE.

And the [image] Ron Grove movie:

8.2 Custom Collations

SQLite stores and handles all character data either in UTF8 or UTF16, depending on the OpenMode connection parameter. When SQLite needs to compare or sort a character data, it must know what rules to use for that. The rules are known as a collation.

SQLite has few build-in collations. None of them produces a correct sorting for German, Cyrillic, Arabian, etc phrases. You have to use TADSQLiteCollation component to build your own collation. Set CollationName, Flags, Locale, then set Active to True to register the collation with SQLite engine. For example:

ADSQLiteCollation1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteCollation1.CollationName := 'UTF16NoCase';
ADSQLiteCollation1.Flags := [sfIgnoreCase];
ADSQLiteCollation1.Active := True;

Above component setup with default CollationKind=scCompareString implements a standard Win32 Unicode collation. The application may implement custom collations using CollationKind=scCustomUTF16 or scCustomUTF8 and implementing OnCompare event handler. And how to use this collation:

SELECT * FROM "Employees" ORDER BY LastName COLLATE UTF16NoCase

To specify default collation for a column you can do:

CREATE TABLE IF NOT EXISTS test_col (f1 VARCHAR(10) COLLATE UTF16NoCase)

Note, that there is no ability to specify default collation for a connection, a database or a table. The above collation samples you can find in FireDAC\Samples\DBMS Specific\SQLite\UserCollation folder.

If you do not use custom collations, then by default SQLite will use a binary sorting order. For TADTable Live Data Window mode is important to have the same client side and database sorting orders. To enable client side binary sorting order set FormatOptions.SortLocale to 0.

8.3 The Database Events

FireDAC supports notification of an Delphi application from a SQLite database trigger about some events, like a data change. For that FireDAC uses similar to Firebird approach and registers POST_EVENT custom function. To call it from a trigger do:

CREATE TRIGGER update_orders UPDATE ON "Orders"
BEGIN
  SELECT POST_EVENT('Orders');
END;

To receive an event notification the Delphi application uses TADEventAlerter component. For example:

ADEventAlerter1.Names.Text := 'Orders';
ADEventAlerter1.Options.Synchronize := True;
ADEventAlerter1.OnAlter := DoAlert;
ADEventAlerter1.Active := True;

procedure TForm1.DoAlert(ASender: TADCustomEventAlerter;
  const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Orders') = 0 then
    qryOrders.Refresh;
end;

8.4 Custom Data Sources

Local SQL engine allows to use TDataSet descendants in your SQL queries. FireDAC uses [image] SQLite Virtual Table API to implement Local SQL.

9. Advanced SQLite Techniques

9.1 Hooking Database Updates

SQLite provides an unique API allowing to [image] monitor all updates to a database. This feature may be used, for example, to log all updates to a DB. To work with this API, a Delphi application should set OnUpdate event handler of the TSQLiteDatabase object, which is a database connection wrapping object. Hook this event after a database connection is opened. For example:

procedure TForm1.DoUpdate(ADB: TSQLiteDatabase; AOper: Integer; const ADatabase, ATable: String; ARowid: sqlite3_int64);
begin
  Memo1.Lines.Add(Format('%d - %s - %s - %u', [AOper, ADatabase, ATable, ARowid]));
end;

ADConnection1.Connected := True;
TSQLiteDatabase(ADConnection1.ConnectionIntf.CliObj).OnUpdate := DoUpdate;

This sample you can find in FireDAC\Samples\DBMS Specific\SQLite\OnUpdate folder.

9.2 Controlling Database Access Rights

The SQLite is an embedded DBMS. That implies that it is a single user DBMS and does not need such concepts as a user, access rights, etc. Still some application may benefit from an access right control, for example:

  • An application may restrict rights depending on a end-user license. Demo license - less possibilities, full license - all possibilities.
  • Multi-tier data access frameworks may use their own user concept and to control data access rights using some generic approach.

And again, SQLite provides an unique feature allowing to [image] authorize or not SQL commands. To work with this API, a Delphi application should set OnAutorize event handler of the TSQLiteDatabase object, which is a database connection wrapping object. Hook this event after a database connection is opened. For example:

procedure TForm1.DoAuthorize(ADB: TSQLiteDatabase; ACode: Integer; const AArg1, AArg2, AArg3, AArg4: String; var AResult: Integer);
begin
  Memo1.Lines.Add(Format('%d - %s - %s - %s - %s', [ACode, AArg1, AArg2, AArg3, AArg4]));

  // Deny any delete operation
  if ACode = SQLITE_DELETE then
    AResult := SQLITE_DENY
  else
    AResult := SQLITE_OK;
end;

ADConnection1.Connected := True;
TSQLiteDatabase(ADConnection1.ConnectionIntf.CliObj).OnAutorize := DoAuthorize;

This sample you can find in FireDAC\Samples\DBMS Specific\SQLite\OnAuthorize folder.

9.3 Using SQLite low-level API

When you need to get the maximum SQLite data access performance, then you should consider to use FireDAC SQLite API wrapping classes. This is a low-level thin object oriented API, which is used by the FireDAC SQLite driver. This API is not documented and not officially supported.

The following example shows how to control transactions and fetch records using a parameterized SELECT command:

uses
  uADPhysSQLiteWrapper;

procedure TForm1.FormCreate(Sender: TObject);
var
  oDB: TSQLiteDatabase;
  oTran: TSQLiteStatement;
  oStmt: TSQLiteStatement;
  i: Integer;
begin
  ADConnection1.Connected := True;
  oDB := TSQLiteDatabase(ADConnection1.CliObj);

  oTran := TSQLiteStatement.Create(oDB);
  try
    // start transaction
    oTran.Prepare('BEGIN');
    oTran.Execute;

    oStmt := TSQLiteStatement.Create(oDB);
    try
      // prepare statement
      oStmt.Prepare('select * from "Orders" where OrderID > :ID1 and OrderID < :ID2');

      // add bind variables (parameters)
      for i := 1 to oStmt.ParamDefsCount do
        TSQLiteBind.Create(oStmt.Params);

      // add column variables (fields)
      for i := 1 to oStmt.ColumnDefsCount do
        TSQLiteColumn.Create(oStmt.Columns).Index := i - 1;

      // set parameter values and execute
      oStmt.Params[0].AsInteger := 11000;
      oStmt.Params[1].AsInteger := 12000;
      oStmt.Execute;

      // fetch records and read columns
      while oStmt.Fetch do
        Memo1.Lines.Add(Format('OrderID: %d, CustomerID: %s',
          [oStmt.Columns[0].AsInteger, oStmt.Columns[1].AsString]));
    finally
      oStmt.Free;
    end;

    // commit transaction
    oTran.Unprepare;
    oTran.Prepare('COMMIT');
    oTran.Execute;
  finally
    oTran.Free;
  end;
end;

10. Summary

This article has provided the benefits of combining SQLite and FireDAC to get premier embedded DBMS solution. The articles describes all aspects of the FireDAC SQLite driver usage.

See Also

Connect to SQLite database, uADPhysSQLite Namespace

What do you think about this topic? Send feedback!


Using Oracle with FireDAC

Using Oracle with FireDAC
Working with DBMS See Also Send Feedback

This article describes the aspects of developing [image] Oracle database applications using FireDAC for Delphi. FireDAC is the leading DBMS access engine for Delphi providing powerful API to unique Oracle features. The [image] Oracle is an enterprise level relational database server, #1 in worldwide RDBMS software revenue share.

Group

Working with DBMS

Links
Working with DBMS, See Also
Description

Note. This article is a work-in-progress and is not finished !

Still we decided to include it into documentation, as it already contains helpful information.

M. Oracle Advanced Data Types

Object Extensions

XML

BFILE

BLOB / CLOB / NCLOB

PL/SQL Collections, Var Arrays

PL/SQL Tables

FireDAC supports Oracle PL/SQL tables as the parameters of PL/SQL anonymous blocks, stored procedures and functions. Note, that a PL/SQL associate table differs from VARRAY and collections. FireDAC does not support the last two.

To setup a parameter as a PL/SQL table specify TADParam.ArrayType = atPLSQLTable. Set ArraySize to a maximum table size before ExecProc call. When INOUT, OUT parameter ArraySize is less than the number of table elements assigned at server side, then exception will be raised:

[FireDAC][Phys][Ora] ORA-06513: PL/SQL: index for PL/SQL table out of range for host language array
ORA-06512: at line 2

To read or write parameter values use TADParam.AsXxxs[<index>] properties. There index is zero-based. Although at server side the index is 1 based. The empty elements have NULL value and may be tested using TADParam.IsNulls[<index>].

For example the server side script:

CREATE OR REPLACE PACKAGE ADQA_TestPack AS
  TYPE TVC2Tbl IS TABLE OF VARCHAR2(50) INDEX BY BINARY_INTEGER;
  PROCEDURE TestPLSQLArray(ATable in out TVC2Tbl);
END ADQA_testpack;
/

CREATE OR REPLACE PACKAGE BODY ADQA_TestPack AS
  PROCEDURE TestPLSQLArray(ATable IN OUT TVC2Tbl) IS
  BEGIN
    for i in ATable.First .. ATable.Last loop
      ATable(i) := '*' || ATable(i) || '*';
    end loop;
  END;
END ADQA_testpack;
/

And the client side code assigning memo lines to the table parameter, executing procedure, reading the table items and filling the memo:

var
  i: Integer;

ADStoredProc1.PackageName := 'ADQA_TESTPACK';
ADStoredProc1.StoredProcName := 'TESTPLSQLARRAY';
ADStoredProc1.Prepare;

ADStoredProc1.Params[0].ArraySize := Memo1.Lines.Count;
for i := 0 to Memo1.Lines.Count - 1 do
  ADStoredProc1.Params[0].AsStrings[i] := Memo1.Lines[i];
Memo1.Lines.Clear;

ADStoredProc1.ExecProc;
for i := 0 to ADStoredProc1.Params[0].ArraySize - 1 do
  Memo1.Lines.Add(ADStoredProc1.Params[0].AsStrings[i]);

Also see FireDAC\Samples\DBMS Specific\Oracle\PLSQLAssocArray demo.

PL/SQL Records

FireDAC supports Oracle PL/SQL records as the parameters of stored procedures and functions. Note, that a PL/SQL record differs from objects. FireDAC does not support the Oracle objects.

It is possible to correctly setup such parameters only when fiMeta in TADStoredProc.FetchOptions.Items and ParamBindMode = pbByName. Then FireDAC will expand record into a flat list of corresponding Params items. Where each item has a name <parameter name>$<record field name>.

For example the server side script:

CREATE OR REPLACE PACKAGE ClientPack IS
  TYPE t_clnt_data IS RECORD (
       client_id numeric,
       name varchar2(10),
       act boolean
  );
  PROCEDURE ClntProc(ARec IN t_clnt_data);
END ClientPack;
/

And the client side code assigning parameter values:

ADStoredProc1.PackageName := 'MYPACK';
ADStoredProc1.StoredProcName := 'CLNTPROC';
ADStoredProc1.Prepare;
ADStoredProc1.ParamByName('AREC$CLIENT_ID').Value := 100;
ADStoredProc1.ParamByName('AREC$NAME').Value := 'Client 1';
ADStoredProc1.ParamByName('AREC$ACT').Value := True;
ADStoredProc1.ExecProc;

Also see FireDAC\Samples\DBMS Specific\Oracle\PLSQLRecs demo.

N. Oracle Advanced Cursors

Working with Oracle REF CURSOR

FireDAC supports Oracle [image] REF CURSOR, returned by Oracle PL/SQL anonymous blocks, stored procedures and functions. To open first cursor call Open method, to switch to subsequent cursors use NextRecordSet method. After switching to next cursor the previous one is not more accessible. See Command Batches chapter for details.

For example:

CREATE PROCEDURE TestRefCrs (ACrs1 IN OUT SYS_REFCURSOR, ACrs2 IN OUT SYS_REFCURSOR) AS
BEGIN
  OPEN ACrs1 FOR SELECT * FROM "Orders";
  OPEN ACrs2 FOR SELECT * FROM "Order Details";
END;

Using TADStoredProc:

ADStoredProc1.FetchOptions.AutoClose := False;
ADStoredProc1.StoredProcName := 'TESTREFCRS';
ADStoredProc1.Open;
// work with "Orders" table data
ADStoredProc1.NextRecordSet;
// work with "Order Details" table data
ADStoredProc1.Close;

Using TADQuery:

ADQuery1.FetchOptions.AutoClose := False;
ADQuery1.Open('BEGIN TestRefCrs(:p1, :p2); END;');
// work with "Orders" table data
ADQuery1.NextRecordSet;
// work with "Order Details" table data
ADQuery1.Close;

Note, if REF CURSOR is opened using dynamic SQL command text, then before subsequent Open calls, you should call Disconnect method. This is because FireDAC keeps dataset prepared and expects the same cursor structure as it was on first Open call. For example:

CREATE PROCEDURE TestDynCrs (ASQL IN VARCHAR2, ACrs OUT SYS_REFCURSOR) AS
BEGIN
  OPEN ACrs FOR ASQL;
END;

Using TADQuery:

ADQuery1.FetchOptions.AutoClose := False;
ADQuery1.SQL.Text := 'BEGIN TestDynCrs(:p1, :p2); END;';

ADQuery1.Params[0].AsString := 'SELECT * FROM "Orders"';
ADQuery1.Open;
// work with "Orders" table data
ADQuery1.Close;

ADQuery1.Params[0].AsString := 'SELECT * FROM "Order Details"';
ADQuery1.Disconnect;
ADQuery1.Open;
// work with "Order Details" table data
ADQuery1.Close;

Working with Oracle Nested Cursors

FireDAC supports [image] CURSOR type columns in a SELECT lists. There may be multiple CURSOR's in the list. But a CURSOR nested into a CURSOR is not supported. Such columns FireDAC defines as dtRowSetRef and creates for them TDataSetField. To process their row sets, application should use TADMemTable, and set its DataSetField property to a TDataSetField reference.

While application navigates through the main dataset, the nested datasets will be automatically open and refreshed to provide the nested cursor records for a current record of the main dataset.

For example see FireDAC\Samples\DBMS Specific\Oracle\NestedCursors demo.

Updating Cursors Data

To refresh REF CURSOR or nested cursor records, application must reexecute main query.

To edit REF CURSOR or nested cursor record, application must override updates posting.

O. Oracle Transactions, Locking, Threads and Cursors

P. Providing Server Feedback

Oracle application backend may send feedback to an application frontend using [image] DBMS_OUTPUT package. FireDAC allows to automatically receive the DBMS_OUTPUT content.

Optionally set TADConnection.ResourceOptions.ServerOutputSize to the maximum buffer size. To enable DBMS_OUTPUT set TADConnection.ResourceOptions.ServerOutput to True. After a SQL command execution, application may process DBMS_OUTPUT feedback using TADConnection.Messages. Note, DBMS_OUTPUT processing affects performance, so normally it must be disabled.

For example:

var
  i: Integer;
...
ADConnection1.ResourceOptions.ServerOutput := True;
with ADQuery1.SQL do begin
  Clear;
  Add('begin');
  Add('  dbms_output.put_line(''Hello World !'');');
  Add('end;');
end;
ADQuery1.ExecSQL;
if ADConnection1.Messages <> nil then begin
  Memo1.Lines.Clear;
  for i := 0 to ADConnection1.Messages.ErrorCount - 1 do
    Memo1.Lines.Add(ADConnection1.Messages[i].Message);
end;
See Also

Connect to Oracle Server, uADPhysOracle Namespace

What do you think about this topic? Send feedback!


Using Data Abstract with FireDAC

Using Data Abstract with FireDAC
Working with DBMS Send Feedback

This article describes the power of combining the FireDAC with the [image] RemObjects Data Abstract. FireDAC is the leading Delphi DBMS access engine and RemObjects Data Abstract is a very powerful multi-tier framework.

Group

Working with DBMS

Links
Working with DBMS
Description
1. General

This tutorial has two main sections:

  • Benefits of combining FireDAC and Data Abstract: while each of the products is a state of the art solution for the specific tasks, together they allow to solve these tasks more effectively.
  • How to use the FireDAC Data Abstract driver (DAD): explains how to configure FireDAC DAD, how to use Direct Mode and how to migrate to FireDAC DAD from other DADs.

2. Benefits of combining

Data Abstract

The [image] Data Abstract relies on the [image] Data Abstract drivers to access to a specific DBMS. The Data Abstract drivers are implemented by wrapping a specialized data access framework (DAF). While this approach works just great, it has a few consequences:

  • Any underlying DAF has to be be highly effective, so the combined product is also highly effective. Otherwise a DAF is only a weak link in the chain.
  • To access to the multiple DBMSs effectively you will need to use the few specialized DAFs. If they are commercial products, the combined tool price is raising with the addition of an access option to each new DBMS. Also, the developers will need more time to get an expertise in all these DAFs with different APIs.
  • The usage of a single unified DAF, as ADO or DbExpress (DBX), is cost effective and simple for the developers, but it is not really a high speed solution (as we will show later). Also, these DAFs hide many useful DBMS features, making combined solution less flexible.

Together

FireDAC as a Data Abstract driver provides superb integration with Data Abstract on a very low level, giving extra speed in the interaction of the two. The FireDAC rounds off the RemObjects Software offering of the Data Abstract by adding an in-house solution for the "last mile", the data access layer which previously always depended on third parties. And it does that without giving up the flexibility. The combined product benefits are:

  • Performance:
    • The Data Abstract, FireDAC and FireDAC DAD - all three - were optimized and adjusted to each other to get maximum performance.
    • The FireDAC DAD is the fastest Data Abstract driver, implementing Direct Mode, giving 20-40% performance gain, while the CPU load is largely reduced.
  • Features:
    • The FireDAC DAD implements all the optional Data Abstract driver interfaces.
    • The FireDAC DAD supports many DBMSs in an effective, unified and feature rich way.
  • Price:
    • You need to buy only a single DAF, instead multiple ones.
  • Support. The FireDAC DAD is developed and maintained together by the Data Abstract and FireDAC teams. So, the expertise and resources of each team is fully accessible to the other team. That means:
    • Both products are getting features for better interoperability.
    • You will never hear "Sorry, this is not our issue".
    • Always up-to-date builds of the Data Abstract and FireDAC DAD.

3. How to use

Configure connection

In this section we will review how to build a Data Abstract driver connection string. A connection string is a set of the DAD parameters, allowing you to establish a connection to a DBMS.

Using DASM Connection Wizard

Note: Use the DASM -> Schema -> Drivers menu item to see the FireDAC DAD version info. This info is required to be provided to the technical support, if you contact them regarding FireDAC DAD usage.

In this part we will review step by step how to configure a connection to a Microsoft SQL Server using the FireDAC DAD. We will use the [image] Data Abstract Schema Modeler Connection Wizard to build the connection string. So, lets run the DASM and press New Connection on the Connections pane. In general, you can follow to the instructions shown on the right of the Connection Wizard dialog:

  • Step 1. Specify FireDAC as Driver Name.
  • Step 2. Because FireDAC DAD provides access to the different database systems, using own drivers, you should choose the FireDAC driver ID as Aux Driver. In our tutorial it is MSSQL.
  • Step 3. Specify a MS SQL Server name in Server Name. For example, 127.0.0.1 for a locally running default MS SQL Server instance.
  • Step 4. Provide user credentials. If you use Windows Authentication, check that Custom Parameters (Step 6) has Integrated Security=SSPI; specified. Otherwise, delete this parameter. We use 'sa' as a Login Name with empty Password.
  • Step 5. Specify a MS SQL Server database name. For example, Northwind.

Basically, at this point you should be able to connect to the DBMS. You can verify that by pressing the Test Connection button.

  • Step 6. Here you can specify the custom driver parameters. You can press the button on the right of the Parameters edit box to get a help dialog, containing a list of the supported driver specific parameters. We use Schemas=1.
  • Step 7. Now specify your connection name and press the OK button to save the connection.

By code

The general format for the FireDAC DAD connection string is:

FireDAC?AuxDriver=<FireDAC driver ID>;Server=<server>;Database=<database>;UserID=<user name>;
Password=<password>;<FireDAC DAD specific parameters>;<FireDAC driver specific parameters>

So, for the above example, the connection string is:

FireDAC?AuxDriver=MSSQL;Server=127.0.0.1;Database=Northwind;UserID=sa;Password=;Schemas=1

The connection string may be specified at design time or at runtime using the [image] TDAConnectionManager component. Set the Default property to True to use this connection as the default. To link the FireDAC DAD driver to your application, do one of the following:

  • drop TDAAnyDACDriver to any form or data module in your application;
  • include uDAAnyDACDriver into any uses clause in your application.

4. Custom parameters

DAD specific parameters

These parameters are used by the FireDAC DAD to control the DAD behaviour and are not visible to the FireDAC drivers. The following table lists the parameters:

Parameter
Description
Example value
ConnectionDefName
Allows to specify FireDAC connection definition name, instead of specifying FireDAC driver separate parameters in connection string.
MSSQL_Demo
BiDirectionalDataSets
FireDAC DAD dataset mode:
  • 0 - use unidirectional datasets (by default). This allows to speed up fetching and preserve memory usage for large result sets.
  • 1 - use bidirectional datasets. This allows you to walk through FireDAC DAD datasets in both directions.
1
DirectMode
FireDAC DAD mode:
  • 0 - standard mode, when DAD implements a IDADataset interface using TDataSet descendants.
  • 1 - direct mode. FireDAC implements it using high-speed low level data access interfaces.
See next chapter for details.
1
Integrated Security
SSPI - set OSAuthent=Y connection definition parameter. Is used only for SQL Server connections.
SSPI
Schemas
1 - forces DAD to return object names prefixed with schema. Is used only for SQL Server connections.
1
DataTypeSchema
FIB - forces DAD to use FIB+ compatible data type mapping. Is used only for IB/FB connections.
FIB

FireDAC specific parameters

These parameter names must be prefixed by the '@' sign and are transferred directly to an FireDAC driver to establish a connection to a DBMS. Check FireDAC Database Connectivity for details.

Alternatively, you can specify connection definition by the ConnectionDefName parameter. Also to specify Format, Fetch, Update and/or Resource options:

  1. Start ADExplorer and setup a connection definition.
  2. At the Advanced options page set up the required options.
  3. Save the connection definition.
  4. In ADConnectionDefs.ini copy the saved options and append them to the connection string preceding them with "@" symbol.

For example, FireDAC connection definition with options:

[AnyDAC_DAD]
Database=Northwind
Server=127.0.0.1
DriverID=MSSQL
FetchOptions.AssignedValues= [evMode]
FetchOptions.Mode= fmAll
FormatOptions.AssignedValues= [fvMapRules]
FormatOptions.OwnMapRules= True
FormatOptions.MapRules= < item NameMask = 'MY_BOOL' SourceDataType = dtInt16 TargetDataType = dtBoolean end>

And the extended connection string:

FireDAC?AuxDriver=MSSQL;Server=127.0.0.1;Database=Northwind;UserID=sa;Password=;Schemas=1;
@FetchOptions.AssignedValues=[evMode];@FetchOptions.Mode=fmAll;
@FormatOptions.AssignedValues=[fvMapRules];@FormatOptions.OwnMapRules=True;
@FormatOptions.MapRules=< item NameMask = 'MY_BOOL' SourceDataType = dtInt16 TargetDataType = dtBoolean end>;

Or

FireDAC?AuxDriver=MSSQL;@ConnectionDefName=AnyDAC_DAD;

5. Direct mode

Since 5.0.31.701 version in the Data Abstract FireDAC driver was introduced new working mode so-called Direct Mode. The Data Abstract driver Direct Mode excludes a TDataSet descendants overhead and allows to use low-level high-speed DAF APIs. While the standard driver mode is the Dataset Mode, it uses the DAF specific TDataSet descendants.

In the Direct Mode the FireDAC DAD uses the Phys and DatS layers directly, excluding the Comp and DApt layers overhead. That gives 20-40% performance gain. Note that:

  • the same driver supports the Direct and Dataset modes;
  • the driver behaviour remains almost the same in either of the modes.

Using direct mode is managed by parameter DirectMode, setting DirectMode=1 enables direct mode, setting DirectMode=0 disables direct mode. The Direct Mode is turned off by default, as it is not 100% backward compatible. You need to explicitly analyze the application and, if possible, to turn Direct Mode on.

The main difference between the two modes is, that in the Direct Mode the DAD does not use the TDataSet descendant objects. So, IDASQLCommand.Dataset and TDACustomField.BindedField are always nil. While it is not a limitation for a Data Abstract server, it may be an issue with local usage. Anyway, in DirectMode=1 you can use the TDACustomField.BindedNativeField instead of TDACustomField.BindedField and IDASQLCommandNativeObject.

Known limitations in DA 5.0.31.701:

  • DASM doesn't support DirectMode=1 for configuring schema so it is recommended to set up your schema in DASM with DirectMode=0 and after this to switch into DirectMode=1.
  • TDABinDataStreamer doesn't support DirectMode=1.

6. Migration

In this section we will review the migration of the application to FireDAC DAD from any other DAD.

In general, you should perform the following steps:

  • Replace the connection string with an FireDAC compatible one.
  • If your application works directly with an underlying data access framework, this code must be changed to an FireDAC compatible one.

There are possible issues:

  • An FireDAC DAD data type mapping may be different from the other DADs. If you are migrating from FIB+ DAD, just use the DataTypeSchema=FIB connection parameter to force the FIB+ data type mapping in the FireDAC DAD. For other DADs, please contact RemObjects.
  • An FireDAC DAD behavior may be different from the other DADs. For example, FireDAC offers the same range of transaction control features, just through a different API.
  • The FireDAC may not contain the DBMS specific components, which other data access frameworks have, for example, IBDump from FIB+.

7. Summary

This article has provided the benefits of combining Data Abstract and FireDAC to get premier N-tier data access solutions. The articles describes all aspects of the FireDAC DAD usage.

What do you think about this topic? Send feedback!


x Platform Development

x Platform Development
FireDAC Topics Send Feedback

The set of articles describing how to use FireDAC for cross-platform development for Linux, Mac OS X and other environments.

Group

FireDAC

Topics
Topic | Description
Installing FireDAC | FireDAC requires special steps to install or deploy on Linux, Mac OS X and iOS.
Using FireDAC | FireDAC development on Linux, Mac OS X and iOS has differences comparing to Windows.
Known Limitations | The list of known FireDAC limitations related to cross platform development.
UnixODBC | FireDAC on the non-Windows platforms uses UnixODBC to access to the ODBC-based data sources.
Lazarus / FPC | FireDAC supports Lazarus / FPC. Lazarus / FPC enables application development for Windows, Linux, Mac OS, iOS and more.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Installing FireDAC

Installing FireDAC
x Platform Development See Also Send Feedback

FireDAC requires special steps to install or deploy on Linux, Mac OS X and iOS.

Group

x Platform Development

Links
x Platform Development, See Also
Description

The following optional steps are required to install FireDAC and / or deploy FireDAC applications on Linux, Mac OS X and iOS. These steps are mandatory when you are using persistent connection definitions or virtual drivers:

  1. Step is required for Lazarus / FPC development and not needed for Delphi development. Copy FireDAC folder from Windows installation to Linux or Mac OS file system. We suggest to copy to the ~/FireDAC folder.
  2. Create ~/.firedac folder.
  3. Create there ad.conf file with the following content (see FireDAC/DB/ad.conf.linux for example):

[main]
ADHOME=$(HOME)/.firedac
ConnectionDefFile=$(ADHOME)/ADConnectionDefs.ini
DriverFile=$(ADHOME)/ADDrivers.ini

  4. Use FireDAC/DB/ADConnectionDefs.linux as a starting point for your connection definition file. Copy it into ~/.firedac/ADConnectionDefs.ini, then add required connection definitions to it. The file is optional.
  5. Use FireDAC/DB/ADDrivers.linux as starting point for your driver configuration file. Copy it into ~/.firedac/ADDrivers.ini, then add required driver configurations to it. The file is optional.
See Also

Lazarus / FPC

What do you think about this topic? Send feedback!


Using FireDAC

Using FireDAC
x Platform Development See Also Send Feedback

FireDAC development on Linux, Mac OS X and iOS has differences comparing to Windows.

Group

x Platform Development

Links
x Platform Development, See Also
Description

In general FireDAC application development on / for Linux, Mac OS X and iOS is similar to Windows, but has few aspects, additionally to Known Limitations:

  1. GUIx components must have Provider = 'FMX' to use FireMonkey implementation for FireDAC GUI dialogs. Note, switching to Provider = 'FMX', may require to delete uADGUIxFormsXxx units from the uses clauses.
  2. Try to avoid to specify design-time paths for FireDAC properties, like TADPhysDriverLink.VendorLib or TADCustomManager.ConnectionDefFileName. Use default values or configuration files.
  3. FPC TStringField does not have published FixedChar property. So, if the code was originally developed in Delphi IDE and is planned to use it in FPC, then set TStringField.FixedChar to False for all persistent fields.
  4. An application and a DBMS client dynamic library bitnesses must be the same. x86 executable will use x86 libraries. x64 executable will use x64 libraries.
See Also

Known Limitations

What do you think about this topic? Send feedback!


Known Limitations

Known Limitations
x Platform Development See Also Send Feedback

The list of known FireDAC limitations related to cross platform development.

Group

x Platform Development

Links
x Platform Development, See Also
Description

This is the list of known FireDAC limitations comparing to using FireDAC with Delphi on Windows:

  1. Supported platform are Windows x86 and x64, Linux x86 and x64, Mac OS X x86, iOS.
  2. FireDAC trial version includes only Delphi 5 - XE2 Win32 and FPC / Lazarus Win32 binaries.
  3. Utilities are provided for Windows only.
  4. On Linux and Mac OS the ODBC-based drivers (SQL Server, IBM DB2, SQL Anywhere) may require explicit ODBC driver specifying, using the TADPhysXxxxDriverLink.ODBCDriver property or configuration file.
  5. Microsoft Access driver is supported only on Windows platforms.
  6. Microsoft SQL Server ODBC driver and FreeTDS ODBC driver have quite different behavior and quality.
  7. SQLite driver supports static linking only for Win32. For other platforms the dynamic linking must be configured.
  8. The ANSI <-> UCS2 conversion routines are not implemented in full for FPC / Lazarus. They supports only ASCII characters.
  9. DBGrid displays SQL Server money field value with more than 4 digits after a decimal separator with FPC / Lazarus. This is due to the rounding error in FPC FloatToStrF function.
  10. XML DataSet format is supported only for Delphi Win32 and Win64.
See Also

Installing FireDAC, Using FireDAC

What do you think about this topic? Send feedback!


UnixODBC

UnixODBC
x Platform Development Send Feedback

FireDAC on the non-Windows platforms uses UnixODBC to access to the ODBC-based data sources.

Group

x Platform Development

Links
x Platform Development
Description

FireDAC on Linux, Mac OS X and other non-Windows platforms uses [image] UnixODBC to access to Microsoft SQL Server, IBM DB2, Sybase SQL Anywhere and other ODBC based data sources. Often UnixODBC must be installed additionally to the OS installation. That is different from Microsoft Windows, where ODBC manager is installed as part of OS installation.

FireDAC uses libodbc.dylib or .so dynamic library to get access to ODBC API. Normally it is located in /usr/local/lib folder.

UnixODBC may be downloaded as an archive with the sources ( [image] here) ( [image] more) and saved into some folder in your home directory. To install UnixODBC on Mac OS X use the commands:

gunzip unixODBC*.tar.gz
tar xvf unixODBC*.tar
export CFLAGS=-m32
./configure
make
sudo make install
What do you think about this topic? Send feedback!


Lazarus / FPC

Lazarus / FPC
x Platform Development Topics Send Feedback

FireDAC supports Lazarus / FPC. Lazarus / FPC enables application development for Windows, Linux, Mac OS, iOS and more.

Group

x Platform Development

Topics
Topic | Description
Installing on Windows | Describes the steps to install Lazarus, FPC and FireDAC on Windows.
Installing on Linux | Describes the steps to install Lazarus, FPC and FireDAC on Linux.
Links
x Platform Development, Topics
Description

The current release of "FireDAC for Delphi" provides Lazarus / FreePascal support for the platforms:

  • Windows x86 and x64;
  • Linux x86 and x64;
  • Mac OS X x86;
  • iOS.

The current release "FireDAC for Delphi" was compiled and tested with:

  • FPC 2.6.0;
  • Lazarus 0.9.30.4.

Note, because FPC and Lazarus / FPC libraries (RTL, LCL) have a not stable API, which often is not backward compatible, FireDAC is tested and supports only the exact specified Lazarus / FPC version.

Note, FPC 2.6.0 may return "Internal error: 200610054" when "Generate Debugging Info for GDB" (-g) or "Display Line Numbers in Run-time Error Backtraces" (-gl) options are enabled. The workaround is to turn them off.

Installing

To install FireDAC on Windows, Linux or Mac OS X, the FireDAC must be first installed on Windows using the standard FireDAC installer. We do not provide separate installer for Lazarus / FPC. FireDAC Trial version supports Windows x86 only. See additional articles for the platform specific instructions.

The Lazarus / FPC demos you can find at "FireDAC\Samples\FPC Specific" folder.

What do you think about this topic? Send feedback!


Installing on Windows

Installing on Windows
Lazarus / FPC See Also Send Feedback

Describes the steps to install Lazarus, FPC and FireDAC on Windows.

Group

Lazarus / FPC

Links
Lazarus / FPC, See Also
Description
Installing Lazarus on Windows

Download:

  • For Windows 32 bit development: lazarus-0.9.30.4-fpc-2.6.0-win32.exe
  • For Windows 64 bit development: lazarus-0.9.30.4-fpc-2.6.0-win64.exe

Install Lazarus and FPC using the downloaded installer.

Installing FireDAC on Lazarus

FireDAC on Windows uses the same installation and configuration as the Delphi installation. So, you will only need to:

  1. Run Lazarus IDE.
  2. Open FireDAC/Packages/AnyDAC_Dcl_FPC.lpk package.
  3. Press Install button.
See Also

Configuring Drivers, Defining Connection, Database Connectivity

What do you think about this topic? Send feedback!


Installing on Linux

Installing on Linux
Lazarus / FPC See Also Send Feedback

Describes the steps to install Lazarus, FPC and FireDAC on Linux.

Group

Lazarus / FPC

Links
Lazarus / FPC, See Also
Description
Installing Lazarus on Linux from repository

Read [image] the article for details.

Installing Lazarus on Linux using installer

Download for Linux 32 bit development:

  • fpc-2.6.0-1.i386.deb.tar
  • lazarus-0.9.30.4.i386.deb.tar

For 64 bits, please, use the corresponding 64 bit installers. Install Lazarus and FPC by hands:

  1. Optionally update and upgrade your Linux installation:

    sudo apt-get update
    sudo apt-get upgrade

  2. Optionally install Midnigth Commander, if you are not very comfortable with Linux command line:

    sudo apt-get install mc
    sudo mc

If you will not use MC, then run shell as root:

    sudo bash

  3. Create /opt/lazarus folder:

    mkdir /opt/lazarus
    cd /opt/lazarus

  4. Extract all tar's to /opt/lazarus:

    tar -xf <file name>

  5. Create a local installation repository:

    apt-get install dpkg-dev
    dpkg-scanpackages . /dev/null | gzip > Packages.gz
    echo "deb file:/opt/lazarus ./" >> /etc/apt/sources.list

  6. And install Lazarus

    apt-get install lazarus

Installing FireDAC in Lazarus

Install FireDAC on the file system, then perform the steps:

  1. Run Lazarus IDE.
  2. Select "Tools" -> "Configure 'Build Lazarus'". Specify -dUseCThreads in the "Options field". Press "Save settings" button.
  3. Open FireDAC/Packages/AnyDAC_Dcl_FPC.lpk package'
  4. Press Install button.
See Also

Configuring Drivers, Defining Connection, Database Connectivity

What do you think about this topic? Send feedback!


Migrating BDE applications

Migrating BDE applications
FireDAC Topics Send Feedback

This article guides you through a series of the steps to migrate the BDE application to the FireDAC.

Group

FireDAC

Topics
Topic | Description
BDE name counterparts | Most of BDE high-level types and components have counterparts in FireDAC.
BDE aliases migration | FireDAC has the BDE aliases migration function.
BDE application migration | An step-by-step example showing how to migrate BDE application to FireDAC.
Additional migration hints | Few additional BDE application migration considerations.
Links
FireDAC, Topics
Description
Introduction

This article provides a tutorial showing how to migrate a simple client-server application using BDE data access components, like TDatabase, TQuery, TTable to the FireDAC. It shows the basic principles of replacing the common components, properties and code, preserving the developers working time and avoiding the common migration pitfalls.

Overview

In general, the FireDAC components have a high compatibility level with the BDE data access components. This includes the syntax and semantic of the properties and methods in the FireDAC and BDE. But some parts are different:

  • BDE and FireDAC have components with different names. E.g. BDE - TQuery, FireDAC - TADQuery.
  • BDE and FireDAC have different alias/connection definition systems. BDE stores aliases in the binary system wide file IDAPI.CFG; the FireDAC stores the connection definitions in the ADConnectionDefs.ini file.
  • Some parameters for BDE SQLLink's and FireDAC drivers are different.
  • BDE and FireDAC may have the different data type mapping for the same RDBMS. FireDAC follows more close to the dbExpress data type mapping. However the FireDAC has powerful capabilities to adjust the data type mapping.
  • The base API's (the BDE API and the Phys interface) are absolutely incompatible. If you have some code which directly uses the BDE API, it has to be be recoded.
  • BDE and FireDAC have different heterogenous query syntax and capabilities. FireDAC offers Local SQL feature.

That is nearly all of what should be changed at migration from BDE to FireDAC. After the migration (or in parallel with it), you should consider to review your application for:

  • using the extended FireDAC functionality to simplify your application;
  • using the extended FireDAC functionality to extend the functionality of your application;
  • using the FireDAC options to fine tune your application and speed it up.
What do you think about this topic? Send feedback!


BDE name counterparts

BDE name counterparts
Migrating BDE applications Send Feedback

Most of BDE high-level types and components have counterparts in FireDAC.

Group

Migrating BDE applications

Links
Migrating BDE applications
Description

The following table lists the BDE names which have analogues in the FireDAC world:

BDE name | FireDAC name | FireDAC unit
TSession | TADManager | uADCompClient
TDatabase | TADConnection | uADCompClient
Alias* | ConnectionDef* |
Database* | Connection* |
Session | ADManager | uADCompClient
SessionName |  |
PrivateDir |  |
===== | ================= | =================
TQuery | TADQuery | uADCompClient
TStoredProc | TADStoredProc | uADCompClient
TTable | TADTable | uADCompClient
TUpdateSQL | TADUpdateSQL | uADCompClient
TBatchMove | TADDataMove | uADCompDataMove
===== | ================= | =================
TParam | TADParam | uADStanParam
TParams | TADParams | uADStanParam
TBlobStream | TADBlobStream | uADCompDataSet
TDBDataSet, TBDEDataSet | TADRDBMSDataSet | uADCompClient
EDBEngineError | EADDBEngineException | uADStanError

The full list you can find in <FireDAC>\Bin\BDE2FireDAC.txt file.

What do you think about this topic? Send feedback!


BDE aliases migration

BDE aliases migration
Migrating BDE applications Send Feedback

FireDAC has the BDE aliases migration function.

Group

Migrating BDE applications

Links
Migrating BDE applications
Description

FireDAC Explorer and FireDAC Administrator- both have the BDE aliases migration function. Run one of the applications and choose Connection -> Import BDE Aliases:

This dialog shows all your BDE aliases. Select the ones you like to migrate to the FireDAC. Click Overwrite existing connection definitions.... The existing FireDAC alias definitions with the same name as BDE aliases will be overwritten. In case you do not like to overwrite existing aliases you will get duplicates with names like "DBDEMOS_1". After pressing OK, FireDAC imports all BDE RDBMS's aliases supported by FireDAC.

FireDAC imports a new connection definition for every existing BDE alias in FireDAC. They will be placed into the connection definitions file.

What do you think about this topic? Send feedback!


BDE application migration

BDE application migration
Migrating BDE applications Send Feedback

An step-by-step example showing how to migrate BDE application to FireDAC.

Group

Migrating BDE applications

Links
Migrating BDE applications
Description

This example shows steps by step how the classic CodeGear demo application - MastApp - will be migrated to the FireDAC and Oracle DBMS.

Step 1

Create a new directory. For example, ADMastApp. Later we will reference to your new directory using the ADMastApp name. Then copy MastApp source files from the Delphi Demos directory to the new one created.

Step 2

Open a cmd window and change to the ADMastApp directory, or use your preferred directory manager, like FAR. Run the FireDAC transformation tool ADDFMChanger in order to replace the BDE terms with its FireDAC synonyms:

<ADHome>\Bin\ADDFMChanger.exe *.pas *.dfm -a -f <ADHome>\Bin\BDE2FireDAC.txt

Note, ADDFMChanger is not currently available in Embarcadero FireDAC v 7.0.1.

Step 3

Now search in all PAS's and DFM's for all properties and methods marked for removal. The simplest way to do so is to search for the removed string. In the MastApp the single place is the DataMod.dfm.

object Connection: TADConnection
  ...
  <SessionName removed> = 'Default'
  ...
end

Consider to remove such lines. In general, SessionName with different values may be a sign that your application requires multiple connections.

Step 4

Create an FireDAC connection definition using the FireDAC Explorer. Then setup connection definition parameters. This is the most simple connection definition for MastApp:

[MASTSQL]
DriverID=Ora
DataBase=ORA_920_APP
User_Name=ADDemo

NOTE: This implies that you have created an Oracle user ADDemo and loaded a DBDEMOS database (Paradox or Interbase) into the Oracle ADDemo user schema. For example, you can use the BDE's DataPump for uploading, but keep in mind that you will need to adjust the identifier registers - they must be UPPER CASE in Oracle.

Step 5

Add a RDBMS specific FireDAC driver to the application. Add one of the uADPhys[RDBMS driver ID] units to your project. E.g. if you use Oracle, add uADPhysOracle to the project. Then add unit ADGUIxFormsWait to your project:

program Mastapp;

uses
  Forms,
  uADPhysOracle,
  uADGUIxFormsWait,
  MAIN in 'MAIN.PAS' {MainForm},
  ......

Step 6

Now open the DataMod.dfm file using a text editor. Setup the TADConnection component in the data module. Set ConnectionDefName to an Oracle connection definition. Also change the user name and password to the correct one. You will then get something like this:

Params.Strings = (
  'ConnectionDef=Oracle_Demo'
  'User_Name=addemo'
  'Password=a')

Step 7

The Interbase SQLLink and FireDAC drivers have different data type mappings, so we should adjust that to make FireDAC type mapping compatible with BDE. Otherwise, we will need to recreate all persistent fields. To setup data mapping, we should fill up the collection property TADConnection.FormatOptions.MapRules. Lets do it in DataMod.DFM:

object Database: TADConnection
......
  FormatOptions.OwnMapRules = True
  FormatOptions.MapRules = <
    item
      PrecMax = 10
      PrecMin = 0
      ScaleMax = 0
      ScaleMin = 0
      SourceDataType = dtFmtBCD
      TargetDataType = dtInt32
    end
    item
      SourceDataType = dtFmtBCD
      TargetDataType = dtDouble
    end
    item
      SourceDataType = dtDateTimeStamp
      TargetDataType = dtDateTime
    end>
......
end

Additionally, set FormatOptions.StrsTrim and StrsEmpty2Null properties to False, as default values for these properties are incompatible with BDE.

Step 8

FireDAC does not support desktop DB's, like Paradox or Dbase. So, we have to remove all desktop DB (Paradox, Dbase) code from the application:

  • method TMastData.UseLocalData in DataMod.pas.
  • method TMainForm.ViewLocalClick in Main.pas
  • TField.Origin property in DataMod.dfm has the format: "TABLE.DB".FieldName. We will change that to the "TABLE".FieldName, where "TABLE" is the name of the original field DB table. In most cases we can just remove "TABLE" when the query is using only a single table.

Step 9

Now we should adjust the application source code to Oracle:

  • In the TMainForm.ViewRemoteClick method in Main.pas, replace string ' (Local Interbase)' with ' (Oracle)'.
  • Remove the TMainForm.ViewMenuClick handler in Main.pas.
  • Remove the TMastData.DataDirectory method in DataMod.pas.
  • The application creates a DB connection definition on the fly if it does not exist. So, change the TMastData.UseRemoteData in the DataMod.pas to:

procedure TMastData.UseRemoteData;
var
  Params: TStringList;
begin
  { See if the ConnectionDef exists.  If not, add it. }
  if not ADManager.IsConnectionDef('MASTSQL') then
  begin
    Params := TStringList.create;
    try
      Params.Values['DATABASE'] := 'APPOR920_LSNR';
      Params.Values['USER NAME'] := 'MASTAPP_DB';
      ADManager.AddConnectionDef('MASTSQL', 'ORA', Params);
    finally
      Params.Free;
    end;
  end;
  SetDatabaseConnectionDef('MASTSQL');
end;

  • We have to adjust the SQL commands used by applications. In DataMod query CustByLastInvQuery has the DESCENDING key word, but Oracle uses DESC.
What do you think about this topic? Send feedback!


Additional migration hints

Additional migration hints
Migrating BDE applications Send Feedback

Few additional BDE application migration considerations.

Group

Migrating BDE applications

Links
Migrating BDE applications
Description
Hint 1

Some properties should be removed completely, because FireDAC does not have the analogues:

  • SessionName should be removed completely. But be careful, your application may be using multiple same named connections in different sessions.
  • PrivateDir should be removed completely.

Hint 2

Although FireDAC has analogue to the BDE's TTable named TADTable, it is a good idea to replace all TTable's with TADQuery's right at the migration.

Hint 3

BDE application with persistent fields must be adjusted additionally. BDE does not provide or use persistent fields Origin and ProviderFlagsproperties, and queries DB dictionary to get the unique identifying fields. FireDAC provides and uses persistent fields Origin and ProviderFlags properties. When Origin is empty (as it is in BDE application), then FireDAC will use field name. But default value of ProviderFlags does not include pfInKey, and FireDAC will not query DB for PK fields. So, it will fail to get unique identifying fields and you must take one of the additional actions:

  • recreate persistent fields;
  • manually adjust ProviderFlags;
  • manually specify UpdateOptions.KeyFields.

Hint 4

Constructions, like a:

Screen.Cursor := crSQLWait;
try
  ......
finally
  Screen.Cursor := crDefault;
end;

Should be replaced with:

uses
  uADStanFactory, uADGUIxIntf;
  ......
var
  oWait: IADGUIxWaitCursor;
  ......
  ADCreateInterface(IADGUIxWaitCursor, oWait);
  oWait.StartWait;
  try
    ......
  finally
    oWait.StopWait;
  end;

Hint 5

FireDAC does not have a BDE API analogues. So, every code directly using the BDE API should be recoded using only FireDAC API. There is no direct solution.

Hint 6

Many third party products, like a reporting or m-tier libraries, require a DAC adapter unit. In most cases it exists for BDE and does not exists for FireDAC, while we are working to add most used ones. So, either develop one yourself (taking the BDE adapter as template), or contact us.

Hint 7

EDBEngineError is the BDE specific exception class. FireDAC has an analogue - the EADDBEngineException class. When handling the BDE exceptions, the programmer uses the ErrorCode property to get an error kind. FireDAC has the property kind, which returns an enumerated value.

For example, change the following code:

if E is EDBEngineError then
begin
  case EDBEngineError(E).Errors[0].ErrorCode of
    DBIERR_KEYVIOL: MetaBaseDBError(SMb_DataSetInvalidPKeyValue, E);
end;

into:

if E is EADDBEngineException then
begin
  case EADDBEngineException(E).Kind of
    ekUKViolated: MetaBaseDBError(SMb_DataSetInvalidPKeyValue, E);
end;

Hint 8

The TBatchMove and TADDataMove are very different in many ways. You will need serious rework on any advanced code using the TBatchMove.

Hint 9

The TADConnection.OnLogin event is incompatible with the TDatabase.OnLogin event parameters list. So, for example, you will need to replace the following handler:

procedure TMyDataModule.dbLogin(Connection: TDEConnection; LoginParams:
TStrings);
begin
  LoginParams.Values['USER NAME'] := 'me';
  LoginParams.Values['PASSWORD'] := 'pwd';
end;

with this one:

procedure TMyDataModule.dbLogin (AConnection: TADCustomConnection;
  const AConnectionDef: IADStanConnectionDef);
begin
  AConnectionDef.UserName := 'me';
  AConnectionDef.Password := 'pwd';
end;

Hint 10

When application uses BDE heterogeneous queries, then with FireDAC it should use Local SQL.

What do you think about this topic? Send feedback!


Debugging

Debugging
FireDAC Topics Send Feedback

A set of articles explaining how to debug FireDAC application.

Group

FireDAC

Topics
Topic | Description
DBMS Environment Reports | This article guides you through different FireDAC options of DBMS environment checking and reporting. Such report kind is a must for your customer support and the developer team.
Tracing and Monitoring | This article shows how to use FireDAC tracing and monitoring capabilities, which allows to see how an application is communicating with a database and is main FireDAC application debugging tool.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


DBMS Environment Reports

DBMS Environment Reports
Example Debugging See Also Send Feedback

This article guides you through different FireDAC options of DBMS environment checking and reporting. Such report kind is a must for your customer support and the developer team.

Group

Debugging

Links
Example, Debugging, See Also
Description
General

All developers and supporters know the moment a customer calls about his application not running properly. Normally, it takes several phone calls or emails to get all the necessary details about his environment. Often the customer does not even have all this information.

In general, a DBMS application may fail due to:

  • missing DBMS client libraries;
  • incorrect version of the DBMS client and/or server;
  • incorrect connection definition setup;
  • compatibility issues like an Unicode support.

FireDAC provides the necessary methods to report all these details:

  • Using the ADExplorer or ADAdministrator: use this tool to get the report of your persistent connection definition.
  • Using the TADConnection Design Time Editor: use the TADConnection design time editor to get the detailed report about a connection definition.
  • by Code: use Delphi code to integrate the reporting capabilities into your application.

Using the ADExplorer

The ADExplorer utility is the main tool to maintain the centralized persistent connection definitions. Please, read the ADExplorer reference for further details.

To get a detailed report for your persistent connection definition, run ADExplorer. Then choose a connection definition in the tree on the left side. On the right side click on the Info page. There you will see detailed environment report.

The report includes the sections:

  • Connection definition parameters - complete set of the connection definition parameters.
  • FireDAC info - details of your FireDAC build.
  • Client info - information about the DBMS client software, if it is properly installed and FireDAC is able to load it successfully. Otherwise - a failure error message.
  • Session info - information about the DBMS server and the user session, if FireDAC was able to open successfully the connection. Otherwise - a failure error message.

The next screen shot shows the report for a MySQL connection definition. In this case the DBMS client software was loaded and the connection was activated:

Using the TADConnection Design Time Editor

The TADConnection component design time editor is the environment to maintain temporary connection parameters. Double click any TADConnection component at design time. The FireDAC package will display the Connection Editor dialog.

Click on the Info page to get a detailed report for your connection definition. You will get a detailed environment report as described above. The only difference: if a TADConnection component is not connected, than the dialog will try to establish a temporary connection to a DBMS to fetch the server data.

The next screen shot shows the resulting report:

by Code

The FireDAC offers several possibilities to integrate the DBMS runtime information of your environment into your own project.

Call the GetInfoReport Method

You can start the DBMS report directly by calling the TADConnection.GetInfoReport method:

procedure TMainForm.Button1Click(Sender: TObject);
begin
  ADConnection1.GetInfoReport(mmInfo.Lines);
end;

This method is declared as:

procedure GetInfoReport(AList: TStrings; AItems: TADInfoReportItems);

The AItems flags meaning is:

  • riConnDef - include connection definition parameters into a report.
  • riFireDAC - include FireDAC build info into a report.
  • riClientLog - include DBMS client loading log.
  • riClient - include a DBMS client info into a report.
  • riSessionHints - include an FireDAC, DBMS client and server potential incompatibilities.
  • riSession - include a DBMS session info into a report.
  • riTryConnect - try to connect to a DBMS, if not already connected.
  • riKeepConnected - when method established a connection, then keep it active.
  • AList - Target string list to append the report.

Get the FireDAC Build Number

If you want to display the FireDAC build number (e.g. in the About box) than just refer to the CONST C_AD_Version in the uADStanConst unit. Example:

C_AD_Version = '5.0.2 (Build 1896)';

Get the DBMS version

To get a DBMS client and/or server version number (e.g. to switch on or off some feature in your application), use the TADConnection component and open the connection. Then use the following code sample, showing how to access the physical metadata:

procedure TMainForm.Button2Click(Sender: TObject);
var
  oMetaIntf: IADPhysConnectionMetadata;
begin
  // Get client and server versions
  oMetaIntf := ADConnection1.ConnectionMetaDataIntf;
  try
    ShowMessage(Format('Client version: %.10d; Server version: %.10d',
      [oMetaIntf.ClientVersion, oMetaIntf.ServerVersion]));
  finally
    oMetaIntf:= nil; // always release the Interface before you close the connection
  end;
end;

You can find many predefined DBMS version numbers in uADStanConst unit:

  • cvOracleXXX - for Oracle;
  • mvMySQLXXX - for MySQL;
  • svMSSQLXXX - for MSSQL;
  • svSQLiteXXX - for SQLite;
  • svPGSQLXXX - for PostgreSQL;
  • iv{IB|FB|YF}XXX - for Interbase / Firebird / Yaffil.

The DBMS version is represented in FireDAC by the LongWord value, consisting of the 5 groups of digits, where each group has 2 digits. Although, the leftmost group may have one single digit. For example, mvMySQL032321 = 0323210000. It corresponds to 3.23.21.0.0. This allows direct comparison of a client or server version with a constant:

if oMetaIntf.ServerVersion >= mvMySQL050000 then begin
  // execute MySQL 5.0 or higher specific SQL
end
else begin
  // execute pre-MySQL 5.0 SQL
end;
See Also

Tracing and Monitoring, TADConnection, ADExplorer

Example

<FireDAC>\Samples\Comp Layer\TADConnection\InfoReport

What do you think about this topic? Send feedback!


Tracing and Monitoring

Tracing and Monitoring
Debugging See Also Send Feedback

This article shows how to use FireDAC tracing and monitoring capabilities, which allows to see how an application is communicating with a database and is main FireDAC application debugging tool.

Group

Debugging

Links
Debugging, See Also
Description
General

FireDAC trace output is the detailed log of the communication between FireDAC application and the database software. It includes reference numbers, times, API calls, SQL sent to a database, data exchange with parameter and fields values, errors and warnings, and the DBMS environment report.

FireDAC offers 3 methods to output the trace, which are controlled by the different components and different MonitorBy values:

Component | MonitorBy value | Description
TADMoniFlatFileClientLink | FlatFile | Outputs trace to a flat text file. When application finishes, it will show the list of produced trace files.
TADMoniRemoteClientLink | Remote | Outputs trace to ADMonitor utility. Also allows to monitor the application. ADMonitor utility must be running before activating a trace output.
TADMoniCustomClientLink | Custom | Output trace to a custom event handler. Application should use OnOutput event handler to produce custom trace output.

The Moni components are singletons referring to a single instance of a corresponding tracer implementation. All connections with enabled trace output will use the same tracer and a single output for all connections will be produced.

Controlling tracing

To enable trace output for a connection:

  • Drop TADMoniXxxxClientLink component to a form.
  • Set it Tracing property to True.
  • Add MonitorBy=Xxx connection definition parameter.

The MonitorBy parameter associates the definition with a specific tracing method and becomes read-only after first connection is created for this definition. It should be set permanently.

TADMoniXxxxClientLink.Tracing property must be True before opening a first connection with MonitorBy=Xxx. Later to temporarily disable or enable tracing output for all connections, use TADMoniXxxxClientLink component Tracing property. Note, TADMoniXxxxClientLink should come before TADConnection in the data module or form creation order.

To initially disable trace output for a specific connection, use MonitorBy=Xxx-. To temporarily disable or enable tracing output for a specific connection, set ADConnection.ConnectionIntf.Tracing property. Note, that the ConnectionIntf is accessible only after connection is established.

For example:

ADMoniFlatFileClientLink.Tracing := True;

with ADConnection1.Params do begin
  Clear;
  Add('DriverID=SQLite');
  Add('Database=c:\test.sdb');
  Add('MonitorBy=FlatFile');
end;

ADConnection1.Connected := True;
...
// disable trace output for connection
ADConnection1.ConnectionIntf.Tracing := False;
...
// enable trace output for connection
ADConnection1.ConnectionIntf.Tracing := True;

The trace content

To control the trace content, use TADMoniXxxxClientLink.EventKinds property. The sample trace output:

    1385 15:47:14.093     >> Fetch [ATable="ADQA_FK_tab", Command="SELECT AF.fk_id, AF.id, AT1.f1, AT1.f2
FROM ADQA_FK_tab AF LEFT JOIN ADQA_tabwithpk AT1 ON AF.fk_id=AT1.f1"]
    1386 15:47:14.093          . sqlite3_column_type [stmt=$0F16E6B8, iCol=0, Result=SQLITE_NULL]
    1387 15:47:14.093          . sqlite3_column_type [stmt=$0F16E6B8, iCol=1, Result=SQLITE_INTEGER]
    1388 15:47:14.093          . sqlite3_column_int64 [stmt=$0F16E6B8, iCol=1, AValue^=2]
    1389 15:47:14.093          . sqlite3_column_type [stmt=$0F16E6B8, iCol=2, Result=SQLITE_NULL]
    1390 15:47:14.093          . sqlite3_column_type [stmt=$0F16E6B8, iCol=3, Result=SQLITE_NULL]
    1391 15:47:14.093          . sqlite3_step [stmt=$0F16E6B8]
    1392 15:47:14.093          . sqlite3_column_type [stmt=$0F16E6B8, iCol=0, Result=SQLITE_INTEGER]
    1393 15:47:14.093          . sqlite3_column_int64 [stmt=$0F16E6B8, iCol=0, AValue^=2]
    1394 15:47:14.093          . sqlite3_column_type [stmt=$0F16E6B8, iCol=1, Result=SQLITE_INTEGER]
    1395 15:47:14.093          . sqlite3_column_int64 [stmt=$0F16E6B8, iCol=1, AValue^=3]
    1396 15:47:14.093          . sqlite3_column_type [stmt=$0F16E6B8, iCol=2, Result=SQLITE_INTEGER]
    1397 15:47:14.093          . sqlite3_column_int64 [stmt=$0F16E6B8, iCol=2, AValue^=2]
    1398 15:47:14.093          . sqlite3_column_type [stmt=$0F16E6B8, iCol=3, Result=SQLITE_TEXT]
    1399 15:47:14.093          . sqlite3_column_text [stmt=$0F16E6B8, iCol=3, bytes=4]
    1400 15:47:14.093          . sqlite3_step [stmt=$0F16E6B8]
    1401 15:47:14.093          . profile [SQL="SELECT AF.fk_id, AF.id, AT1.f1, AT1.f2
FROM ADQA_FK_tab AF LEFT JOIN ADQA_tabwithpk AT1 ON AF.fk_id=AT1.f1", time=0]
    1402 15:47:14.093     << Fetch [ATable="ADQA_FK_tab", Command="SELECT AF.fk_id, AF.id, AT1.f1, AT1.f2
FROM ADQA_FK_tab AF LEFT JOIN ADQA_tabwithpk AT1 ON AF.fk_id=AT1.f1", RowsAffected=2]

There:

  • first number (1385-1402) is the line number, which may be used to reference the exact line;
  • timestamp is the local time, when the line was generated, which may be used to measure performance;
  • >> Xxxx - an FireDAC operation start. There parameters shows the command SQL text and other information;
  • << Xxxx - an FireDAC operation finish;
  • sqlite3_xxx - a DBMS API call (SQLite), which was performed to execute an FireDAC operation.

Flat file output

The TADMoniFlatFileClientLink component controls the flat text file output. By default the trace file name is automatically generated in the TEMP folder of your system. On termination an FireDAC application will show the list of the produced trace files.

To control output use properties:

  • FileName - the trace file name. There may be used environment variables - $(name). Default - $(TEMP)\traceN.txt.
  • FileEncoding - the trace file encoding. Default - ANSI.
  • FileAppend - when True, then existing trace file will be appended. Otherwise will be overwritten on each new run.
  • FileColumns - the columns to include into text file.

Remote output

The TADMoniRemoteClientLink component controls the remote trace output. Use ADMonitor utility to see the trace output. FireDAC uses TCP/IP as trace transport. That means that ADMonitor and application may run on different systems in a network. That may be actual for cross-platform development, where application may run on a Linux box and the ADMonitor must run on a Windows box.

To control output use properties:

  • Host - the IP address of ADMonitor box. Default is localhost.
  • Port - the IP port which ADMonitor is listening. Default is 8050.
  • Timeout - the maximum number of ms allowed to establish connection to ADMonitor.

Custom output

The TADMoniCustomClientLink component may be used to produce a custom trace output. For that application should define OnOutput event handler. It is up to the application what it will do there.

Note, avoid Application.ProcessMessages call in the OnOutput event handler, as it seriously reduces performance and may lead to weird issues (due to possible FireDAC reentering, which is not supported).

Monitoring

ADMonitor utility also supports the monitoring of the FireDAC objects state. The developers may use this functionality to enable monitoring for their own objects. See FireDAC\Samples\Moni Layer\Main demo for details.

Checking the SQL command text

There are few methods to see the SQL command text, as it will be sent to a database:

  • TADQuery.Text - returns SQL command text, as it will be sent to a database;
  • EADDBEngineException.SQL, Params - returns SQL command text, which leaded to an exception;
  • Use above tracing capabilities to see the SQL commands.

Checking the dataset rows

The dataset rows may be dumped using one of the methods:

  • DataSet.GetRow.DumpRow(True) - returns text representing current dataset row, including all field values and all field names;
  • DataSet.GetRow.DumpRow() - returns text representing current dataset row, including all field values;
  • DataSet.Table.Rows[i].DumpRow() - returns text representing dataset random row.
See Also

DBMS Environment Reports

What do you think about this topic? Send feedback!


Deploying

Deploying
FireDAC Topics Send Feedback

A set of articles explaining how to deploy a FireDAC application.

Group

FireDAC

Topics
Topic | Description
Delpoying on Windows | FireDAC application deployment on a x86 or x64 Windows machine includes several optional steps.
Delpoying on Mac OS X or Linux | FireDAC application deployment on a Mac OS X or a Linux machine includes several optional steps.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Delpoying on Windows

Delpoying on Windows
Deploying See Also Send Feedback

FireDAC application deployment on a x86 or x64 Windows machine includes several optional steps.

Group

Deploying

Links
Deploying, See Also
Description

To deploy FireDAC application on a Win32 or Win64 machine the following items should be considered:

  1. When an application uses persistent connection definitions, then a connection definition file must be deployed. It may be put along with application EXE or set TADCustomManager.ConnectionDefFileName to a file name.
  2. When an application uses driver definitions, then a driver configuration file must be deployed. It may be put along with application EXE or set TADCustomManager.DriverDefFileName to a file name.
  3. The DBMS clients required for application connectivity must be obtained from the vendors and installed on the deployment machine. When an application is built as x86, then the x86 DBMS client software must be installed. When as x64, then x64 software. SQLite engine is statically linked into EXE and does not require a deployment.
  4. FireDAC Administrator (analogue to BDE Administrator) may be deployed to give to an end-user a tool to manage FireDAC connection definitions. To deploy FireDAC Administrator one should deploy:
    • FireDAC\Bin\ADAdministrator.exe
    • FireDAC\Bin\ADExplorer.ini
  5. When a FireDAC application was built with the run-time packages, then the following BPL files should be deployed. There DNnn corresponds to your Delphi version. FireDAC provides only x86 BPL's. The BPL's are located in "Package output directory", which you may find at IDE -> Tools -> Options -> Delphi options -> Library.
    1. Mandatory packages:
      • AnyDAC_ComI_DNnn.bpl
      • AnyDAC_Comp_DNnn.bpl
      • AnyDAC_GUIxForms_DNnn.bpl
      • AnyDAC_Phys_DNnn.bpl
    2. Optional packages, required when your application uses specific FireDAC drivers:
      • AnyDAC_PhysADS_DNnn.bpl
      • AnyDAC_PhysASA_DNnn.bpl
      • AnyDAC_PhysDb2_DNnn.bpl
      • AnyDAC_PhysIB_DNnn.bpl
      • AnyDAC_PhysMSAcc_DNnn.bpl
      • AnyDAC_PhysMSSQL_DNnn.bpl
      • AnyDAC_PhysMySQL_DNnn.bpl
      • AnyDAC_PhysODBC_DNnn.bpl
      • AnyDAC_PhysOracl_DNnn.bpl
      • AnyDAC_PhysPg_DNnn.bpl
      • AnyDAC_PhysSQLite_DNnn.bpl
      • AnyDAC_PhysTDBX_DNnn.bpl
See Also

Defining Connection, Configuring Drivers, Database Connectivity, ADAdministrator

What do you think about this topic? Send feedback!


Delpoying on Mac OS X or Linux

Delpoying on Mac OS X or Linux
Deploying See Also Send Feedback

FireDAC application deployment on a Mac OS X or a Linux machine includes several optional steps.

Group

Deploying

Links
Deploying, See Also
Description

To deploy FireDAC application on a Mac OS X or a Linux machine the following items should be considered:

  1. When an application uses persistent connection definitions, then a connection definition file must be deployed. It may be put along with application executable or set TADCustomManager.ConnectionDefFileName to a file name. See additionally Installing FireDAC for Mac OS and Linux optional steps.
  2. When an application uses driver definitions, then a driver configuration file must be deployed. It may be put along with application executable or set TADCustomManager.DriverDefFileName to a file name. See additionally Installing FireDAC for Mac OS and Linux optional steps.
  3. The DBMS clients required for application connectivity must be obtained from the vendors and installed on the deployment machine. When an application is built as x86, then the x86 DBMS client software must be installed. When as x64, then x64 software.
See Also

Defining Connection, Configuring Drivers, Database Connectivity

What do you think about this topic? Send feedback!


Utilities

Utilities
FireDAC Topics Send Feedback

The list of the FireDAC utilities, their usage details and command line parameters. FireDAC utilities are located in FireDAC\Bin folder.

Group

FireDAC

Topics
Topic | Description
ADAdministrator | All about FireDAC Administrator.
ADDFMChanger | All about automatic BDE -> FireDAC migration utility.
ADExecutor | All about FireDAC SQL Script execution utility.
ADExplorer | All about FireDAC Explorer.
ADMonitor | All about FireDAC interactive application monitoring utility.
Compile (tool name).bat | All about automatic recompiling FireDAC packages.
Create (DB name).bat | All about automatic FireDAC demo database creation.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


ADAdministrator

ADAdministrator
Utilities See Also Send Feedback

All about FireDAC Administrator.

Group

Utilities

Links
Utilities, See Also
Description

The FireDAC Administrator is the major tool to manage the FireDAC connections. It has similar to ADExplorer functionality, but does not allow to browse database or work with SQL scripts. ADAdministrator may be distributed with application to give the administrators or to the users an ability to setup the database connections.

See Also

ADExecutor, ADExplorer, Database Connectivity

What do you think about this topic? Send feedback!


ADDFMChanger

ADDFMChanger
Utilities See Also Send Feedback

All about automatic BDE -> FireDAC migration utility.

Group

Utilities

Links
Utilities, See Also
Description

Note, ADDFMChanger is not currently available in Embarcadero FireDAC v 7.0.1.

General

The FireDAC ADDFMChanger is a console application, aided for semi-automatic:

  • conversion of a BDE application into an FireDAC application;
  • migration of an FireDAC application between two FireDAC versions, with incompatible API.

The idea behind ADDFMChanger is to replace names of BDE components and properties with appropriate FireDAC names.

Note: The ADDFMChanger utility and the BDE2FireDAC.txt files are located in the Bin sub-folder of the FireDAC installation folder.

Command Line Parameters

Run the ADDFMChanger utility without any arguments. It will output the following reference text:

DFM-Changer 2.3
Copyright (c) 2000-2013 by DA-SOFT Technologies (www.da-soft.com)
All Rights Reserved.

Use: ADDFMChanger {<filesToProcess>} [-s] [-i] [-a] -f <RuleFile>
-s - recurse subdirectories
-i - ignore errors
-f - path to filter files
-a - migrate all occurrences; otherwise, only components will be migrated

Example: ADDFMChanger x:\myDir\*.pas x:\myDir\*.dfm -s -a -f x:\MyRules.txt
changes all pas and dfm files in myDir incl. subdirs according x:\MyRules.txt

Usage

In the command line you define where the files to convert are located. The sample below illustrates the migration of all PAS and DFM files in the directory "x:\myDir\":

ADDFMChanger.exe x:\myDir\*.pas x:\myDir\*.dfm [...]

You also have to define the location of the rule file. The BDE->FireDAC rule file is located in Bin\BDE2FireDAC.txt:

ADDFMChanger x:\myDir\*.pas x:\myDir\*.dfm -s -a -f BDE2FireDAC.txt

The rule file consists of a few lines; each of them looking like:

[old name]    -> [new name]         -> [add this unit to interface USES clause]

There "unit" may be a coma separated list of the units. An example of a translation rule in the rule file is shown bellow:

[TStoredProc] -> [TADStoredProc]     -> [uADCompClient]

This will replace TStoredProc with TADStoredProc and add uADCompClient unit to USES clause.

The completion code

When the utility finishes conversion successfully, it returns exit code 0. Otherwise the exit code is > 0.

See Also

Migrating BDE applications

What do you think about this topic? Send feedback!


ADExecutor

ADExecutor
Utilities See Also Send Feedback

All about FireDAC SQL Script execution utility.

Group

Utilities

Links
Utilities, See Also
Description
General

FireDAC Executor is the major SQL script console execution tool, supporting many SQL scripting dialects. The ADExecutor supports:

  • standard SQL commands, like INSERT or SELECT;
  • stored procedure language commands, like CREATE PROCEDURE;
  • script execution control commands, like SPOOL, SET ECHO, etc., coming from Oracle SQL*Plus, Microsoft ISQL, and other script execution utilities, suplied by DBMS vendors.

FireDAC itself uses ADExecutor to build demo databases. Users can use ADExecutor as a ready-to-use tool to deploy database objects.

Command Line Parameters

Run Executor utility with -? argument. It outputs the following reference text:

FireDAC Executor v 3.0.1 (Build 1337)
(c) Embarcadero Technologies 2004-2013
http://www.embarcadero.com/products/rad-studio/firedac

Use: ADExecutor [-d <name>] [-n <file name>] [-u <user>] [-w <pwd>] [-l] [-e]
             [-i] [-s] [-p <path>] [-t <path>] [{<scripts>}] [-a {<arguments>}]

-d        - connection definition name
-n        - connection definitions file name
-u        - user name
-w        - password
-l        - login prompt
-p        - path to SQL script files
-t        - path to data files
-e        - stop script execution only after a "drop non-existing object" error
-i        - stop script execution after first error
-s        - do not show messages during SQL script execution (silent)
-a        - a list of script arguments
-? or -h  - show help

Notes:
1. If scripts are not specified, ADExecutor will read standard input.

Examples:
1. ADExecutor -d Oracle_Demo -i -p x:\MyScripts s1.sql s2.sql
Executes the s1.sql and s2.sql scripts from directory x:\MyScripts, using
the Oracle_Demo connection definition, does not stop on errors.
2. echo drop table mytab | ADExecutor -d MySQL_Demo
Executes the command captured from standard input.
See Also

ADExplorer, Database Connectivity, Demo Databases, Executing SQL Scripts, SQL Script Control Commands

What do you think about this topic? Send feedback!


ADExplorer

ADExplorer
Utilities See Also Send Feedback

All about FireDAC Explorer.

Group

Utilities

Links
Utilities, See Also
Description
General

The ADExplorer is a hierarchical database connection browser with data editing and SQL script execution capabilities. It is comparable to the "BDE Database Explorer". The ADExplorer enables you to:

  • Manage FireDAC default parameters;
  • Create, edit, load and save connection definition files;
  • Create, edit and delete connection definitions;
  • Browse database specific schema objects, including tables, fields, indexes, primary keys, stored procedure definitions or triggers;
  • View, append and edit data in existing tables;
  • Create, edit, load, save and execute SQL scripts to query, alter, test and deploy a database.

The ADExplorer utility is a standalone program and can be launched by:

  • The Delphi IDE menu (Tools -> FireDAC -> Explorer);
  • The FireDAC Startup menu.

Note: The ADAdministrator can also be used to maintain the connection definitions. It is comparable to the "BDE Admin". ADAdministrator is actually a restricted version of the ADExplorer that does not allow to run SQL commands or to browse or edit data. The Administrator is intended to be deployed together with your applications.

Manage the Default Parameters

Select the "Connection definitions" tree item to manage FireDAC default parameters:

  • Connection definition file - default name of the connection definition file;
  • Driver configuration file - default name of the driver configuration file.

If the specified values are default values for your workstation, the checkbox is marked. You can edit parameter values and mark the checkbox to save the new values. They will be stored in the registry key HKCU\da-soft\FireDAC.

Manage Connection Definition Files

When you run the ADExplorer, it opens and shows the content of the default connection definitions file. Use buttons or main menu items:

  • New ConnDef File: Creates a new empty connection definitions file.
  • Open ConnDef File: Opens an existing connection definitions file.

Manage the Connection Definitions

To manage connection definitions in the current open connection definitions file, use the toolbar buttons on the "Objects Explorer" pane:

  • Connection Definition (Ctrl+N): Creates a new empty connection definition.
  • Delete the current object (Ctrl+Del): Permanently deletes the currently selected connection definition.
  • Open current object (or click on plus sign in tree): Activates a connection to the database using the currently selected connection definition.
  • Close current object: Closes the connection to the database.
  • Rename current object (Ctrl+M): Renames the currently selected connection definition.
  • Save changes to current object (Ctrl+A): Permanently saves changes to the currently selected connection definition.
  • Cancel changes of current object (Ctrl+Backspace): Permanently cancels changes made to the currently selected connection definition.

Edit the Connection Definitions

To edit the connection definition, choose it in the tree. On the right you will see the Connection Definition Editor. It has three panes:

  • Definition: Allows you to edit the main connection parameters. First, select a Driver ID from the drop-down list on top. After that, the editor will become available for the selected driver parameters. For more information about the parameters see FireDAC Database Connectivity. After you finish editing, click the connection definition in the left tree again. Now the connection definition is modified, but the changes are not yet permanently stored in the connection definition file. Press Ctrl+A to store them.
  • Advanced: Allows you to edit advanced connection options.
  • Info: Shows all information associated with the current connection definition, including a full set of parameters and FireDAC version info. If the connection to the database is established, the page shows additional client and server information.

Note: Use the Info page to provide information to the FireDAC technical support team. Also, the following commands are accessible in the "Connection" menu:

  • Run Wizard (Ctrl+W): Runs the connection definition wizard, if it is implemented for the driver. Currently only Microsoft SQL Server, Microsoft Access, IBM DB2, Sybase SQL Anywhere and ODBC Bridge drivers implement the wizard.
  • Test (Ctrl+T): Tries to establish a connection to a DBMS without opening a connection definition node.
  • Make BDE Compatible (Ctrl+B): Applies a data type mapping schema, compatible with BDE, to the connection definition.
  • Import BDE Aliases: Allows you to import BDE aliases into the current connection definitions file.

And in "Help" menu:

  • Help Topics (F1): Opens a help topic with descriptions of the DriverID driver parameters.

Browse the Database Contents

To browse database specific schema objects, including tables, fields, indexes, primary key, stored procedure definitions, triggers, sequences, etc., select connection definition and open it. After that, you can drill down into the database structure. The exact set of accessible objects depends on the DBMS. To see the object metadata, select it in the tree and switch to the "Info" pane on the right.

To view, append and edit data in existing tables, select table or view in the tree and switch to the "Data" pane on the right. Use View -> Blob Viewer or double click on the DB grid cell to show the content (Text, Binary data, Image, HTML, etc) of a BLOB field.

Run a Query against a Database

To query, alter, test and deploy a database you can use a SQL Script window. Select the appropriate connection definition in the tree and open it. Use buttons or main menu items:

  • New SQL Script: Creates a new empty SQL script file.
  • Open SQL Script: Opens an existing SQL script file.

In the SQL script window use buttons on the window toolbar or main menu items:

  • Run Script (F9): Executes a script in full, from first to last command.
  • Run Command (F7): Executes the next command from the current cursor position in the SQL script editor.
  • Skip Command (Shift+F7): Skips the next command from the current cursor position in the SQL script editor.

See the ADExecutor description for a list of support script execution control commands, or just press F1.

See Also

ADExecutor, ADAdministrator, Database Connectivity, Defining Connection

What do you think about this topic? Send feedback!


ADMonitor

ADMonitor
Utilities See Also Send Feedback

All about FireDAC interactive application monitoring utility.

Group

Utilities

Links
Utilities, See Also
Description
General

The FireDAC Monitor is a debugging tool for:

  • Tracing a communication between an FireDAC application and a DBMS.
  • Exploring details of commands, parameters, states, execution statistic, etc.

FireDAC remote monitoring uses TCP/IP as a transport for application output. That means, Monitor may be running on the same or on another computer than the application itself. Also, single Monitor may receive output from many FireDAC applications. To enable monitoring for particular a connection definition, set its parameter "MonitorBy" to the value "Remote".

ADMonitor is an analog to the "BDE SQL Monitor".

See Also

Tracing and Monitoring

What do you think about this topic? Send feedback!


Compile (tool name).bat

Compile (tool name).bat
Utilities See Also Send Feedback

All about automatic recompiling FireDAC packages.

Group

Utilities

Links
Utilities, See Also
Description
General

The set of compile<tool name>.bat files allows you to automatically rebuild the FireDAC Win32 packages. That may be required, when you have:

  • updated FireDAC source files, received from Embarcadero;
  • changed FireDAC source files;
  • installed IDE Service Pack, which breaks package compatibility;
  • installed/removed/updated SynEdit.

Supported Tools
Tool | BAT file
Delphi 5 | compileD5.bat
C++ Builder 5 | compileBCB5.bat
Delphi 6 | compileD6.bat
C++ Builder 6 | compileBCB6.bat
Delphi 7 | compileD7.bat
Delphi 2005 | compileD2005.bat
Delphi 2006 | compileD2006.bat
Delphi / C++ Builder 2007 | compileD2007.bat
Delphi / C++ Builder 2009 | compileD2009.bat
Delphi / C++ Builder 2010 | compileD2010.bat
Delphi / C++ Builder XE | compileDXE.bat
Delphi / C++ Builder XE2 | compileDXE2.bat
Delphi / C++ Builder XE3 | compileDXE3.bat

Note: FireDAC does not support command line compiling for FPC or other than Win32 platforms. You should do that from the IDE.

Preconditions
  • Close the running IDE;
  • Close any running FireDAC applications built with run time packages;
  • If you have SynEdit installed/updated, then check:
    • SynEdit design time package must be installed into IDE;
    • path to the SynEdit source files must be included into Library Search Path;
    • file Bin\_noSynedit.txt does not exists;

Performed Actions

Each of batch files performs the following actions:

  • Detect current environment and generate configuration files:
    • Bin\_COMPILEENV.BAT;
    • Source\uADEnv.inc;
  • Recompile all packages;
  • Move DCU, OBJ to Lib\<tool name>;
  • Move BPL, DCP to Package and DCP Output Path's, specified in IDE.

Note: compile<tool name>.bat does not install FireDAC design time packages (AnyDAC_Dcl_<tool name>) into the IDE. If that is required, you should do that manually.

See Also

Programming Tools

What do you think about this topic? Send feedback!


Create (DB name).bat

Create (DB name).bat
Utilities See Also Send Feedback

All about automatic FireDAC demo database creation.

Group

Utilities

Links
Utilities, See Also
Description

The set of create<db name>.bat files allows to automatically create FireDAC demo database for appropriate database. See FireDAC Demo Databases for more details.

See Also

ADExecutor, ADExplorer, Demo Databases, Database Connectivity

What do you think about this topic? Send feedback!


Database Connectivity

Database Connectivity
FireDAC Topics Send Feedback

The list of the DBMS's supported by FireDAC and corresponding connection definition parameters.

Group

FireDAC

Topics
Topic | Description
Common connection parameters | Describes the connection definition parameters common for all FireDAC drivers.
Connect to Advantage Database Server | Describes how to connect to Advantage Database Server.
Connect to Blackfish SQL Server | Describes how to connect to Embarcadero Blackfish SQL Server.
Connect to DataSnap server | Describes how to connect to Multi-Tier DataSnap servers.
Connect to dbExpress data source | Describes how to connect to dbExpress data source.
Connect to IBM DB2 Server | Describes how to connect to IBM DB2 Server.
Connect to Interbase or Firebird | Describes how to connect to Firebird or Embarcadero Interbase Server's.
Connect to Microsoft SQL Server | Describes how to connect to Microsoft SQL Server.
Connect to Microsoft SQL Server Compact Edition | Describes how to connect to Microsoft SQL Server Compact Edition .
Connect to Microsoft Access database | Describes how to connect to Microsoft Access database files.
Connect to MySQL Server | Describes how to connect to MySQL Server.
Connect to ODBC data source | Describes how to connect to ODBC data source.
Connect to Oracle Server | Describes how to connect to Oracle Server.
Connect to PostgreSQL | Describes how to connect to PostgreSQL.
Connect to SQLite database | Describes how to connect to SQLite database files.
Connect to Sybase SQL Anywhere | Describes how to connect to Sybase SQL Anywhere.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Common connection parameters

Common connection parameters
Database Connectivity See Also Send Feedback

Describes the connection definition parameters common for all FireDAC drivers.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Parameter
Description
Example value
DriverID
The FireDAC base or virtual driver ID.
MySQL
MetaDefCatalog
Specifies the default catalog for the application. The design time code will omit the catalog name in the object names, if it is equal to MetaDefCatalog. If MetaDefCatalog is '*', then catalog names will be omitted unconditionally.
Northwind
MetaDefSchema
Specifies the default schema for the application. The design time code will omit the schema name in the object names if it is equal to MetaDefSchema. If MetaDefSchema is '*', then schema names will be omitted unconditionally.
dbo
MetaCurCatalog
Specifies the current catalog for the application. If not specified, then its value will be received from the DBMS. When an application is asking for metadata and do not specify a catalog name, then FireDAC will implicitly use the current catalog. If MetaCurCatalog is '*', then catalog names will be me omitted from the metadata parameters.
*
MetaCurSchema
Specifies the current schema for the application. If not specified, then its value will be received from the DBMS. When an application is asking for metadata and do not specify a schema name, then FireDAC will implicitly use the current schema. If MetaCurSchema is '*', then schema names will be me omitted from the metadata parameters.
*
MonitorBy
Specifies the trace / monitor output for this connection definition. One of the following values may be specified:
  • FlatFile. The trace output will be put to a text file. To enable that, include TADMoniFlatFileClientLink into your application and set it Tracing property to True. FireDAC will show the name of a trace file after an application is finished.
  • Remote. The trace output will be sent to the ADMonitor utility. As it may be used to monitor your application. To enable that, include TADMoniRemoteClientLink into your application and set it Tracing property to True. The ADMonitor must be run before connection will be established.
  • Custom. The trace output will be send to TADMoniCustomClientLink.OnOutput event handler. To enable that, include TADMoniCustomClientLink into your application and set it Tracing property to True.
FlatFile
Pooled
Enables connection pooling for this connection definition. The default value is False. To use pooled connection, the connection definition must be persistent or private.
True
See Also

Working with Metadata, Defining Connection, Multi Threading, Tracing and Monitoring

What do you think about this topic? Send feedback!


Connect to Advantage Database Server

Connect to Advantage Database Server
Database Connectivity See Also Send Feedback

Describes how to connect to Advantage Database Server.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports the Advantage Database Server v 8.0 or higher.

Windows client software

FireDAC requires the ACE32.DLL x86 or ACE64.DLL x64 client library (Advantage Client Engine API) for connecting to the Advantage server or to make a local connection. Ideally, the version should be equal to the server version. The full set of the v 10.0 client files:

  • ace32.dll
  • adsloc32.dll
  • aicu32.dll
  • axcws32.dll
  • adscollate.adm
  • adscollate.adt
  • ansi.chr
  • extend.chr
  • icudt40l.dat
  • adslocal.cfg

You can download the Advantage Client Engine API from [image] there. The installation folder includes "Redistribute" folder, containing all required redistributable files. The files may be put into a folder:

  • listed in your PATH environment variable;
  • your application EXE folder;
  • any other folder and specify in FireDAC\DB\ADDrivers.ini:

[ADS]
VendorLib=<folder>\ace32.dll

When the ADS client library has not been properly installed, then you will get an exception when you try to connect:

[FireDAC][Phys][ADS]-314. Cannot load vendor library [ACE32.dll].
The specified module could not be found.
Check it is located in one of the PATH directories or in the application EXE directory

Connection definition parameters

DriverID=ADS

Parameter
Description
Example value
ServerTypes
Value is a sum of values indicating the types of Advantage Servers to which connections are attempted. The values for the servers are:
  • ADS_REMOTE_SERVER = 2
  • ADS_LOCAL_SERVER = 1
  • ADS_AIS_SERVER = 4.
Also the keywords may be used instead of numbers:
  • Remote
  • Local
  • Internet
Few types may be concatenated by '|'. The default depends on the Server and Database values:
  • When they specify the local path with a driver letter, then "Local".
  • When a remote path, then "Remote" and "Internet".
For example, to allow the Driver to use the remote or local server, but not the Advantage Internet Server, use:ServerTypes=3 (1+2).
Protocol
Specifies the communication protocol used to connect to the Advantage Database Server:
  • UDP_IP;
  • IPX;
  • TCP_IP (default value);
  • TLS.
TCP_IP
Server
The server address.
\\ADS
Port
The server port.
6262
Database
The fully qualified path to the computer where the data files exist and the default location of the data files. This fully qualified path must contain a drive letter or use UNC. "Database" may include Server and Port values. For remote server types the path must either use UNC or refer to the existing network share.
For "free connections", it should be a valid path name to where the data files are located (e.g., x:\data). This path is used to automatically select all tables in the specified directory. For "database connections", it should be a valid path name including the Advantage Data Dictionary file name (e.g., x:\database\mydictionary.add).
c:\ads\data
\\ADS:6262\DB
Alias
Specifies the alias to be used when connecting to the database server. The file path associated with the specified alias will be used as the database directory. The table type associated with the alias will be set as the default table type for use with this connection. See [image] Database Aliases and the ads.ini File for a full description of an Alias.
CharacterSet
An optional collation language used when opening tables.
ANSI
Compress
Specifies the option for communications compression. Valid values are:
  • Internet;
  • Always;
  • Never.
Internet
TableType
Sets the type of database files to use:
  • ADT - Advantage-proprietary ADT/ADI/ADM files;
  • VFP - FoxPro-compatible DBF/CDX/FPT files;
  • CDX;
  • NTX.
This setting is ignored for database connections.
ADT
TablePassword
Specifies encryption password for all tables in the connection. Applicable for free connections only.
Locking
Specifies the locking mode to use when opening DBF tables. Valid values include:
  • Proprietary - Advantage’s high-performance internal locking mode is used;
  • Compatible - DBF tables can be shared in a writeable mode with non-Advantage database applications.
Proprietary
ADSAdvanced
Allows to specify any other additional ACE API [image] AdsConnect101 connection parameter value.
EncryptDictionary=True;DDPassword=qwe

Usage cases
  • Open local ADS database in "free connection" mode:

DriverID=ADS
Database=c:\ads\data

  • Open local ADS database in "free connection" mode with Visual FoxPro tables:

DriverID=ADS
Database=c:\ads\data
TableType=VFP

  • Open a remote data dictionary based connection:

DriverID=ADS
ServerTypes=Remote
Protocol=TCPIP
Database=\\DA\ADS_DB\addemo.add
User_Name=adssys
Password=a

  • Open local ADS database in "free connection" mode using an alias:

DriverID=ADS
Alias=MyConn

And the ads.ini content:

[Databases]
MyConn=c:\data;N
See Also

Common connection parameters, uADPhysADS Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to Blackfish SQL Server

Connect to Blackfish SQL Server
Database Connectivity See Also Send Feedback

Describes how to connect to Embarcadero Blackfish SQL Server.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Blackfish SQL Server Overview

FireDAC does not provide a native Blackfish SQL Server driver, but you can use the FireDAC TDBX Bridge driver to connect to the Blackfish SQL Server. You should use the TDBX (DBX 4) Framework and the Blackfish SQL driver, which comes with CodeGear RadStudio 2007 or higher.

Connect using the FireDAC TDBX Bridge

To connect to the Blackfish SQL Server do the following:

  • Open the file "C:\Documents and Settings\All Users\Documents\RAD Studio\dbExpress\dbxdrivers.ini". Find the [BlackfishSQL] section and modify it:
    • add "HostName=ServerName" ;
    • replace "Create=False" with "create=False".
  • Create a connection definition, similar to this example. Please note that the "create" parameter must be specified using lower case characters.

DriverName=BlackfishSQL
DriverID=TDBX
hostname=127.0.0.1
port=2508
database=c:\addemo
create=True
user_name=sysdba
password=masterkey

  • Drop a TADConnection component on the form.
  • Set ADConnection1.ConnectionDefName to My_BSQL.
See Also

Common connection parameters, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to DataSnap server

Connect to DataSnap server
Database Connectivity See Also Send Feedback

Describes how to connect to Multi-Tier DataSnap servers.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The Multi-Tier FireDAC DataSnap driver supports:

  • DataSnap servers built with RAD Studio 2007 and higher;
  • DataSnap clients built with RAD Studio XE2 Enterprise and higher.

Client software

FireDAC statically links Embarcadero DataSnap dbExpress driver, so no additional files and DLLs is required. Supported is RAD Studio XE2 Enterprise and higher.

Driver linkage

To link the DataSnap driver:

  • drop a TADPhysDataSnapDriverLink component from the "FireDAC Links" palette page;
  • or include the uADPhysDataSnap unit into an uses clause.

Connection definition parameters

To connect to the DataSnap server, most applications will need to specify DriverID, Protocol, Server, Port, User_Name, Password.

DriverID=DataSnap

Parameter
Description
Example value
Protocol
The protocol used to connect to the DataSnap server. It may be one of the following values:
  • TCP/IP. Connect using TCP/IP protocol. Is default protocol.
  • HTTP. Connect using HTTP protocol.
TCP/IP
Server
Server address to connect to.
127.0.0.1
Port
The TCP/IP or HTTP port on which the DataSnap server is listening. The default value for TCP/IP is 211, for HTTP - 8080.
211
User_Name
DataSnap server authentication user name.
Protocol
DataSnap server authentication user password.
BufferKBSize
Buffer size in kilobytes to use for read and write operations. The default value is 32Kb.
64
Filters
Client filters, used to store the filter configuration. The default value is empty.
URLPath
HTTP only. URL path used for HTTP DataSnap Service when http protocol is used. The default value is empty.
DatasnapContext
HTTP only. Path toward the DS HTTP Service, used to compose the URL. The current convention is: http://x.com/datasnap/provider/classname/method/params. The user may change or delete datasnap word from it. The default value is 'datasnap/'.
DSProxyHost
HTTP only. The host to proxy requests through, or empty string to not use a proxy. The default value is empty.
DSProxyPort
HTTP only. The port on the proxy host to proxy requests through. Ignored if DSProxyHost isn't set. The default value is empty.
DSProxyUsername
HTTP only. User name for proxy authentication. The default value is empty.
DSProxyPassword
HTTP only. Password for proxy authentication. The default value is empty.
DSAuthenticationScheme
HTTP only. DataSnap authentication scheme. Used in conjunction with DataSnap user name and password for authentication using the HTTP protocol. Set to "basic" in order to send User_Name / Password values using basic HTTP authentication, in addition to sending these values in the DBX connection string. Basic HTTP authentication may be used to pass credentials to an inter-process DataSnap HTTP tunnel server. The default value is empty.
LoginTimeout
HTTP only. Connect timeout value. The values provides the number of milliseconds the client waits for the connection to be possible. The value provides the time out for the first server response acknowledgment rather than for the entire connect/authenticate phase. It should be used in order to avoid application freeze when it may be possible to attempt connections to older DataSnap Server versions or different application that will not acknowledge current communication protocol. The default value is empty.
CommunicationTimeout
HTTP only. Timeout value in milliseconds for a response after the connection is established. The default value is empty.

Usage cases
  • Connect to local DataSnap server with default settings:

DriverID=DataSnap

  • Connect to DataSnap server using TCP/IP protocol running on local host:

DriverID=DataSnap
Protocol=tcp/ip
Server=127.0.0.1
Port=211
User_Name=dsusr
Password=123
See Also

Common connection parameters, uADPhysDataSnap Namespace, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to dbExpress data source

Connect to dbExpress data source
Database Connectivity See Also Send Feedback

Describes how to connect to dbExpress data source.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC DBX bridge driver supports:

  • dbExpress v 1-3, accessible in Delphi versions 6 - 2005;
  • dbExpress v 4 also called "DBX framework", accessible in Delphi 2007 and higher.

Windows client software

FireDAC requires that a dbExpress driver must be installed according to the topic "Deploying dbExpress Database Applications" of the Delphi/RAD Studio online help. Additionally you can find:

  • the portional list of accessible 3d party drivers [image] here;
  • dbExpress v 1-3 specification [image] here;
  • dbExpress v 4 overview [image] here.

Driver linkage

To link the dbExpress v 1-3 driver:

  • drop a TADPhysDBXDriverLink component from the "FireDAC Links" palette page;
  • or include the uADPhysDBExp unit into an uses clause.

To link the dbExpress v 4 driver:

  • drop a TADPhysTDBXDriverLink component from the "FireDAC Links" palette page;
  • or include the uADPhysTDBX unit into an uses clause.

Connection definition parameters

Connection definition parameters are specific for each driver and are taken from dbxdrivers.ini. The connection definition editor, after specifying the DriverName parameter, fills the connection parameter list by the parameters specific for this driver. Additionally, FireDAC DBX bridge driver supports the following parameters:

  • DriverID=DBX for dbExpress v 1-3;
  • DriverID=TDBX for dbExpress v 4.

Parameter | Description | Example value
MetaDefCatalog | Specifies the default catalog for the application. The design time code will omit the catalog name in object names if it is equal to MetaDefCatalog. | Northwind
MetaDefSchema | Specifies the default schema for the application. The design time code will omit the schema name in object names if it is equal to MetaDefSchema. | dbo

Usage cases
  • Connect to Blackfish SQL. Note the parameters case:

DriverID=TDBX
DriverName=BlackfishSQL
hostname=127.0.0.1
port=2508
database=c:\addemo
create=True
user_name=sysdba
password=masterkey

  • Connect to Oracle Database:

DriverID=TDBX
DriverName=Oracle
RDBMS=ORACLE
Database=ORA_920_APP
User_Name=addemo
Password=a

  • Connect to Informix Dynamic Server:

DriverID=TDBX
DriverName=Informix
HostName=ol_svr_custom
Database=sysuser
User_Name=informix
Password=informix2
See Also

Common connection parameters, uADPhysTDBX Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions, [image] Programming with dbExpress 4

What do you think about this topic? Send feedback!


Connect to IBM DB2 Server

Connect to IBM DB2 Server
Database Connectivity See Also Send Feedback

Describes how to connect to IBM DB2 Server.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports IBM DB2 Enterprise, Workgroup or Express editions version 8 and higher. We recommend v 8.2 at least. You can also work with other IBM database products, using FireDAC ODBC or DBX Bridge drivers.

Windows client software

FireDAC requires the "IBM DATA SERVER DRIVER for ODBC", "IBM DB2 ODBC DRIVER" or "IBM DB2 DRIVER FOR ODBC" x86 or x64 ODBC driver to be installed on the workstation. It may be downloaded from:

  • for x86;
  • for x64.

After downloading and unpacking run "<client>\bin\db2oreg1 -i" to install ODBC driver. Additionally, download and install fix packs.

When the DB2 ODBC driver has not been properly installed, you will get an exception when you try to connect:

[FireDAC][Phys][ODBC][Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Driver linkage

To link the driver:

  • drop a TADPhysDB2DriverLink component from the "FireDAC Links" palette page;
  • or include the uADPhysDB2 unit into the uses clause.

Connection definition parameters

There are two methods of specifying the DB2 connection attributes. If the DB2 client software has the DB2 connection aliases configured, an application should use the Alias parameter. If no aliases are configured, then you should use the Protocol, Server, Port and Database parameters. Also specify User_Name and Password.

DriverID=DB2

Parameter
Description
Example value
Alias
Connection alias.
MyDB2Srv
Server
Host name, if Alias is not specified.
127.0.0.1
Port
Port value, if Alias is not specified.
5000
Database
Database name, if Alias is not specified.
ADDEMO
Protocol
Protocol name, if Alias is not specified.
TCPIP
User_Name
The DB2 user name.
db2admin
Password
The DB user password.
Note, the passwords with both '{' and '}' are not supported.
master
LoginTimeout
Controls the amount of time in seconds an application waits for a connection attempt to timeout while waiting to establish a connection (0 specifies an infinite wait).
30
StringFormat
Defines how to represent String values:
  • Choose - represent as ftString / ftWideString / ftMemo / ftWideMemo, depending on the declared data type name (default);
  • Unicode - always represent as ftWideString / ftWideMemo.
Unicode
ODBCAdvanced
Allows to specify any other additional ODBC connection parameter value. The default value is "IGNOREWARNINGS=1".
MetaDefSchema
Default schema name. Design time code will exclude schema name from object name, if it is equal to MetaDefSchema.
db2admin

Usage cases
  • Connect to DB2 using existing database alias:

DriverID=DB2
Alias=addemo
User_Name=db2admin
Password=mypwd
MetaDefSchema=db2admin

  • Connect to DB using full connection information:

DriverID=DB2
Server=127.0.0.1
Database=addemo
Port=50000
Protocol=TCPIP
User_Name=db2admin
Password=mypwd
MetaDefSchema=db2admin
See Also

Common connection parameters, uADPhysDB2 Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to Interbase or Firebird

Connect to Interbase or Firebird
Database Connectivity See Also Send Feedback

Describes how to connect to Firebird or Embarcadero Interbase Server's.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports:

  • Embarcadero InterBase server version 6 and higher;
  • Firebird server version 1.5 and higher. Embedded edition is also supported.

FireDAC distinguishes these DBMS brands and adjusts its own behavior to the connected database. It does not officially support Jaffil.

Windows client software

FireDAC requires the following x86 or x64 client software to be installed on the workstation:

  • FBCLIENT.DLL library to connect to the Firebird server. You can take it from a server ( [image] download) installation Bin folder.
  • FBEMBED.DLL library to work with the database using the Firebird Embedded server ( [image] details).
  • GDS32.DLL library to connect to the InterBase server.

Note: It is critical to use the appropriate DLL for the DBMS client library. Do not use GDS32.DLL with Firebird or FBCLIENT.DLL with Interbase.

You can put the required files into a folder:

  • listed in your PATH environment variable (for example, <Windows>\SYSTEM32);
  • your application EXE folder;
  • any other folder and specify in FireDAC\DB\ADDrivers.ini:

[IB]
VendorLib=<folder>\fbclient.dll

When the Interbase or Firebird client library has not been properly installed, you will get an exception when you try to connect:

[FireDAC][Phys][IB]-314. Cannot load vendor library [gds32.dll]. The specified module could not be found.
Check [gds32.dll], which is located in one of the PATH directories or in the application EXE directory.

Linux client software

FireDAC requires:

  • the libfbclient.so x86 or x64 client library.

To install on Linux use the commands:

sudo apt-get update
sudo apt-get install libfbclient2
sudo ln -s /usr/lib/libfbclient.so.2.5.0 /usr/lib/libfbclient.so

Mac OS X client software

FireDAC requires:

  • the libfbclient.dylib x86 client library.

You can take it from a server ( [image] download) installation /Library/Frameworks/Firebird.framework/Libraries folder.

Driver linkage

To link the driver:

  • drop a TADPhysIBDriverLink component from the "FireDAC Links" component palette page;
  • or include the uADPhysIB unit into the uses clause.

Connection definition parameters

To connect to the Interbase or Firebird DBMS, most applications will need to specify DriverID, Protocol, Server, Database, User_Name, Password and CharacterSet.

We strongly recommend to explicitly set the CharacterSet to:

  • UTF8, if your application needs to support Unicode. See Unicode Usage (FireDAC) for details.
  • WIN1250 for Central Europe;
  • WIN1251 for Cyrillic;
  • WIN1252 for Western Europe, America;
  • etc

DriverID=IB

Parameter
Description
Example value
Database
The database name to attach. The value may be:
  • database file path;
  • full database path, including server address.
  • C:\ib\ADDEMO_IB2007.IB
  • 127.0.0.1:C:\ib\ADDEMO_IB2007.IB
  • \\MySrv\C:\ib\ADDEMO_IB2007.IB
OSAuthent
Controls authentication mode:
  • Yes - use windows authentication;
  • No - use DBMS authentication. It is the default value.
See the doc\README.trusted_authentication.txt for details.
Yes
User_Name
The user name.
sysdba
Password
The user password.
masterkey
CharacterSet
The character set to use.
WIN1252
ExtendedMetadata
Controls extended describing of the query result sets:
  • True - FireDAC is getting column domain names additionally to the other column attributes. If a column belongs to a domain with a name like %BOOL%, it will be described as a dtBoolean. Also, if a table has an INSERT trigger, which reads a single sequence and assigns it value to a single column, then this column will be described as auto-incrementing one. Setting this option to True will slightly slow down a dataset opening.
  • False - FireDAC uses the restricted information about the query columns. It is the default value.
False
Protocol
The protocol used to connect to the DB server. It may be one of the following values:
  • Local. Connect to a locally running server, to an embedded server or to a server using an alias.
  • NetBEUI. Connect using Microsoft NetBIOS protocol.
  • SPX. Connect using Novel SPX protocol.
  • TCPIP. Connect using TCP/IP protocol.
If the Protocol parameter is specified, FireDAC will build full database paths, using the appropriate Protocol format and Server and Database parameter values.
TCPIP
Server
Server address to connect to. Server parameter value is used only if the Protocol parameter is specified. To specify a TCP/IP port number use the <host>/<port> notation.
  • 127.0.0.1
  • my_host/3055
InstanceName
The Interbase 2007 instance name.
srv2
SQLDialect
The SQL Dialect to use for connecting. Three is the default value.
1
RoleName
The default role name.
Admin
CreateDatabase
Controls a new database create:
  • Yes - to create a new database file, specified in the Database parameter, right after connecting to the server.
  • No - do not create. It is the default value.
Yes
DropDatabase
Controls an existing database deletion:
  • Yes - to drop the database file, specified in the Database parameter, right after disconnecting from the server.
  • No - do not drop. It is the default value.
Yes
PageSize
The page size used for the newly created database, if CreateDatabase = Yes. 1024 is the default value.
4096
IBAdvanced
The ';' separated list of additional parameters. You can find the full list of supported parameters in the uADPhysIBWrapper unit, searching for the DPBInfos constant array. You can find the description of each Code listed there in the Interbase/Firebird manuals.

Usage cases

  • Connect to a database running on a remote server via TCP/IP protocol:

DriverID=IB
Database=C:\ib\ADDEMO_FB21.FB
Protocol=TCPIP
Server=IBSrv
User_Name=sysdba
Password=masterkey
CharacterSet=win1252
ExtendedMetadata=True

  • Connect to a database running on a remote server via TCP/IP protocol:

DriverID=IB
Database=IBSrv:C:\ib\ADDEMO_FB21.FB
User_Name=sysdba
Password=masterkey
CharacterSet=utf8

  • Connect to a local database:

DriverID=IB
Database=C:\ib\ADDEMO_FB21.FB
User_Name=sysdba
Password=masterkey
CharacterSet=win1251

  • Connect to a Firebird Embedded database:

Drop the TADPhysIBDriverLink component to the form and set its VendorLib to <your path>\fbembed.dll or use virtual driver definition.

DriverID=IB
Database=C:\ib\ADDEMO_FB21.FB
User_Name=sysdba
CharacterSet=utf8

  • Connect to a Interbase server using SSL:

For details on that see Chapter 5, starting in page 5-15 of the InterBase XE Operations Guide manual.

DriverID=IB
Database=my.interbasehost.net/3065?ssl=true?serverPublicFile=C:\PublicCertFileOnClient\CertFile.pem??:C:/DB/TEST.IB
User_Name=sysdba
Password=masterkey
CharacterSet=UTF8
ExtendedMetadata=True
See Also

Common connection parameters, uADPhysIB Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to Microsoft SQL Server

Connect to Microsoft SQL Server
Database Connectivity See Also Send Feedback

Describes how to connect to Microsoft SQL Server.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports Microsoft SQL Server Standard and Express editions version 2000 and higher, and Microsoft SQL Azure. See Connect to Microsoft SQL Server Compact Edition for an explanation of how to connect to Microsoft SQL Server Compact Edition.

Windows client software

FireDAC requires one of the Microsoft SQL Server x86 or x64 ODBC drivers to be installed on the workstation:

  • SQL Server ODBC driver as the connectivity for SQL Server 2000. Most probably, the ODBC driver is already installed on your workstation. If not, [image] see details.
  • SQL Native Client as the connectivity for SQL Server 2000 and 2005. We strongly recommend that you have SQL Native Client installed, if your application has to work with SQL Server 2005. See [image] Microsoft SQL Server Native Client.
  • SQL Server Native Client NN.N as the connectivity for SQL Server 2000, 2005, 2008, 2012 and SQL Azure. We strongly recommend that you have SQL Server Native Client NN.N installed, if your application has to work with SQL Server 2008, 2012 or SQL Azure. See [image] Microsoft SQL Server 2008 Native Client.
  • SQL Server Native Client 11.0 as the connectivity for LocalDB.

Note: SQL Server Native Client 10.0 (SQL Server 2008) may fail to call a stored procedure, when connected to SQL Server 2000. The symptom of this issue is the error message "Incorrect Syntax near to {". In this case use ODBC driver from SQL Server 2000 or 2005 distribution.

When the SQL Server ODBC driver has not been properly installed, you will get an exception when you try to connect:

[FireDAC][Phys][ODBC][Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Mac OS X client software

FireDAC requires:

  • the UnixODBC (libodbc.dylib) x86 ODBC driver manager library;
  • the FreeTDS (libtdsodbc.so) x86 ODBC driver.

FreeTDS may be got from CVS into some folder in your home directory ( [image] more 1) ( [image] more 2). To install FreeTDS on Mac OS X use the commands:

cvs -z3 -d:pserver:anonymous@freetds.cvs.sourceforge.net:/cvsroot/freetds checkout -P freetdsc
cd freetds
./autogen.sh
./configure --with-tdsver=8.0 --with-unixodbc=/usr/local
make
sudo make install
echo [FreeTDS] > tds.driver.template
echo Description=v0.82 with protocol v8.0 >> tds.driver.template
echo Driver=/usr/local/lib/libtdsodbc.so >> tds.driver.template
odbcinst -i -d -f tds.driver.template

Note, you may need additionally to install gawk utility. At this point you can configure a ODBC DSN or test FireDAC connection.

Note, FreeTDS ODBC driver is not that efficient and stable as the original Microsoft ODBC driver.

Driver linkage

To link the driver:

  • drop a TADPhysMSSQLDriverLink component from the "FireDAC Links" palette page;
  • or include the uADPhysMSSQL unit into the uses clause.

Connection definition parameters

To connect to the Microsoft SQL Server DBMS, most applications will need to specify DriverID, Server, Database, OSAuthent, User_Name and Password.

DriverID=MSSQL

Parameter
Description
Example value
Server
Name of a server running SQL Server on the network. The value must be either the name of a server on the network, or the name of a SQL Server Client Network Utility advanced server entry.
When you connect to the SQL Azure, you have to prepend server name with "tcp:" prefix.
Note: The alternative TPC/IP port may be specified after a server name, separated by the comma.
  • 127.0.0.1\SQLEXPRESS
  • SrvHost, 4000
  • tcp:nasdfert6.database.windows.net
Port
Only for Mac OS X. Specifies the port where SQL Server is listening.
For Windows platform the port may be specified after a comma in the Server parameter value. Eg Server=host, port. The default port is 1433.
Database
Name of the default database for the connection. If Database is not specified, the default database defined for the login is used.
Northwind
OSAuthent
Controls authentication mode:
  • Yes - use windows authentication.
  • No - DBMS authentication. This is default value.
No
User_Name
The SQL Server login name, if OSAuthent=No.
When you connect to the SQL Azure, you have to append "@<server>" suffix to your user name.
  • sa
  • addemo@nasdfert6
Password
The SQL Server login password, if OSAuthent=No.
Note, the passwords with both '{' and '}' are not supported.
Network
Name of a network library dynamic-link library. The name need not include the path and must not include the .dll file name extension.
dbnmpntw
Address
Network address of the server running an instance of SQL Server. Address is usually the network name of the server, but can be other names such as a pipe, or a TCP/IP port and socket address.
MARS
Controls the MARS - multiple active result sets support in a connection:
  • Yes - MARS is enabled for a connection. This is default value.
  • No - MARS is disabled.
The MARS is a feature supported by SQL 2005 and higher. It is not supported by SQL Azure. The enabled MARS may lead to fetch performance degradation. Please, read [image] this for more details.
No
Workstation
Workstation ID. Typically, this is the network name of the computer on which the application resides (optional). If specified, this value is stored in the master.dbo.sysprocesses column hostname and is returned by sp_who and the Transact-SQL HOST_NAME function.
Bookkeeper1
Language
SQL Server language name (optional). If connecting to a SQL Server with multiple languages, Language specifies which set of messages are used for the connection.
Encrypt
Controls the network traffic encryption:
  • Yes - network traffic will be encrypted.
  • No - no encryption is used. This is default value.
Yes
LoginTimeout
Controls the amount of time in seconds an application waits for a connection attempt to timeout while waiting to establish a connection. 0 specifies an infinite wait (default value).
30
VariantFormat
Controls SQL_VARIANT data type representation:
  • String - values will be represented as dtWideString. A string value is returned as a hex string, numbers as strings, etc. This is default value.
  • Binary - values will be represented as dtByteString with raw data presentation. A string value is returned as a string with original encoding, numbers in binary format, etc.
Binary
ExtendedMetadata
Controls extended describing of the query result sets:
  • True - FireDAC is getting a field origin table and column additionally to the other column attributes. Setting this option to True may slow down a dataset opening.
  • False - FireDAC uses the restricted information about the query columns. This is default value.
True
ApplicationName
Name of the application. If specified, this value is stored in the master.dbo.sysprocesses column program_name and is returned by sp_who and the Transact-SQL APP_NAME function.
AllBooks
ODBCAdvanced
Allows to specify any other additional ODBC connection parameter value.
MARS_Connection=no;Regional=yes
MetaDefCatalog
Default database name. Design time code will exclude catalog name from object name, if it is equal to MetaDefCatalog.
Northwind
MetaDefSchema
Default schema name. Design time code will exclude schema name from object name, if it is equal to MetaDefSchema.
dbo
MetaCaseIns
Controls metadata case-sensitivity:
  • True - case-insensitive metadata search will be used.
  • False - depends on the database collation. This is default value.
True

Usage cases
  • Connect to local SQL Server instance, using SQL Server authentication:

DriverID=MSSQL
Server=127.0.0.1
Database=Northwind
User_Name=sa
MetaDefSchema=dbo
MetaDefCatalog=Northwind

  • Connect to SQL Express 2005, using Windows authentication:

DriverID=MSSQL
Server=DA\SQLEXPRESS
Database=Northwind
OSAuthent=Yes
MARS=no

  • Connect to SQL Azure. Note the "@<server>" suffix in User_Name and "tcp:" prefix in Server parameters:

DriverID=MSSQL
Server=tcp:nasdfert6.database.windows.net
Database=Northwind
User_Name=addemo@nasdfert6
Password=asd123zxc
Encrypt=Yes
MetaDefSchema=dbo
MetaDefCatalog=Northwind

  • Connect to LocalDB:

DriverID=MSSQL
Server=(localdb)\\v11.0
Database=master
OSAuthent=Yes

  • Connect to LocalDB and attach database file:

Server=(localdb)\\v11.0
DriverID=MSSQL
ODBCAdvanced=AttachDbFileName=C:\\Users\\Alex\\ADDemo.mdf
See Also

Common connection parameters, uADPhysMSSQL Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to Microsoft SQL Server Compact Edition

Connect to Microsoft SQL Server Compact Edition
Database Connectivity See Also Send Feedback

Describes how to connect to Microsoft SQL Server Compact Edition .

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
General

Currently, FireDAC version 5.0 does not have a native Microsoft SQL Server CE driver, but you can use the FireDAC/DBX Bridge driver to connect to Microsoft SQL Server CE.

Note: Microsoft SQL CE is quite different from normal SQL Server's and doesn't have an ODBC driver. So it won't "just work" with the same FireDAC Microsoft SQL driver code base. New R&D will need to go into supporting Microsoft SQL CE in full.

For now though, you can work with database via the FireDAC/DBX Bridge. Working via the FireDAC/DBX Bridge, you still will be able to use all other general FireDAC features, like:

  • data type mapping
  • Array DML
  • SQL scripting
  • etc.

Connect using FireDAC/DBX Bridge

To connect to Microsoft SQL CE, do the following:

  • Download and install DevArt dbExpress driver for Microsoft SQL Server.
  • Create a connection definition, like this one:

[My_MSSQL_CE]
DriverID=TDBX
DriverName="SQLServer Compact"
Database=c:\mydb.sdf

  • Drop TADConnection to the form
  • Set ADConnection1.ConnectionDefName to My_MSSQL_CE
See Also

Common connection parameters, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to Microsoft Access database

Connect to Microsoft Access database
Database Connectivity See Also Send Feedback

Describes how to connect to Microsoft Access database files.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports the Microsoft Access 95, 97, 2000, 2003, 2007 and 2010 databases.

Windows client software

FireDAC requires one of the Microsoft Access x86 or x64 ODBC drivers to be installed on the workstation:

  • "Microsoft Access Driver (*.mdb)" x86 ODBC driver version 3 or higher (often referred to as the Microsoft JET ODBC Driver) for 95-2003 databases. See [image] details. You may also use one of the alternative drivers provided for non-English languages.
  • "Microsoft Access Driver (*.mdb, *.accdb)" x86 and x64 ODBC driver version 12 or higher for 95-2010 databases. See [image] details.

Note, to install an x86 or x64 Microsoft Access runtime on a workstation with already installed runtime with different bitness, specify "/passive" in the runtime installer command line. Because Delphi IDE is x86 application, you should install x86 Access version on your development workstation.

When the Microsoft Access ODBC driver has not been properly installed, you will get an exception when you try to connect:

[FireDAC][Phys][ODBC][Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

When trying to open a DB created with a newer Access version using an older Access driver, you will get an exception:

[FireDAC][Phys][ODBC][Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'.
It may not be a database that your application recognizes, or the file may be corrupt.

Linux and Mac OS X client software

FireDAC does not support Microsoft Access database connection on Linux, Mac OS X and iOS.

Driver linkage

To link the driver:

  • drop a TADPhysMSAccessDriverLink component from the "FireDAC Links" component palette page;
  • or include the uADPhysMSAcc unit into the uses clause.

Connection definition parameters

To connect to a Microsoft Access database, most applications will need to specify DriverID and Database.

Note, FireDAC supports the password protected databases, but the password length must less or equal to 14 characters. With a more long password an application will raise "Not a valid password" exception.

DriverID=MSAcc

Parameter
Description
Example value
Database
The path to the MDB file.
c:\mydb.mdb
SystemDB
The path to the system database file.
c:\mysystem.mdb
ReadOnly
Specify True to open a database in read-only mode. False is the default value.
True
StringFormat
Defines how to represent String values:
  • Choose - represent as ftString / ftMemo on non-Unicode Delphi (D2007 and lower) and ftWideString / ftWideMemo on Unicode Delphi (D2009 and higher) (default);
  • Unicode - always represent as ftWideString / ftWideMemo;
  • ANSI - always represent as ftString / ftMemo.
Unicode
ODBCAdvanced
Allows you to specify any other additional ODBC connection parameter value. The default value is "ExtendedAnsiSQL=1".
IMPLICITCOMMITSYNC=NO

Usage cases
  • Open Microsoft Access database

DriverID=MSAcc
Database=c:\mydata.mdb

  • Open the Microsoft Access database using the system database.

DriverID=MSAcc
Database=c:\mydata.mdb
SystemDB=c:\system.mdb
User_Name=usr
Password=pwd

  • Open the Microsoft Access password protected database. Note, the password length must be less or equal to 14 characters.

DriverID=MSAcc
Database=c:\mydata.mdb
Password=pwd

Note: to drop/create, encrypt, compact and repair the database use TADMSAccessUtility component.

See Also

Common connection parameters, uADPhysMSAcc Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to MySQL Server

Connect to MySQL Server
Database Connectivity See Also Send Feedback

Describes how to connect to MySQL Server.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports the MySQL Server Community, Enterprise and Embedded editions version 3.21 and higher.

Windows client software

FireDAC requires one of the following x86 or x64 libraries:

  • the LIBMYSQL.DLL client library for connecting to MySQL server. Ideally, the version should be equal to the server version.
  • the LIBMYSQLD.DLL embedded server library. See "MySQL Embedded server" chapter below.

You can take them from a server ( [image] details) installation Bin or Lib folders and put into a folder:

  • listed in your PATH environment variable (for example, <Windows>\SYSTEM32);
  • your application EXE folder;
  • any other folder and specify in FireDAC\DB\ADDrivers.ini:

[MySQL]
VendorLib=<folder>\libmysql.dll

When the MySQL client library has not been properly installed, you will get an exception when you try to connect:

[FireDAC][Phys][MySQL]-314. Cannot load vendor library [libmysql.dll]. The specified module could not be found.
Check [libmysql.dll], which is located in one of the PATH directories or in application EXE directory.

Linux client software

FireDAC requires:

  • the libmysqlclient.so x86 or x64 client library.

To install on Linux use the commands:

sudo apt-get update
sudo apt-get install libmysqlclient16
sudo ln -s /usr/lib/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so

Mac OS X client software

FireDAC requires:

  • the libmysqlclient.dylib x86 client library.

You can download it as Connector/C for Mac OS X ( [image] here). And extract it into /usr/local folder, using the command:

sudo tar -C /usr/local -zxvf mysql-connector-c-6.0.2-osx10.5-x86-32bit.tar

iOS client software

The article ( [image] more) explains how to build libmysqlclient.dylib for iOS.

Note, Embarcadero Technologies not tested that and do not provide assistance with that.

Driver linkage

To link the driver:

  • drop a TADPhysMySQLDriverLink component from the "FireDAC Links" component palette page;
  • or include the uADPhysMySQL unit into the uses clause.

Connection definition parameters

To connect to a MySQL DBMS, most applications will need to specify DriverID, Server, Database, User_Name, Password, CharacterSet.

DriverID=MySQL

Parameter
Description
Example value
Server
The TCP/IP address or host name of the server running a MySQL server.
127.0.0.1
Port
The TCP/IP port on which the MySQL server is listening.
3306
Database
Name of the current database for the connection. If the Database is not specified, no current database is set up.
MyDB
User_Name
The MySQL user ID.
root
Password
The MySQL user password.
CharacterSet
The default character set for the connection. The connection collation becomes the default collation of the character set. See the SET NAMES statement for details.
cp1251
Compress
Specify True to enable network traffic compression. By default, it is set to False.
UseSSL
Specify True to enable SSL connection. By default, it is set to False. Setting UseSSL=True requires additionally specify connection definition parameters:
  • SSL_key - is the path name to the key file;
  • SSL_cert - is the path name to the certificate file;
  • SSL_ca - is the path name to the certificate authority file;
  • SSL_capath - is the path name to a directory that contains trusted SSL CA certificates in pem format;
  • SSL_cipher - is a list of permissible ciphers to use for SSL encryption.
For additional details please check [image] MySQL documentation.
True
LoginTimeout
Controls the amount of time (in seconds) an application waits for a connection attempt to timeout while waiting to establish a connection.
30
ReadTimeout
The timeout in seconds for attempts to read from the server. Each attempt uses this timeout value and there are retries if necessary, so the total effective timeout value is three times the option value. You can set the value so that a lost connection can be detected earlier than the TCP/IP Close_Wait_Timeout value of 10 minutes. This option works only for TCP/IP connections and, prior to MySQL 5.1.12, only for Windows. By default, it is not set.
5
WriteTimeout
The timeout in seconds for attempts to write to the server. Each attempt uses this timeout value and there are net_retry_count retries if necessary, so the total effective timeout value is net_retry_count times the option value. This option works only for TCP/IP connections and, prior to MySQL 5.1.12, only for Windows. By default, it is not set.
5
ResultMode
Controls how to fetch a result set to a client. The default value is Store.
  • Store - fetches all rows right after query execution and stores them on a client, making the server process ready for new requests.
  • Use - rows will be fetched on demand of a client. While not all rows from the result set are fetched, the server cannot handle new requests. It allows to reduce memory usage on very big result sets.
  • Choose - FireDAC will automatically choose a mode. If the FetchOption.Mode is one of fmAll, fmExactRecsMax, then "Store", otherwise "Use".
Use
TinyIntFormat
Controls the TINYINT(1) representation. The default value is Boolean.
  • Boolean - TINYINT(1) columns will be represented as dtBoolean.
  • Integer - TINYINT(1) columns will be represented as dtSByte or dtByte.
Integer
MetaDefCatalog
Default database name. Design time code will exclude the catalog name from the object name if it is equal to MetaDefCatalog. Setting the MetaDefCatalog does not change the current database in the MySQL session.
MyDB

MySQL Embedded server

Major notes:

  1. All path argument values are using Unix back slashes. You can specify paths relatively to the application EXE folder, that will simplify deployment.
  2. libmysqld.dll and errmsg.sys must be of the same version.
  3. libmysqld.dll v 5.1.34, as probably some other versions, are broken and will not work. Update to other version.
  4. The general MySQL Embedded setup may be hard. For simplified setup see examples later.
  5. In case of incorrect arguments for libmysqld.dll initialization, the application may silently terminate.

To prepare your application to work with a MySQL Embedded server, you should take the following actions:

  • Include the TADPhysMySQLDriverLink component into your application. Note, "add argument" means "add argument to TADPhysMySQLDriverLink.EmbeddedArgs list". Optionally you can use driver configuration file.
  • Copy LIBMYSQLD.DLL to the application executable folder. If this folder differs from the application executable folder, add the --basedir=<LIBMYSQLD folder> argument. And set TADPhysMySQLDriverLink.VendorLib to <LIBMYSQLD folder>\LIBMYSQLD.DLL.
  • If only English messages are used, copy share\english\errmsg.sys to <LIBMYSQLD folder> and add the --language=<LIBMYSQLD folder> argument. If multiple language messages are used, copy appropriate folders from share\* to <LIBMYSQLD folder>, preserving directory structure. There is no need to add the --language argument, because <LIBMYSQLD folder>\share\* is the default location.
  • If the used character sets are different from ASCII, copy share\english\charsets to <LIBMYSQLD folder>, preserving directory structure. There is no need to add --character-sets-dir argument, because <LIBMYSQLD folder>\share\charsets is the default location.
  • If the database files are located in different folders than <LIBMYSQLD folder>, add the --datadir=<database files folder> argument.
  • If the InnoDB engine is not used, add the --skip-innodb argument. Otherwise add the --innodb_data_home_dir=<database files folder> argument, where the value is the InnoDB data space directory.
  • If your application will not connect to a remote MySQL server, add the --skip-networking argument.
  • If your application will use external settings file, add the --defaults-file=my.ini argument.
  • If your application will use MySQL plugins, add the --plugin_dir=<plugin folder> argument. Normally plugins are located in <LIBMYSQLD folder>\lib\plugin.
  • Add appropriate arguments to tune performance.

To connect to MySQL Embedded server you should not specify Server, Host, Port, User_Name, Password connection definition parameters. If you does not specify --skip-networking argument, then using libmysqld.dll you can connect to the remote MySQL servers, the same as with normal libmysql.dll.

Simple setup example:

  • Charsets: ASCII only
  • Messages: English only
  • Database: the EXE folder
App folder:
  <app>.EXE
  LIBMYSQLD.DLL
  errmsg.sys
  <DB files>
Arguments:
  --language=./
  --skip-innodb
  --skip-networking

Extended setup example:

  • Charsets: multiple
  • Messages: multiple
  • Database: "data" subfolder
App folder:
  <app>.EXE
  LIBMYSQLD.DLL
  share\*
  share\charsets
  data\*
  data\<DB files>
Arguments:
  --datadir=./data
  --skip-innodb
  --skip-networking

Usage cases
  • Connect to a locally running server, listening on the default (3306) port:

DriverID=MySQL
Database=addemo
User_Name=root
Password=

  • Connect to a remote server, listening on a non-default port, using Unicode for character data:

DriverID=MySQL
Server=mysrv
Port=3307
Database=addemo
CharacterSet=utf8
User_Name=me
Password=123

  • Connect to an embedded server, using Unicode for character data:

DriverID=MySQL
Database=addemo
CharacterSet=utf8

  • Connect to a remote server, using a SSL connection:

DriverID=MySQL
Server=mysrv
Port=3307
Database=addemo
UseSSL=True
SSL_ca=ca-cert.pem
SSL_cert=client-cert.pem
SSL_key=client-key.pem
See Also

Common connection parameters, uADPhysMySQL Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to ODBC data source

Connect to ODBC data source
Database Connectivity See Also Send Feedback

Describes how to connect to ODBC data source.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC ODBC bridge driver supports ODBC Level 2, 3 drivers.

Windows client software

FireDAC requires that the x86 or x64 ODBC driver must be installed according to ODBC specification. You can find:

  • the portional list of ODBC drivers [image] here.
  • the ODBC programming guide [image] here.

Linux and Mac OS X client software

FireDAC requires that UnixODBC must be installed. As the required ODBC drivers.

Driver linkage

To link the driver:

  • drop a TADPhysODBCDriverLink component from the "FireDAC Links" component palette page;
  • or include the uADPhysODBC unit into the uses clause.

Connection definition parameters

There are two basic ways to connect to the ODBC data source:

  • configure DSN using the ODBC Administrator control panel, then specify DSN name in the DataSource parameter;
  • set the ODBCDriver parameter value, then call Wizard.

Note, DataSource and ODBCDriver parameters are mutually exclusive. Each ODBC driver has its own set of connection parameters. They may be specified as the ODBCAdvanced parameter value.

DriverID=ODBC

Parameter | Description | Example value
ODBCDriver | The name of ODBC driver to use for connecting. If specified, other connection parameters must be specified in the ODBCAdvanced parameter. | SQL SERVER
ODBCAdvanced | Allows to specify ODBC connection parameter name=value pairs. They must be separated by ';'. |
DataSource | The name of the existing DSN to use for connecting. | MySAPDB
LoginTimeout | Controls the amount of time (in seconds) an application waits for a connection attempt to timeout while waiting to establish a connection (0 specifies an infinite wait). | 30
NumericFormat | Controls the internal NUMBER binding mode. The 'Binary' is the most effective mode (default). But some ODBC drivers do not support binary mode correctly. In this case set the parameter to 'String'. | String
MetaDefCatalog | Specifies the default catalog for the application. The design time code will omit the catalog name in object names, if it is equal to MetaDefCatalog. | Northwind
MetaDefSchema | Specifies the default schema for the application. The design time code will omit the schema name in object names, if it is equal to MetaDefSchema. | dbo

Usage cases

  • Connect to PostgreSQL:

DriverID=ODBC
User_Name=postgres
Password=marlboro
ODBCDriver=PostgreSQL ANSI
ODBCAdvanced=SERVER=localhost;PORT=5432;DATABASE=addemo

  • Connect to Sybase Adaptive Server Enterprise:

DriverID=ODBC
ODBCDriver=Adaptive Server Enterprise
ODBCAdvanced=server=da;port=5000;quotedidentifier=1
Database=addemo
User_Name=sa
MetaDefCatalog=addemo
MetaDefSchema=dbo

  • Connect to Informix Dynamic Server:

DriverID=ODBC
ODBCDriver=IBM INFORMIX ODBC DRIVER
User_Name=informix
Password=informix2
Database=sysuser
ODBCAdvanced=HOST=DA;SRVR=ol_svr_custom;SERV=svc_custom;PRO=olsoctcp;CLOC=en_US.CP1252;DLOC=en_US.819
See Also

Common connection parameters, uADPhysODBC Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to Oracle Server

Connect to Oracle Server
Database Connectivity See Also Send Feedback

Describes how to connect to Oracle Server.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports Oracle Enterprise, Standard (ex Workgroup) and Express (ex Personal) server editions version 8.0.3 and higher. Read "Using Oracle with FireDAC" chapter for detailed discussion of Oracle usage in FireDAC for Delphi application.

Windows client software

FireDAC requires one of the following Oracle x86 or x64 client software types to be installed on the workstation:

  • "Fat" Oracle Client ( [image] details). It requires the standard install procedure. The driver uses the client that is installed in the primary Oracle Home, if not specified explicitly.
  • "Thin" Oracle Instant Client ( [image] details). The driver uses the client, which is either copied into a folder in the PATH or into the application EXE folder, if not specified explicitly. See "Using Instant Client" below.

When the Oracle client software has not been properly installed, you will get an exception when trying to connect:

[FireDAC][Phys][Ora]-1309. OCI is not properly installed on this machine (NOE1/INIT)

Linux client software

FireDAC requires:

  • the libclntsh.so x86 or x64 client library.

To install on Linux read [image] the article.

Mac OS X client software

FireDAC requires:

  • the libclntsh.dylib x86 client library.

You can download it as Instant Client for Mac OS X ( [image] here) ( [image] more). Then extract and copy content to /usr/local/lib folder, using the commands:

sudo cp * /usr/local/lib
sudo ln -s /usr/local/lib/libclntsh.dylib.10.1 /usr/local/lib/libclntsh.dylib

You can put tnsnames.ora and sqlnet.ora to /etc folder, using the command:

sudo cp *.ora /etc

Driver linkage

To link the driver:

  • drop a TADPhysOracleDriverLink component from the "FireDAC Links" palette page;
  • or include the uADPhysOracle unit into an uses clause.

Connection definition parameters

To connect to an Oracle DBMS, most applications will need to specify DriverID, Database, User_Name and Password.

DriverID=Ora

Parameter
Description
Example value
Database
The value may be one of the following:
  • TNS alias name, specifying which database to connect to.
  • TNS connection descriptor, as it is in TNSNames.ora
  • Oracle connection string, as it is in SQL*Plus.
  • Oracle easy connect string, as it is described [image] here.
  • OraSrv
  • (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = OraSrv)(PORT = 1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = orcl)))
  • scott/tiger@OraSrv
  • system/manager@OraSrv as sysdba
  • OraSrv:1521/orcl
OSAuthent
Specify Yes to use OS authentification, and No to use the DBMS authentification.
No
User_Name
The Oracle user name, if OSAuthent=No
Scott
Password
The Oracle user password, if OSAuthent=No
tiger
AuthMode
The Oracle authentification mode:
  • Normal - standard user. Default value.
  • SysDBA - user with database administrator privileges.
  • SysOper - user with database operator privileges.
Normal
CharacterSet
The character set for the connection. If not specified, the NLS_LANG variable value will be used.
  • UTF8
  • cl8mswin1251
BooleanFormat
Defines how to represent Boolean values:
  • Integer - represents Boolean as Integer values, where False = 0 and True = 1. The default mode.
  • String - represents Boolean as String values, where False = 'F' and True = 'T'.
String
ApplicationName
Name of the application. If specified, this value is stored in the V$SESSION column MODULE.
AllBooks
OracleAdvanced
Additional Oracle session options. See the [image] ALTER SESSION SET chapter "Initialization Parameters and ALTER SESSION" paragraph for details. A value format is - <option>=<value>[;...].
NewPassword
Specifies new Oracle user password. FireDAC will connect to the DB using the old password and immediately change it to the new one.
tiger2
MetaDefSchema
Specifies the default schema for the application. The design time code will omit the schema name in object names if it is equal to MetaDefSchema.
SCOTT

Using Instant Client

To install Instant Client, download the Oracle Instant x86 or x64 client archive, unpack it and copy the files:

  • oci.dll
  • oraocci11.dll
  • oraociei11.dll
  • orasql11.dll

into your application EXE folder or into a folder in the PATH.

When you are using TNS names, put tnsnames.ora file into the same folder, or set TADPhysOracleDriverLink.TNSAdmin property value to a folder path with tnsnames.ora. Or use TNSAdmin driver configuration parameter.

Set TADPhysOracleDriverLink.NLSLang to the required value. Or use NLSLang driver configuration parameter.

Usage cases
  • Connect to a database using predefined TNS name (stored in tnsnames.ora):

DriverID=Ora
Database=ORA_920_APP
User_Name=ADDemo
Password=a

  • Connect to a database using host, port and instance name info:

DriverID=Ora
Database=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = OraSrv)(PORT = 1521)))
(CONNECT_DATA = (SERVER =    DEDICATED)(SERVICE_NAME = orcl)))
User_Name=ADDemo
Password=a

  • Connect to a local database as sysdba:

DriverID=Ora
User_Name=sys
AuthMode=sysdba

  • Connect to a database using TNS name and change the password:

DriverID=Ora
Database=ORA_920_APP
User_Name=ADDemo
Password=a
NewPassword=b

  • Connect to a database using easy connect string:

DriverID=Ora
Database=OraSrv:1521/orcl
User_Name=ADDemo
Password=a
See Also

Using Oracle with FireDAC, Common connection parameters, uADPhysOracle Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to PostgreSQL

Connect to PostgreSQL
Database Connectivity See Also Send Feedback

Describes how to connect to PostgreSQL.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports PostgreSQL Server version 7.4 and higher, because it requires a PG protocol 3.0 connection.

Windows client software

FireDAC requires the LIBPQ.DLL x86 or x64 client library for connecting to the PostgreSQL server. Ideally, the version should be equal to the server version. The full set of the v 9.0 client files:

  • libpq.dll
  • ssleay32.dll
  • libeay32.dll
  • libintl-8.dll
  • libiconv-2.dll

You can take them from the server ( [image] details) installation Bin folder and put into a folder:

  • listed in your PATH environment variable;
  • your application EXE folder;
  • any other folder and specify in FireDAC\DB\ADDrivers.ini:

[PG]
VendorLib=<folder>\libpq.dll

When the PostgreSQL client library has not been properly installed, then you will get an exception when you try to connect:

[FireDAC][Phys][PGSQL]-314. Cannot load vendor library [LIBPQ.DLL]. The specified module could not be found.
Check [LIBPQ.DLL], which is located in one of the PATH directories or in application EXE directory.

or

The ordinal Nnn could not be located in the dynamic link library SSLEAY32.dll.

Linux client software

FireDAC requires:

  • the libpq.so x86 or x64 client library.

To install on Linux use the commands:

sudo apt-get update
sudo apt-get install libpq-dev

Mac OS X client software

FireDAC requires:

  • the libpq.dylib x86 client library.

It comes preinstalled on Mac OS X or may be installed separately ( [image] more).

iOS client software

The article ( [image] more) explains how to build libpq.dylib for iOS.

Note, Embarcadero Technologies not tested that and do not provide assistance with that.

Driver linkage

To link the driver:

  • drop a TADPhysPgDriverLink component from the "FireDAC Links" palette page;
  • or include the uADPhysPG unit into an uses clause.

Additional setup

If an application is using {TIMESTAMPDIFF(MONTH, ....)} escape function, then we recommend to create 3 PostgreSQL functions with argument of types:

  • DATE;
  • TIMESTAMP;
  • TIMESTAMP WITH TIME ZONE.

The function template:

CREATE OR REPLACE FUNCTION MONTHS_BETWEEN (timestamp with time zone, timestamp with time zone) RETURNS integer AS
$body$
DECLARE
  mes INTEGER;
  mes1 INTEGER;
  ano INTEGER;
begin
  mes=extract(month from (age($1,$2)));
  ano=extract(year from (age($1,$2)));
  mes1=abs((ano*12) + mes);
  return mes1;
end
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

Connection definition parameters

To connect to a PostgreSQL DBMS, most applications will need to specify DriverID, Server, Database, User_Name, Password, CharacterSet.

DriverID=PG

Parameter
Description
Example value
Server
The TCP/IP address or host name of the server running a PostgreSQL server.
127.0.0.1
Port
The TCP/IP port on which PostgreSQL server is listening.
5432
Database
Name of the current database for the connection. If the Database is not specified, no current database is set up.
MyDB
User_Name
The PostgreSQL user ID.
postgres
Password
The PostgreSQL user password.
CharacterSet
The default character set for the connection. See the [image] Character Set Support chapter for details.
WIN1251
LoginTimeout
Controls the amount of time (in seconds) an application waits for a connection attempt to timeout while waiting to establish a connection.
30
ExtendedMetadata
Controls the extended describing of the query result sets:
  • True - FireDAC describes a result set to get all the possible column attributes - is nullable, is auto incrementing, to which domain belongs, etc. Setting this option to True, slightly slows down a dataset opening.
  • False - FireDAC uses the restricted information about the query columns (default).
False
OidAsBlob
Controls the interpretation of an OID column in a table:
  • No - an OID column is a dtUInt32 column (contains unsigned integer values);
  • Yes - an OID column is a dtHBlob column (contains Large Object values);
  • Choose - if a query selects a data from the dictionary tables or a column is not of a LO, LargeObject or BLOB domain, then an OID column is a dtUInt32 one, otherwise - dtHBlob one. The ExtendedMetadata option must be True to get a column domain (default).
Yes
UnknownFormat
Controls the handling of an unknown PostgreSQL data type:
  • Error - raise the exception "Cannot describe type" (default);
  • BYTEA - represent as a BLOB value.
BYTEA
ApplicationName
Name of the application. If specified, this value is stored in the pg_stat_activity table, application_name column.
AllBooks
PGAdvanced
Additional PostgreSQL server connection options. See the [image] Database Connection Control Functions chapter PQconnectdb paragraph for details. A value format is - <option>=<value>[;...].
MetaDefSchema
Default schema name. Design time code will exclude the catalog name from the object name, if it is equal to MetaDefSchema. Setting MetaDefSchema does not change the current schema search path in PostgreSQL session. A 'public' is the default value.
MySchema

Usage cases
  • Connect to a server running locally, listening on the default (5432) port:

DriverID=PG
Database=addemo

  • Connect to a remote server, listening on a non-default port, using Unicode for character data:

DriverID=PG
Server=pgsrv
Port=5433
Database=addemo
CharacterSet=utf8
MetaDefSchema=MySchema
ExtendedMetadata=True
See Also

Common connection parameters, uADPhysPG Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to SQLite database

Connect to SQLite database
Database Connectivity See Also Send Feedback

Describes how to connect to SQLite database files.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports SQLite database version 3.0 and higher.

Read "Using SQLite with FireDAC" chapter for detailed discussion of SQLite usage in FireDAC for Delphi application.

Windows client software

FireDAC supports two SQLite library linking modes:

  • Static linking: the x86 sqlite3_x86.obj or x64 sqlite3_x64.obj client library is statically linked into application. FireDAC provides sqlite3_Xxx.obj v 3.7.15. That is default mode, no additional files or actions is required.
  • Dynamic linking: the x86 or x64 SQLITE3.DLL client library must be available to open a SQLite database. The recommended SQLITE3.DLL versions is 3.7.7.1 or higher. That is default mode for x64.

You can download:

  • the latest x86 DLL version from [image] there, Chapter "Precompiled Binaries For Windows", item "This is a DLL" and put it into a folder listed in your PATH environment variable (for example, <System32> folder) or into your application EXE folder. FireDAC Installer installs SQLITE3.DLL v 3.7.15 into your windows\system32 folder.
  • the x64 DLL version from [image] there as "sqlite-netFx40-binary-x64-xxxxx.zip". Extract to a folder, copy SQLite.Interop.DLL into SQLITE3.DLL, then put it as above. FireDAC Installer installs x64 SQLITE3.DLL v 3.7.15 into your windows\system32 folder.

To choose linking mode, in FireDAC\Source\uAD.inc:

  • define AnyDAC_SQLITE_STATIC for static linking;
  • undefine AnyDAC_SQLITE_STATIC for dynamic linking.

When the SQLite client library has not been properly installed, you will get an exception when you try to connect:

[FireDAC][Phys][SQLite]-314. Cannot load vendor library [SQLITE3.DLL]. The specified module could not be found.
Check [SQLITE3.DLL], which is located in one of the PATH directories or in the application EXE directory.

Linux client software

FireDAC on Linux supports only dynamic linking and requires:

  • the libsqlite3.so x86 or x64 engine.

To install on Linux use the commands:

sudo apt-get update
sudo apt-get install sqlite3 libsqlite3-dev

Mac OS X client software

FireDAC on Mac OS X supports only dynamic linking and requires:

  • the libsqlite3.dylib x86 engine.

It comes preinstalled on Mac OS X. Note, the default Mac OS X libsqlite3.dylib is compiled with limited column metadata capabilities. As result, FireDAC may fail to detect column auto-incremental mode and optionality.

Driver linkage

To link the driver:

  • drop a TADPhysSQLiteDriverLink component from the "FireDAC Links" palette page;
  • or include the uADPhysSQLite unit into an uses clause.

Connection definition parameters

To connect to a SQLite database, most applications will need to specify DriverID and Database.

DriverID=SQLite

Parameter
Description
Example value
Database
A path to a database. The path value may include environment variables: $(<variable>).
Use ':memory:' or empty string to create and connect to empty in-memory database.
  • c:\MyApp\db.sdb
  • $(temp)\db.sdb
OpenMode
A mode to open a database:
  • CreateUTF8 - open a database to read or write. If the database does not exist, it will be created with the UTF8 default encoding (the default value for pre-Delphi 2009).
  • CreateUTF16 - open a database to read or write. If the database does not exist, it will be created with the UTF16 default encoding (the default value for Delphi 2009 and higher).
  • ReadWrite - open a database to read or write. If the database does not exist, an exception will be raised.
  • ReadOnly - open a database to read only. If the database does not exist, an exception will be raised.
ReadOnly
Encrypt
Specified a default encryption mode for a database. The mode may be overridden by an optional password prefix. If it is not specified, then will be used mode, specified by this parameter. Otherwise will be used aes-256. Please, read [image] this for more details.
Password
Specifies a password for an encrypted database. The value may have a form:
[ aes-128 | aes-192 | aes-256 | aes-ctr-128 | aes-ctr-192 | aes-ctr-256 | aes-ecb-128 | aes-ecb-192 | aes-ecb-256 :] <password>
There optional prefix controls the cipher algorithm to be used.
The default value is empty string, which means unencrypted mode.
  • aes-256:12345
  • qwe12345qwe
NewPassword
Specifies a new password for a database and performs an encryption operation:
  • to encrypt unencrypted database, specify non-empty NewPassword and empty Password;
  • to decrypt encrypted database, specify empty NewPassword and non-empty Password;
  • to change encrypted database password, specify non-empty NewPassword and non-empty Password.
BusyTimeout
Sets a "ms" milliseconds to sleep when a table is locked and UpdateOptions.LockWait is set to True. Zero means do not wait. The default value is 10000.
5000
CacheSize
Changes the maximum number of database disk pages that SQLite will hold in memory at once. Each page uses about 1.5K of memory. The default value is 10000.
10000
SharedCache
Enables or disables the SQLite shared cache feature. Please, read [image] this for more details. The default value is True.
False
LockingMode
Sets the database connection locking-mode. The value is one of:
  • Normal. This mode gives multi-user access to database files.
  • Exclusive. This mode gives maximum performance.
The default value is Exclusive, because it allows to get maximum read/write speed for single user applications.
Exclusive
Synchronous
Sets the database connection synchronization mode of in-memory cache with database files. The value is one of:
  • Full. Synchronizes at every critical moment.
  • Normal. As above, but less often.
  • Off. Gives maximum performance. This is the default value.
Off
ForeignKeys
Enables foreign key usage for the database connection, when the application is using SQLite v 3.6.19 or higher. The value is one of:
  • On. Foreign keys in a session are enabled. This is the default value.
  • Off. Foreign keys in a session are disabled.
Off
StringFormat
Defines how to represent String values:
  • Choose - represent as ftString / ftWideString / ftMemo / ftWideMemo, depending on the declared data type name (default);
  • Unicode - always represent as ftWideString / ftWideMemo;
  • ANSI - always represent as ftString / ftMemo.
Unicode
GUIDFormat
Defines how to store GUID values:
  • String - stores GUID as a character string value (default).
  • Binary - stores GUID as a binary string value.
Binary
DateTimeFormat
Defines how to store date and time values:
  • String - stores date and time as a character string value, using the YYYY-MM-DD and HH:MM:SS.XXX format (default).
  • Binary - stores date and time as a real number, which is a Julian date.
  • DateTime - stores date and time as a real number, which is a TDateTime value.
Binary
Extentions
Enables, disables or specifies the SQLite engine extensions to load:
  • True - enables extensions.
  • False - disables extensions (default).
  • Otherwise use a list of extensions to load in the form <library>[=<entry point][;...].
MyExt.dll;FullTS.dll
SQLiteAdvanced
Additional SQLite database connection options. See the [image] Pragma statements supported by SQLite for details.
auto_vacuum = 1;page_size = 4096;temp_store = FILE
MetaDefCatalog
Default database name. Design time code will exclude the catalog name from the object name, if it is equal to MetaDefCatalog. Setting MetaDefCatalog does not change the current database in the SQLite session. The default value is 'MAIN'.
MyDB

Usage cases
  • Connect to a local database in exclusive mode:

DriverID=SQLite
Database=$(ADHOME)\DB\Data\ADDemo.sdb

  • Connect to a shared database (it is not recommended to store SQLite databases on WinNT shared folders for multi user read-write access):

DriverID=SQLite
Database=\\srv\mydb.sqlite
LockingMode=Normal
Synchronous=Normal

  • Encrypt unencrypted database:

DriverID=SQLite
Database=$(ADHOME)\DB\Data\ADDemo.sdb
NewPassword=aes-256:123qwe

  • Open encrypted database:

DriverID=SQLite
Database=c:\temp\test.db
Password=123qwe

  • Connect to in-memory database:

DriverID=SQLite
Database=:memory:
See Also

Using SQLite with FireDAC, Common connection parameters, uADPhysSQLite Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


Connect to Sybase SQL Anywhere

Connect to Sybase SQL Anywhere
Database Connectivity See Also Send Feedback

Describes how to connect to Sybase SQL Anywhere.

Group

Database Connectivity

Links
Database Connectivity, See Also
Description
Supported versions

The FireDAC native driver supports Sybase SQL Anywhere version 5 and higher.

Windows client software

FireDAC requires one of the Sybase SQL Anywhere x86 or x64 ODBC drivers to be installed on the workstation:

  • "Adaptive Server Anywhere" ODBC driver to connect to v 5-7.
  • "SQL Anywhere N" ODBC driver, where N is the DBMS major version number (e.g. 8, 9, 10).

The preferred driver is "SQL Anywhere N". The ODBC driver is part of Sybase SQL Anywhere SDK. You can download it from [image] there.

When the SQL Anywhere ODBC driver has not been properly installed, you will get an exception when you try to connect:

[FireDAC][Phys][ODBC][Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

If your application is using SQL Anywhere service components, like a TADASABackup, then following DLL's additionally required to be installed on the workstations:

  • DBTOOL<N>.DLL;
  • DBLIB<N>.DLL.

There N is a version of your SQL Anywhere.

Mac OS X client software

FireDAC requires:

  • the UnixODBC (libodbc.dylib) x86 ODBC driver manager library;
  • the SQL Anywhere (libdbodbcNN.so) x86 ODBC driver.

SQL Anywhere client software for Mac OS X may be downloaded from [image] there. After installing:

  • add the following to /usr/local/etc/odbcinst.ini:

[SQL Anywhere]
Description=SQL Anywhere v 12
Driver=/Applications/SQLAnywhere12/System/lib32/libdbodbc12.dylib
Setup=/Applications/SQLAnywhere12/System/lib32/libdbodbc12.dylib
UsageCount=1

  • remove libodbcinst.dylib link from /Applications/SQLAnywhere12/System/lib32 folder, as it conflicts with UnixODBC libodbcinst.dylib. This action was recommended by Sybase development team.
  • run /Applications/SQLAnywhere12/System/bin32/sa_config.sh

Driver linkage

To link the driver:

  • drop a TADPhysASADriverLink component from the "FireDAC Links" component palette page;
  • include the uADPhysASA unit into the uses clause.

Connection definition parameters

To connect to a SQL Anywhere DBMS, most applications will need to specify DriverID, Server, Database, OSAuthent, User_Name and Password.

DriverID=ASA

Parameter
Description
Example value
Server
Specifies the name of a running database server to which you want to connect.
ASASrv
Database
Identifies a loaded database to which a connection needs to be made when connecting to a database that is already running.
OSAuthent
Controls authentication mode:
  • Yes - an integrated login is attempted;
  • No - the DBMS login is used. This is default value.
No
User_Name
Specifies the user ID used to log in to the database, if OSAuthent=No.
dba
Password
Specifies the user password used to log in to the database, if OSAuthent=No.
Note, the passwords with both '{' and '}' are not supported.
sql
DatabaseFile
Indicates which database file you want to load and connect to when starting a database that is not already running. If you want to connect to an already-running database, use the Database parameter.
Compress
Controls network traffic compression:
  • Yes - to turn compression on for a connection;
  • No - to turn compression off. This is the default value.
Yes
Encrypt
Encrypts packets sent between the client application and the server using transport-layer security or simple encryption. The value syntax is { NONE | SIMPLE | TLS( TLS_TYPE=cipher; [ FIPS={ Y | N }; ] TRUSTED_CERTIFICATES=public-certificate ) }
  • tls(tls_type=rsa;fips=n;trusted_certificates=rsaserver.crt)
  • simple
LoginTimeout
Controls the amount of time (in seconds) an application waits for a connection attempt to timeout while waiting to establish a connection (0 specifies an infinite wait).
30
ApplicationName
Assists administrators in identifying the origin of particular client connections from a database server. The string can be retrieved using the statement: SELECT CONNECTION_PROPERTY('AppInfo')
AllBooks
ODBCAdvanced
Allows to specify any other additional ODBC connection parameter value. The default value is "CommLinks=ShMem,TCP". Please note that, if CommLinks is specified, the server will not auto start.
AutoStart=Yes;CharSet=Windows-1251
MetaDefCatalog
Default database name. Design time code will exclude the catalog name from the object name if it is equal to MetaDefCatalog.
addemo
MetaDefSchema
Default schema name. Design time code will exclude the schema name from the object name if it is equal to MetaDefSchema.
dba

Usage cases

Auto start local server and open database file "C:\sybase\addemo_asa10.db":

DriverID=ASA
ODBCAdvanced=AutoStart=Yes
DatabaseFile=C:\sybase\addemo_asa10.db
User_Name=dba
Password=sql
MetaDefSchema=dba

  • Connect to a default local server

DriverID=ASA
User_Name=dba
Password=sql
MetaDefSchema=dba

  • Connect to the database ADDemo, running on server instance ASASrv:

DriverID=ASA
Server=ASASrv
Database=ADDemo
User_Name=dba
Password=sql
MetaDefSchema=dba

  • Connect to the database ADDemo, running on the server instance ASASrv in another network:

DriverID=ASA
ODBCAdvanced=CommLinks=tcpip(host=227.12.66.1)
Server=ASASrv
Database=ADDemo
User_Name=dba
Password=sql
MetaDefSchema=dba
See Also

Common connection parameters, uADPhysASA Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions

What do you think about this topic? Send feedback!


FAQ

FAQ
FireDAC Topics Send Feedback

The list of FireDAC related frequently asked questions.

Group

FireDAC

Topics
Topic | Description
Installation | The list of questions and answers related to FireDAC installation.
General Questions | The list of general questions and answers.
TADManager and TADConnection Questions | The list of questions and answers related to TADManager and TADConnection.
TADQuery, TADStoredProc and TADUpdateSQL Questions | The list of questions and answers related to TADQuery, TADStoredProc and TADUpdateSQL.
TADTable Questions | The list of questions and answers related to TADTable.
TADMemTable Questions | The list of questions and answers related to TADMemTable.
Fetching and Populating Questions | The list of questions and answers related to fetching records and populating datasets.
Sorting, Searching, Locating, Filtering Questions | The list of questions and answers related to sorting, searching, locating, filtering datasets.
Editing Questions | The list of questions and answers related to data editing.
GUI Questions | The list of questions and answers related to the FireDAC GUI.
SQL Scripts Questions | The list of questions and answers related to the SQL Script execution.
Metadata Questions | The list of questions and answers related to the metadata retrieval.
Debugging and Reporting Environment Questions | The list of questions and answers related to the debugging and reporting environment.
Integration with 3d Party Products Questions | The list of questions and answers related to integration with 3d party products.
Firebird and Interbase Servers Questions | The list of questions and answers related to Firebird and Interbase Servers.
MS SQL Server Questions | The list of questions and answers related to MS SQL Server.
Oracle Server Questions | The list of questions and answers related to Oracle Server.
SQLite Database Questions | The list of questions and answers related to SQLite Database.
MySQL Server Questions | The list of questions and answers related to MySQL Server.
MS Access Questions | The list of questions and answers related to MS Access.
Links
FireDAC, Topics
What do you think about this topic? Send feedback!


Installation

Installation
FAQ Send Feedback

The list of questions and answers related to FireDAC installation.

Group

FAQ

Links
FAQ
Description
QI1: FireDAC fails to install and gives compilation errors, referring to TDBX or DBX. That is dbExpress stuffs, which I does not need. How to completely disable dbExpress usage ?

A: Install the FireDAC packages into IDE by hands. For that do:

  • install FireDAC using the installer. At installation unmark all options at "Install in IDE" page;
  • go to FireDAC\Bin folder;
  • run there updateEnv.bat;
  • run Delphi IDE;
  • choose Tools -> Options -> Delphi Options -> Library;
  • verify, and add if required, the FireDAC\Source path to "Library path";
  • open FireDAC\Source\uAD.inc;
  • locate there line with {$DEFINE AnyDAC_DBX};
  • replace the line with {.$DEFINE AnyDAC_DBX} (dot between { and $ is added);
  • save the uAD.inc;
  • open FireDAC\Packages\AnyDAC_DXxxx.bpg or .bdsgroup or .groupproj;
  • remove the AnyDAC_PhysTDBX_DXxxx.dpk or AnyDAC_PhysDBX_DXxxx.dpk from the project group;
  • save project group;
  • compile all packages in the group;
  • right click on AnyDAC_Dcl_DXxxx.dpk and choose "Install".

QI2: How to recompile FireDAC packages ?

A: Do the following:

  • close Delphi IDE;
  • with Windows Vista, 7 or newer run console in administrator mode:
    • press the "Start" button;
    • type CMD;
    • select CMD and press CTRL+SHIFT+ ENTER;
    • a User Account Control box pop up, confirm this;
  • otherwise with Windows XP or when you are logged as administrator:
    • press the "Start" button;
    • type CMD;
    • press ENTER;
  • go to FireDAC\Bin folder. Normally run:
    • CD "c:\Program Files\da-soft\FireDAC for Delphi\Bin"
  • run there compileXxxx.bat, appropriate to your Delphi / C++ Builder version;

Finished. Now you can run IDE again.

QI3: How to install FireDAC into IDE by hands ?

A: Do the following:

  • install FireDAC using the installer. At installation unmark all "Build binaries".
  • go to FireDAC\Bin;
  • run there updateEnv.bat;
  • run Delphi IDE;
  • choose Tools -> Options -> Delphi Options -> Library;
  • verify, and add if required, the FireDAC\Source path to "Library path";
  • open FireDAC\Packages\AnyDAC_DXxxx.bpg or .bdsgroup or .groupproj;
  • compile all packages in the group;
  • right click on AnyDAC_Dcl_DXxxx.dpk and choose "Install".

QI4: How to install FireDAC on Linux ?

A: Read the "Lazarus / FPC" article.

QI5: I got an archive with sources from the Embarcadero support. How to install it ?

A: Do the following:

  • extract archive to FireDAC\Source folder. Do not remove the original folder content;
  • mark FireDAC\Source\sqlite3_x86.obj and sqlite3_x64.obj as read-only. For that you can run "attrib +r sqlite3*.obj" command in FireDAC\Source folder;
  • now recompile FireDAC packages. For that see QI2.

QI6: I have XE2 Starter Edition and FireDAC fails to install and gives compilation errors, referring to AnyDAC_ComI_D16 package. How can I install it ?

A: Do the following:

  • install FireDAC using the installer. At installation unmark all "Build binaries".
  • go to FireDAC\Bin;
  • run there updateEnv.bat;
  • run Delphi IDE;
  • choose Tools -> Options -> Delphi Options -> Library;
  • verify, and add if required, the FireDAC\Source path to "Library path";
  • open FireDAC\Source\uAD.inc;
  • locate there line with {$DEFINE AnyDAC_DBX};
  • replace the line with {.$DEFINE AnyDAC_DBX} (dot between { and $ is added);
  • save the uAD.inc;
  • open FireDAC\Packages\AnyDAC_Dcl_D16Starter.dpk;
  • compile the package;
  • right click on AnyDAC_Dcl_D16Starter.dpk and choose "Install".

QI7: I installed trial version, but I does not see FireDAC components. How to install FireDAC ?

A: Do the following:

  • Verify, that corresponding Delphi version binaries are check at installation.
  • If was not checked, then reinstall FireDAC and check corresponding option.
  • If was checked, then verify in Delphi IDE -> Component -> Install Packages, that "da-soft FireDAC design time ...." is in the list;
  • If in the list, but not enabled, then enable it. If successfully enabled, then you are done !
  • If not in the list, then check FireDAC\Dcu\DXxxx folder - does it have *.bpl and *.dcp files ?
  • If yes, then move (the paths may differ for your environment):
    • *.bpl to "C:\Documents and Settings\All Users\Documents\RAD Studio\Xxxx\Bpl\" (1)
    • *.bpi, *.dcp, *.lib to "C:\Documents and Settings\All Users\Documents\RAD Studio\Xxxx\Dcp\" (2)
  • In Delphi IDE choose Component -> Install Packages -> Add, then choose AnyDAC_Dcl_DXxx.bpl from the (1) folder and press Ok.
What do you think about this topic? Send feedback!


General Questions

General Questions
FAQ Send Feedback

The list of general questions and answers.

Group

FAQ

Links
FAQ
Description
QG1: Is there 'Getting Started Guide' (aka 'Quick Start Guide') for FireDAC?

A: First Steps to use FireDAC

QG2: What is the difference between trial and full versions?

A: FireDAC Trial version:

• does not include the library source code files;

• an FireDAC application shows "nag" screen on start, if a Delphi IDE is not running.

QG3: Is FireDAC thread safe?

A: Yes, it is. Read Multi Threading for more details.

QG4: How to handle with Exceptions?

A: Read Handling Errors for details. And the code sample:

uses
  uADPhysIBWrapper;

  try
    ...Login to Database...
  except
    { Login not correct }
    on E: Exception do
    begin
      if (E is EIBNativeException) and
         (EIBNativeException(E).Errors[0].ErrorCode = 335544472)
      then
        ShowMessage(strUserUnkown)  // your Errormessage
      else
        ShowMessage(E.Message);
    end;
  end;

QG5: I use Delphi 2009 with Firebird 2 with character set unicode_fss. I don't understand why FireDAC generate TWideStringField in Delphi 2009 ?

A: In Delphi 2009:

  • TStringField is 1 byte ANSI string field;
  • TWideStringField is multi-byte Unicode string field.

So, that is correct behavior. Also read Unicode Support for details.

What do you think about this topic? Send feedback!


TADManager and TADConnection Questions

TADManager and TADConnection Questions
FAQ Send Feedback

The list of questions and answers related to TADManager and TADConnection.

Group

FAQ

Links
FAQ
Description
QC1: I have a base datamodule class with TADManager. When I am creating a descendant class, I am getting »Application must have only single ADManager« error. What is wrong ?

A: You can only have one ADManager in a application. Instead of explicit creating that in your classes, refer a singleton object via ADManager function.

QC2: However in my project group I have several different delphi projects (applications), each with its own DataModule and ADManager. If I happen to open more than one of these datamodules at the same time (say to copy or compare items) then I get an error saying, that you can only have one ADManager per application, and it promptly removes one of them from one of the DataModules.

A: Do you really need the TADManager's ? An application does not need to explicitly create the TADManager. It is required to set the options and the configuration files in design time.

QC3: Can this be fixed, I keep on loosing my ADManagers and having to recreate them.

A: No, this cannot be fixed. Because only single TADManager may be created at design or run time. If there will be few TADManager's, then FireDAC will not know which one to use. Also see QC1.

QC4: Does FireDAC supports a connection pooling?

A: Yes, it has. In general, connection pooling keeps a pool of open "physical" connections, and when TADConnection.Connected is set to True, then FireDAC takes a "physical" connection from the pool and uses it. When application is set TADConnection.Connected to False, the "physical" connection is not closed, but put back into pool.

To use connection pooling in FireDAC, just add Pooled=True to you connection definition. No more special actions your application should take. Read Multi Threading for details.

QC5: Connection Editor seems to ignore ADPhysIBDriverLink1.VendorLib and uses hard coded driver.

A: You have to set VendorLib before first connection using this driver. After a connection is established, the DBMS client is loaded.

At design-time to make sure that your TADPhysXXXDriverLink properties are in the usage, check that TADPhysXXXDriverLink is first in the data module / form creation order. Then optionally restart Delphi IDE.

At run-time use the driver link Release method:

ADConnection1.Close;
...
ADConnectionN.Close;

ADPhysIBDriverLink.VendorLib := 'c:\fbclient.dll';
ADPhysIBDriverLink.Release;

ADConnection1.Open;
...
ADConnectionN.Open;

Other option is to define a virtual driver. Read the following for details Configuring Drivers. For example:

[FB_Embedded]
BaseDriverID=IB
VendorLib = C:\fb\fbembed.dll

And use FB_Embedded driver as a DriverID at design time. At run time you can also use ADDrivers.ini or just configure TADPhysXXXDriverLink.

What do you think about this topic? Send feedback!


TADQuery, TADStoredProc and TADUpdateSQL Questions

TADQuery, TADStoredProc and TADUpdateSQL Questions
FAQ Send Feedback

The list of questions and answers related to TADQuery, TADStoredProc and TADUpdateSQL.

Group

FAQ

Links
FAQ
Description
QQ1: Can I use the TADQuery and connect it with a dataset provider and retieve the data in a Codegears' client dataset?

A: TADQuery is the mix of the TADMemTable, TADTableAdapter and few TADCommand's. So, the TADQuery has everythings inside to execute SQL command, send parameters data, receive and stored result sets, browse result sets, post changes back to a DB. There is no reason to use TADQuery + DSP + CDS.

You can use TADMemTable, TADTableAdapter, TADCommand directly, instead of TADQuery. It gives more flexibility. For example, synchronized cached updates accross few datasets. But it also requires more coding.

IOW, TADQuery is optimal "shortcut" for every day data application programming.

QQ2: How to force ADStoredProc to use parameters specified by hands ?

A: Exclude fiMeta from FetchOptions.Items.

When you are creating the parameters by hands, you should exclude fiMeta from FetchOptions.Items. When it is specified, then FireDAC will fetch the stored procedure parameter definitions from a DB and will repopulate the Params collection.

If you have difficulties with manual definition of parameters, then populate the Params collection automatically and check how the parameters are defined. Then compare that to your code.

QQ3: »[FireDAC][Phys]-308. Cannot open / define command, which does not return result sets.« and »[FireDAC][Phys]-310. Cannot execute command returning results set.« what they mean ?

A: The »[FireDAC][Phys]-308. Cannot open / define command, which does not return result sets.« exception is raised, when application is executing the Open method for a SQL command, which does not return a result set. The exception is raised after the SQL command is executed, but DBMS has not returned any result set.

The »[FireDAC][Phys]-310. Cannot execute command returning results set.« exception is raised, when application is executing the ExecSQL method for a SQL command, which is returning a result set. Does the command return a result set or not is determined by the FireDAC SQL command preprocessor. If the command is recognized as SELECT or one of it forms, then it returns a result set. Otherwise – not.

In some cases, FireDAC may fail to recognize a SQL command as returning or not a result set. And sometimes add-hok application need to execute a SQL command, not depending on how many result sets it returns. So, how to be in these case ? Here is two basic ways:

1)

ADQuery1.OpenOrExecute

It may internally raise [FireDAC][Phys]-308, but an exception will be not progated out of the OpenOrExecute and a SQL command will be really executed. Also, the method will return True, if the command returned a resultset.

2)

ADQuery1.Command.CommandKind := skInsert;
ADQuery1.ExecSQL;

Just say to FireDAC, that the command is really an INSERT or what else kind, which does not return a result set.

QQ4: "Out of memory" exception is raised at calling ADQuery.Execute(ADQuery.Params.ArraySize). ArraySize is about 90,000. What is wrong ?

A: 1) 90,000 is tooooo much for any DBMS, because the data will be cached few times (parameters, DBMS API buffer, network pocket buffer, etc). Also, probably, each record has a "valuable" size. Even, if that is not True, then an application may run into the DBMS API limitations. The most "dark" thing there is the high limit for the Array size. Oracle - up to $7FFF. Other DBMS's - depends on the network pocket size, etc ...

2) Split 90,000 into the chunks of the 500-5000 items, each one. See AD03-ArrayDML demo regarding that. In general, fill an array up to the chunk size, then call Execute with the chunk size, then fill again and Execute, etc.

With Firebird I use ArraySize = 1,000,000 (60 sec) without problems.

We were the lucky to find an emperical formula, allowing to determine maximum size of an array. And FireDAC automatically splits one large array into few chunks.

It is not that simple to find similar to Oracle. While it supports the size up to $7FFF, I was getting AV's or other issues with large arrays ...

Anyway, if a record size is too big, then you can run out of memory even before calling Execute. So, be carefull ...

QQ5: Is it possible to know if all ADQuery records are fetched ?

A: Check SourceEOF property.

QQ6: I want to insert a record (via plain SQL) and get back the IDENTITY / SEQUENCE. What is the most efficient, multi-database friendly way?

A: 1) The TADConnection has GetLastAutoGenValue method. Depending on a DBMS it will return a last auto-generated value in a session. For example, for Oracle it will be:

SELECT <AName>.CURRVAL FROM dual

For MySQL it will access to the MYSQL API to get the value without a SQL query. Also, if a DBMS does not support the sequences / generators, then AName parameter value will be just ignored.

2) There is no a common way to write a SQL command, which will insert a record and return an auto-generated value. For example, for Oracle it will be:

INSERT ... INTO ... RETURNING ID INTO :ID

For PostgreSQL that will be 2 separated commands:

INSERT ... INTO ..
SELECT CURRVAL(...)

When you are posting an insert to a DB, using TDataSet Insert / Post methods, FireDAC looks at the DBMS kind and generates appropriate efficient SQL command[s].

QQ7: How to rollback transaction after user canceled the query execution in amCancelDialog mode ?

A: Two options:

1)

ADTransaction.StartTransaction;
try
  ADQuery.ExecSQL;
  ADTransaction.Commit;
except
  on E: EAbort do
    // user canceled the command execution
    ADTransaction.Rollback;
end;

2) Create TADQuery.OnError event handler. When a command execution is canceled, this event handler will be called and AException parameter will meat condition:

EADDBEngineException(AException).Kind = ekCmdAborted

QQ8: My query with the '&', '!' characters inside fails to execute correctly. What is wrong ?

A: For example, the following query with default options will fail:

ADQuery.SQL.Text := 'select * from xy where Fieldname = ''xxx&n''';
ADQuery.open;

The SQL command received by a DBMS will miss '&n'. That is because '&' specifies the beginning of a macro variable. By default every variable has empty value. So, the '&n' will be replaced by the empty string. If you do not use macros, then set ResourceOptions.MacroCreate and MacroExpand to False.

QQ9: I am getting "Parameter Xxx not found" accessing to stored procedure parameters. What is wrong ?

A: For example, consider the code:

ADStoredProc1.StoredProcName := 'TestProc';
ADStoredProc1.Prepare;
ADStoredProc1.ParamByName('Par').AsInteger := 100;

There may be different reasons for that:

  • DB does not have "TestProc" stored procedure, then it must be created;
  • depending on a DBMS, "TestProc" may be in invalid state, then it must be validated;
  • depending on a DBMS, the stored procedure name is in mixed case, then it must be quoted (more);
  • the fiMeta is excluded from FetchOptions.Items, then it must be included or parameters must be created by hands (more);
  • stored procedure does not have "Par" parameter, the parameter name must be corrected or "Par" parameter must be added;
  • depending on a DBMS, the parameter name may be prefixed with '@' or ResourceOptions.UnifyParams set to True.
What do you think about this topic? Send feedback!


TADTable Questions

TADTable Questions
FAQ Send Feedback

The list of questions and answers related to TADTable.

Group

FAQ

Links
FAQ
Description

QT1: I am getting "[FireDAC][DatS]-15. Duplicate row found on unique index" when navigating in TADTable ? What that means ?

A: In most cases that means, that the DB sort order and the client sort order differ. That may lead to endless loops or [FireDAC][DatS]-15 error. To resolve the issue, setup the FormatOptions.SortLocale and SortOptions properties, so that the client sort order will match to the DB sort order.

QT2: When navigating through TADTable records my application is hanging. What is wrong ?

A: See QT1.

What do you think about this topic? Send feedback!


TADMemTable Questions

TADMemTable Questions
FAQ Send Feedback

The list of questions and answers related to TADMemTable.

Group

FAQ

Links
FAQ
Description
QM1: TADMemTable vs. TClientDataSet – what is better ? I'm thinking of replacing all TClientDataSet with TADMemTable. Is a TADMemTable faster than a TClientDataSet?

A: It is MUCH faster.

2 years ago we have posted this article. There you can find "Speed" section and the screen snapshot with benchmark results. The ADClientDataSet is FireDAC v 1 in-memory table. So, the post is about FireDAC v 1, but FireDAC v 2 is faster than v 1.

As you can see TClientDataSet is extremely slow dataset ...

QM2: The nice thing with the TClientDataSet is that you can add, delete, change records and then process TClientDataSet.Delta. Is that possible with TADMemTable ?

A: The TADMemTable has the similar functionality. But it follows to the »Cached Updates« model. When CachedUpdates property value is True, then memtable will record changes in the updates journal.

To post updates to a DB you have to use ApplyUpdates. To "merge change log" you have to call CommitUpdates.

You can find description of these and other methods in the FireDAC help file and the examples in the FireDAC\Samples\Comp Layer\TADMemTable folder.

QM3: I use clonecursor a lot with the clientdatasets. How I can do that with TADQuery ?

A: Use the following code:

ADMemTable1.CloneCursor(ADQuery1, False, False);

QM4: How to create and populate ADMemTable ?

A: 1) Create the in-memory dataset

with ADMemTable1.FieldDefs do begin
  with AddFieldDef do begin
    Name := 'f1';
    DataType := ftInteger;
  end;
  with AddFieldDef do begin
    Name := 'f2';
    DataType := ftString;
    Size := 50;
  end;
end;
with ADMemTable1 do begin
  Open;
  Append;
  Fields[0].AsInteger := ...;
  Fields[1].AsString := ...;
  Post;
end;
.....

2) Append data to it, browse / edit it.

QM5: What is the fastest way to load a TADMemTable from a another DataSet (including structure) ?

A: The most simple way to copy the structure and the data from a TDataSet to a TADMemTable is to use the CopyDataSet method:

ADMemTable1.CopyDataSet(DataSet1, [coStructure, coRestart, coAppend]);

QM6: How to copy all records from ADQuery into ADMemTable and edit them in the ADMemTable ?

A: You can do something like that:

// UniDirectiona must be false if no
ADQuery1.FetchOptions.Undirectional := False;

ADQuery1.Open;
ADQuery1.FetchAll;
ADMemTable1.Data := ADQuery1.Data;
ADMemTable1.First;
while not ADMemTable1.Eof do begin
  ADMemTable1.Edit;
  .......
  ADMemTable1.Post;
  ADMemTable1.Next;
end;

QM7: I cannot add a persistent field of type ftGUID. I am getting error about field size, but the field size control is disabled. What is wrong ?

A: That is known issue in DB.pas unit: http://qc.embarcadero.com/wc/qcmain.aspx?d=8008. The workaround is to create a GUID field at runtime.

What do you think about this topic? Send feedback!


Fetching and Populating Questions

Fetching and Populating Questions
FAQ Send Feedback

The list of questions and answers related to fetching records and populating datasets.

Group

FAQ

Links
FAQ
Description
QX1: Fast forward-only, read-only access?

A: Set ADQuery.FetchOptions:

  • CursorKind = ckDefault or ckForwardOnly
  • Mode = fmOnDemand
  • RowsetSize = 1000
  • Unidirectional = True
  • optionally exclude fiMeta from Items, if you does not need to edit dataset.

QX2: How to append multiple result sets to a ADQuery or a ADMemTable ?

A: The following approach with the ClientDataset to hold multiple result sets:

  begin loop
    // run SqlQuery with new params
    ...
   ClientDataset.AppendData(SqlQuery.Data)
    ...
  end loop

may be replace with the single TADQuery. Kind of that:

  // initial open and fetch
  ADQuery1.Params[0].AsInteger := 1;
  ADQuery1.Open;

  // reexecute command, fetch rows again and append them
  // to the existing rows
  ADQuery1.Command.Close;
  ADQuery1.Params[0].AsInteger := 2;
  ADQuery1.Command.Open;
  ADQuery1.FetchAgain;
  ADQuery1.FetchAll;

  // reexecute again with different parameter value
  ADQuery1.Command.Close;
  ADQuery1.Params[0].AsInteger := 3;
  ADQuery1.Command.Open;
  ADQuery1.FetchAgain;
  ADQuery1.FetchAll;

QX3: How to execute a query and append it result set to an existing dataset, without inserting these records to DB ?

A: See the TADDataSet.FetchAgain method description. As other option, you can execute a SQL command, which will fetch the additional records into an existing dataset:

ADCommand1.CommandText := 'select ... from ... where id= :id';
ADCommand1.Open;
ADCommand1.Fetch(ADQuery1.Table);
ADCommand1.Close;

QX4: My query returns 800 records, but RecordCount returns 50. What is wrong ?

A: The RecordCount by default shows the number of records in the dataset records cache. More about record counting modes you can read at TADFetchOptions.RecordCountMode Property.

50 is the default rowset size. That is the number of records FireDAC will fetch at single request. So, right after open the dataset will have <= 50 records, that is what RecordCount is showing. When you will navigate through dataset it will fetch additional rowsets and the number of records may grow.

To show the total number of records which query returns, you may do one of the following:

  • perform ADQuery1.FetchAll. So all records will be fetched and RecordCount will show their number;
  • to set FetchOptions.RecordCountMode to cmTotal. Note, that may lead to performance degradation, as FireDAC will perform additional SELECT COUNT(*) query for each SELECT query.
What do you think about this topic? Send feedback!


Sorting, Searching, Locating, Filtering Questions

Sorting, Searching, Locating, Filtering Questions
FAQ Send Feedback

The list of questions and answers related to sorting, searching, locating, filtering datasets.

Group

FAQ

Links
FAQ
Description
QS1: Dataset sorts non-English strings incorrectly. Or - I am getting "[FireDAC][DatS]-2. Object [] is not found". What is wrong ?

A: To fix the issue, do the following:

  • open FireDAC\Source\uAD.inc;
  • find the lines:

{$define AnyDAC_NOLOCALE_DATA}   // define, to use binary data comparision
{$define AnyDAC_NOLOCALE_META}   // define, to use binary metadata comparison

  • comment them out;
  • save the file and recompile your application.

Note: if you are only working with English (ASCII) texts, then ensure that the above lines are uncommented. That speedups sort and locate operations considerably.

QS2: Is it necessary to create Index for ordering data?

A: You does not need to define Indexes, if you just need to order data. IndexFieldNames will work for you. Indexes allows to define the views, which are mix or filtering and ordering. Note, Indexes and IndexDefs are mutually exclusive for all FireDAC datasets. That means - either you should fill Indexes or IndexDefs, but not both.

QS3: Can lookup fields be used in index definitions?

A: No, you cannot. But you can use in indexes internal calculated fields. For that add persistent fields, then add fkInternalCalc field, create OnCalcFields event handlers and calculate this field in event handler. For example:

procedure TForm21.ADTable1CalcFields(DataSet: TDataSet);
begin
  DataSet.FieldByName('f_calc').AsString :=
    ADMemTable2.Lookup('code',
      DataSet.FieldByName('f_code').AsInteger, 'name');
end;

QS4: Can calculated fields be used in index definitions ?

A: Current FireDAC release does not support fields with FieldKind = fkCalculated in Locate, Lookup, IndexFieldNames, etc. The workaround is to use fkInternalCalc fields.

QS5: When I call the FindNearest method at runtime I'm receiving an error message stating that there is no active index.

A: The index must be selected, not just active. For that:

- set Indexes[i].Selected := True

- or set ADTable1.IndexFieldName := <name of your index>

QS6: Ho to define different character collation for TADDataset indexing ?

A: In general there are 3 options:

  • To assign LCID to TADMemTable.Table.Locale. FireDAC uses CompareStringA and CompareStringW with SORT_STRINGSORT flag. The default collation is DBMS independent. It is LOCALE_USER_DEFAULT. See Win API docu for details.
  • To change source code - uADDatSManager, TADDatSRow.CompareData and implement your own comparision algorythm.
  • Register custom function with expression evaluator. See uADStanExpr for registration details. Then you can use this function at TADMemTable.Indexes[..].Expression. For example: Expression := 'MySort(Name)'.

In future we will implement custom collations. That will be usefull as for SQLite driver as for cases, like yours.

QS7: How to order data in such way: COL1 descending, COL2 ascending ?

A: IndexFieldNames := 'col_1:D;col_2';

Also, check help file, chapter "TADDataSet.IndexFieldNames property".

QS8: ADQuery.Locate raises "Function sequence error" with SQL Server. What is wrong ?

A: It looks like ADQuery was opened after an explicit transaction start, then a transaction was commited. And then you are calling ADQuery.Locate. But not yet all records were fetched from ADQuery, but Locate imlicitly calls FetchAll. And it gives this error on SQL Server.

To avoid it do:

  • set ADQuery.FetchOption.Mode = fmAll for this specific ADQuery
  • call FetchAll for this ADQuery before calling Commit.

This is SQL Server behaviour - invalidate open cursors after Commit / Rollback.

QS9: What is the best way to implement Lookup tables ? Lookup tables seems to be big cause to why opening/loading is slow.

A: If you does not need all records on the client, then use TADQuery with SELECT ... WHERE ....

QS10: If you have any tips on how to handle lookup fields to get best performance?

A: Then set TADQuery.IndexFieldNames to LookupKeyFields, then FireDAC will use client index to locate record in a lookup dataset.

If the number of unique key values in not high, then set LookupCache to True.

QS11: I am failing to filter by the DateTime value. What is wrong ?

Q: I am using Delphi 2007 with FireDAC 2.0.11.895 on a Postgres database. When I try to filter on a DateTime field I can't seem to get an exact match with a value passed to it like this:

created_date = '8/10/2009 14:42:14'           // or even...
created_date = '8/10/2009 14:42:14.247'     // ... the exact time with milisec

Instead I have to end up using something like this:

created_date >= '8/10/2009 14:42:14' AND created_date < '8/10/2009 14:42:15' or
created_date >= '8/10/2009 14:42:14.000' AND created_date <= '8/10/2009 14:42:14.999'

But isn't pretty code.

A: The problem is that DBMS or DBMS API may round the time value. While a programmer expects to see the .247 as a fractional part, it may be .246 or how else. That is not FireDAC failure, but it is how a DBMS is working.

You can round the time value to the seconds and compare that value with a constant without a fractional part:

uses
  uADStanExprFuncs
...
  ADQuery1.Filter = 'TimeStampDiff(''second'', created_date,
    convert(''timestamp'', ''8/10/2009 14:42:14'')) = 0';
What do you think about this topic? Send feedback!


Editing Questions

Editing Questions
FAQ Send Feedback

The list of questions and answers related to data editing.

Group

FAQ

Links
FAQ
Description
QE1: What means "[FireDAC][DApt]-400. Update command updated [0] instead of [1] record" ?

A: This error often happens when FireDAC includes some float / double / single / date / datetime / time or some other table fields, which are the subject to the precision lost, into WHERE phrase. Then at the parameter assignments the precision lost may happen. As result of that the WHERE phrase returns no records.

FireDAC may include such fields into WHERE depending on UpdateOptions.UpdateMode. Sometimes you can see this error with upWhereKeyOnly. Although you have specified upWhereKeyOnly, FireDAC still may use upWhereAll. Which is fallback, when there is no PK fields defined. No PK fields may be defined when:

  • fiMeta is excluded from FetchOptions.Items;
  • or table in SQL does not have primary key defined;
  • or UpdateOptions.KeyFields is empty;
  • or none of TField's has pfInKey in ProviderFlags.

Other reason with some DBMS (SQL Server, PostgreSQL) is that the table has a trigger, which modifies the data. With SQL Server put SET NOCOUNT ON at trigger beginning. With PostgreSQL set UpdateOptions.CountUpdatedRecords to False.

QE2: When it is necessary to use TADUpdateSQL?

A: FireDAC generates updating SQL commands automatically, when the original SQL command is a simple SELECT or a SELECT with JOIN, where is a single table preserving the primary key fields. So, the TADUpdateSQL usage is optional. TADUpdateSQL is required when:

  • The original SQL command is not a SELECT command. Eg, stored procedure returning result sets or what else.
  • The original SELECT command is not preserving primary key. Eg, join few tables, has DISTINCT or GROUP BY clauses, etc.
  • An application needs non-standard update SQL command. Eg, application is posting updates using stored procedure calls.

QE3: Is it possible to use Macros inside SQLs in ADUpdateSQL?

A: Use the following code:

ADUpdateSQL1.Commands[arInsert].MacroByName('MacroName').Value := 'value';

QE4: Why in CachedUpdates mode calling ApplyUpdates more than once tries to post inserted records again ?

A: After calling ApplyUpdate, you should call CommitUpdates. After this call all changes will be deleted from internal cache.

QE5: How do not refresh a detail TADQuery after a master TADQuery is scrolled or posted ?

A: Two ways:

  • Implement master-detail linkage on your own. This will require to add TDataSource.OnDataChange event handler. I will call this "standard" way.
  • To use Centralized Cached Updates.

QE6: How to remove few dataset records, without removing them from DB.

A: You can work directly with internal dataset data storage. It is accessible through TADDataSet.Table property. For example, to delete row with index 3 do the following:

ADQuery1.Table.Rows[3].Free;
ADQuery1.UpdateCursorPos;
ADQuery1.Resync([]);

For example, to delete the current record do the following:

ADQuery1.UpdateCursorPos;
ADQuery1.GetRow.Free;
ADQuery1.UpdateCursorPos;
ADQuery1.Resync([]);

And finally you can use CachedUpdates mode. Set a dataset to the cached updates mode. Then delete a record and call CommitUpdates.

QE7: ATable.UpdateToDataset(BTable , 'mykey', [mtufEdit, mtufAppend]) – how can I do this with FireDAC?

A: Use the TADDataSet.CopyDataSet method with the following options:

  • [coAppend] - append all records from ASource (as it was);
  • [coEdit] - edit only records with existing key values;
  • [coAppend, coEdit] - edit records with existing keys and append records with non-existent keys.

QE8: How to assign value to a ftGUID field ?

A: Use the following code:

(AMemTable.FieldByName('Field1') as TGUIDField).AsGuid := aGUID;

QE9: How to specify a default value for a dataset field ?

A: Assign an expression to the TField.DefaultExpression property.

QE10: Whether property TField.DefaultExpression is being supported in the analogous way as TField.CustomConstraint, and the effect of the expression is being written, as the default value for a field?

Yes, if a field is a normal resultset field. If a field is fkInternalCalc one, then the result of the DefaultExpression will be used as a field value. And it will be updated like any other calculated fields.

QE11: E.g. such an expression: {fn DAYOFMONTH({fn CURDATE()})} will be correct?

A: No, you are using FireDAC escape functions. They are supported only in the SQL commands, not in expressions. In expressions, like constraints and default value expressions, you should use functions and syntax, supported by FireDAC expression evaluator:

DAYOFMONTH(CURDATE())

Also, to use such functions, you should include uADStanExprFuncs unit into your application.

QE12: How to specify default value for a dataset Boolean field ?

A: To specify a default value for a dataset field, assign required expression to the TField.DefaultValue property.

To assign default value to a boolean field, you can use one of the following strings - F, FA, FAL, FALS, FALSE as False names. And similar for True.

QE13: Assigning TField.CustomConstraint does not work. What is wrong ?

Q: Appending constraint via:

ADQuery.FieldByName('FIELD_NAME').CustomConstraint := 'FIELD_NAME > 1';
ADQuery.UpdateConstraints;
ADQuery.Table.Constraints.Check(ADQuery.GetRow(), rsModified, ctAtEditEnd);

It's not working - exception is not raised...

A: That is OK (explanation will be later).

Q: But:

ADQuery.Constraints.Add.CustomConstraint := 'FIELD_NAME > 1';
ADQuery.UpdateConstraints;
ADQuery.Table.Constraints.Check(ADQuery.GetRow(), rsModified, ctAtEditEnd);

It's working! Why?

A: Also OK.

Q: What exactly mean ctAtEditEnd and ctAtColumnChange?

A: These enums are specifying the event, when FireDAC should check constraints:

  • ctAtEditEnd - the Post is called
  • ctAtColumnChange - a field value is modified

Now explanation:

ADQuery.FieldByName('FIELD_NAME').CustomConstraint := 'FIELD_NAME > 1';

This is adding a field-level constraint. They are checked at ctAtColumnChange event only.

ADQuery.Constraints.Add.CustomConstraint := 'FIELD_NAME > 1';

This is adding a record-level constraint. They are checked at ctAtEditEnd event only.

What do you think about this topic? Send feedback!


GUI Questions

GUI Questions
FAQ Send Feedback

The list of questions and answers related to the FireDAC GUI.

Group

FAQ

Links
FAQ
Description
QU1: How to show "Application is busy" dialog, while the long running query is executing ?

A: Set ADQuery.ResourceOptions.CmdExecMode to amCancelDialog, drop TADGUIxAsyncExecuteDialog to a form, then prepare a test with a run long running query and run it.

While the query is executing, FireDAC will show a dialog with the "Wait" label and the "Cancel" button. If user will press the button, then the query execution will be canceled.

QU2: How localize the ADGUIxLoginDialog ?

A: Use the code like that:

with ADGUIxLoginDialog1.VisibleItems do
begin
  Clear;
  Add('User_Name=<local phrase>');
  Add('Password=<local phrase>');
end;

Also, you can open uADStanResStrs unit, find there a section "// Dialog captions" and translate there the items.

QU3: How to handle errors using TADGUIxErrorDialog ?

A: Just drop the TADGUIxErrorDialog component on your form or data module. Then for the EADDBEngineException unhandled exceptions the FireDAC error dialog will be shown. To achieve that FireDAC hooks the TApplication.OnException event.

QU4: I see you are using syntax highlighting in the design-time editors. How I can do that on my workstation ?

A: You need to do following:

  • download appropriate for your Delphi version SynEdit archive. You can download SynEdit from [image] da-soft site.
  • extract archive to some folder;
  • run Delphi IDE;
  • add <synedit>\Source folder to the Library Path;
  • open and install appropriate <synedit>\Packages\SynEdit_R<n>.dpk;
  • open and install appropriate <synedit>\Packages\SynEdit_D<n>.dpk;
  • if FireDAC is not installed, then install it. Otherwise perform the following steps:
    • close Delphi IDE;
    • remove FireDAC\Bin\_noSynedit.txt
    • goto FireDAC\Bin folder;
    • run compileDXxxx.bat.

QU5: How can I turn off the SQL hourglass completely?

A: a) To disable wait cursor forever for an application use TADGUIxWaitCursor with Provider = 'Console'. The 'Console' provider contains an empty wait cursor implementation and no more wait cursor will be showed by FireDAC. If a mouse cursor is still changing, then check, that only uADGUIxConsoleWait unit is included into your application and uADGUIxFormsWait is not included. Note, that you will not have an ability to turn wait cursor on again.

b) To disable wait cursor, but to have ability later to enable it again. Use the code like that to turn off wait cursor:

ADWaitCursor1.ScreenCursor := gcrNone;

or

ADManager.ResourceOptions.SilentMode := True;

c) To disable wait cursor and FireDAC dialogs, but to have ability later to enable it again. Set the ADManager.SilentMode property to True, then this will disable all wait cursors and FireDAC dialogs, including:

  • error dialog
  • async execution dialog
  • login dialog
  • script progress dialog

Setting ResourceOptions.SilentMode to True, disables only wait cursors.

QU6: When I apply filter to a dataset, grid scroll bar remains unchanged. Why it is so ?

Q: I have a have grid connected to ADDataSet. When I filter records like this:

Grid.DataSource.Dataset.Filter := 'id_virtual_channel in (1, 2, 3)'

then everything is OK, but scroll bar remains unchanged like there would were all rows. It looks quite bad when for example full grid has 500 rows and filtered only 3 but scroll bar cursor stays very small and you can move it only a very litle (like from first to third row in 500).Do you have some solution?

A: Use the code like that:

ADQuery1.FetchOptions.RecordCountMode := cmVisible;

QU7: After refreshing a dataset a DBGrid with multiple selected rows looses the selection. How to preserve selection ?

A: FireDAC bookmarks are invalidated after a Refresh call. You can save PK values of the selected records before Refresh call, then reselect these record again using Locate.

What do you think about this topic? Send feedback!


SQL Scripts Questions

SQL Scripts Questions
FAQ Send Feedback

The list of questions and answers related to the SQL Script execution.

Group

FAQ

Links
FAQ
Description
QR1: Why I can't use semicolon at the end of a query? If I take this off from the query, it works.

A: The ';' in many SQL script dialects is a delimiter of the SQL commands and is not a part of the SQL language. BTW, some of the DBMSs allows ';' at end of SQL command, others - does not. IOW, just remove ';'.

QR2: Some DBMS's (PG, Oracle, FB) allow to execute only single SQL statement, but SQlite allow multiple statements to be execute at once. Why it is so ?

A: This is by design – the ExecSQL method transfers a SQL command to DBMS API as is. If a DBMS supports the "batch" queries, then it will execute the query, otherwise it will fail. TADScript allows to execute SQL scripts with multiple SQL commands and script control commands.

QR3: Even if I have more than one script, with ExecuteAll only first will be executed.

A: The first script is a "root" script. To execute other scripts, you should call then explicitly from "root" script. For example:

with ADScript1.SQLScripts do begin
  with Add do begin
    Name := 'root';
    SQL.Add('@first');  // explicitly call 'first' script
    SQL.Add('@second'); // explicitly call 'second' script
  end;
  with Add do begin
    Name := 'first';
    SQL.Add('create table t1;');
    SQL.Add('create table t2;');
  end;
  with Add do begin
    Name := 'second';
    SQL.Add('create procedure p1;');
    SQL.Add('create procedure p2;');
  end;
end;

ExecuteStep executes next script command starting from TADScript.Position position. ExecuteAll executes script in full. There is also ValidateAll / ValidateStep. These methods process script, but does not execute SQL commands. At end ValidateAll call assigns value to TADScript.TotalJobSize. So, next ExecuteAll call will correctly update TotalPct10Done, which is 10*% of processed script commands.

QR4: If there a difference in performance between (1) execute ADConnection.ExecSQL for each SQL statement (command) and (2) execute ADScript.ExecuteAll ?

A: The SQL execution code behind each of the methods is the same. There is used IADPhysCommand.Execute method.

The TADScripts parser is highly optimized, knows many SQL dialect aspects, like a Oracle PL/SQL (where ';' may be in the middle of a command), and allows very soft controll.

So, if you submits command by command to the ADConnection.ExecSQL and there is no need to extract these commands from a script or how else, then it will be a fastest method. If you have a SQL script in a file, then ADScript.ExecuteAll will be the fastest method.

QR5: How I can rollback a script work, when it fails ?

A: 1) Use FireDAC transaction control:

ADConnection1.StartTransaction;
try
  ADScript1.ExecuteAll;
  ADConnection1.Commit;
except
  ADConnection1.Rollback;
  raise;
end;

2) Use PL/SQL block in case of Oracle or similar constructions for other DBMS's:

begin
  insert into u_btk.t_test values (1, sysdate);
  insert into u_btk.t_test values (2, sysdate);
  insert into u_btk.t_test values (1, sysdate);
  commit;
exception
  when others then
    rollback;
    raise;
end;

3) Use TADScript.OnError:

procedure TForm1.ADScript1Error(ASender: TObject;
  const AInitiator: IADStanObject; var AException: Exception);
begin
  ADConnection1.Rollback;
end;

QR6: When I am executing this script on FB I get “Unexpected end of command line 3” ? How to fix this ?

EXECUTE BLOCK

AS

DECLARE VARIABLE MYVAR VARCHAR(250);

BEGIN

…

END

;

A: To execute a script with blocks you should change the command separator before a block and optionally return it back after. For example:

SET TERM #;

EXECUTE BLOCK

.....

END;

#

SET TERM ;#

What do you think about this topic? Send feedback!


Metadata Questions

Metadata Questions
FAQ Send Feedback

The list of questions and answers related to the metadata retrieval.

Group

FAQ

Links
FAQ
Description
QT1: Is there any method to check if table exist inside DB?

A: There are two basic methods:

1)

try
  ADQuery1.Open('select * from tab where 0 = 1');
  Result := True;
except
  on E: EADDBEngineException do
    if E.Kind = ekObjNotExists then
      Result := False
    else
      raise;
end;

2)

var
  oList: TStrings;
begin
  oList := TStringList.Create;
  try
    GetTableNames('', '', ATableName, oList, [osMy, osOther, osSystem],
      [tkTable, tkTempTable, tkLocalTable]);
    Result := oList.Count > 0;
  finally
    oList.Free;
  end;
end;

The first one is more optimal.

QT2: For oracle, is it possible to get the package procedures using the TADMetaInfoQuery ?

A: The following code returns a list of procedures for the PACKAGE_NAME Oracle package.

ADMetaInfoQuery1.BaseObjectName := 'PACKAGE_NAME';
ADMetaInfoQuery1.MetaInfoKind := mkProcs;
ADMetaInfoQuery1.Open;

QT3: How to get index names using the TADMetaInfoQuery ?

A: The following code returns a list of indexes for the MY_TAB table.

ADMetaInfoQuery1.ObjectName := 'MY_TAB';
ADMetaInfoQuery1.MetaInfoKind := mkIndexes;
ADMetaInfoQuery1.Open;

QT4: Query Builder, design-time editors and metadata retrieval functions return object names belonging to my current schema, prefixed with schema / catalog name. How to exclude it ?

A: FireDAC has two general connection definition parameters - MetaDefCatalog and MetaDefSchema. Depending on DBMS either or both of them are supported (see FireDAC Database Connectivity for details). If object belongs to a specified MetaDefCatalog catalog / MetaDefSchema schema, then this catalog / schema name will be excluded from an object name. So, set MetaDefCatalog / MetaDefSchema to your development catalog / schema name, if you need to deploy your application to different catalog / schema.

QT5: I am calling Oracle stored procedure using public synonym, but FireDAC always appends schema name to stored proc name. How to avoid that ?

A: FireDAC has two general connection definition parameters - MetaCurCatalog and MetaCurSchema. Depending on DBMS either or both of them are supported (see FireDAC Database Connectivity for details). Setting them to '*' will avoid usage of a corresponding name part in a full object name.

What do you think about this topic? Send feedback!


Debugging and Reporting Environment Questions

Debugging and Reporting Environment Questions
FAQ Send Feedback

The list of questions and answers related to the debugging and reporting environment.

Group

FAQ

Links
FAQ
Description
QD1: How can I obtain Client / Session info like ADExplorer?

A: DBMS Environment Reports

QD2: So, how I can produce trace / monitor output ?

A: Tracing and Monitoring

QD3: How to temporarily enable / disable trace / monitor output ?

A: Use TADMoniXxxxClientLink.Tracing. It enables or disables tracing output for specific tracer kind. Also, to enable or disable trace output for specific established connection use the ADConnection.ConnectionIntf.Tracing.

QD4: What is the meaning of EventKind's ?

A: The list:

  • LiveCycle: Object creation / destruction. For example, IADPhysConnection is created.
  • Error: DBMS errors.
  • ConnConnect: Connection open / close.
  • ConnTransact: Start / Commit / Rollback.
  • ConnService: Some special events.
  • CmdPrepare: IADPhysCommand.Prepare calls.
  • CmdExecute: IADPhysCommand.Execute or Open calls.
  • CmdDataIn: Command parameter values.
  • CmdDataOut: Resultset rows.
  • AdaptUpdat: All about posting updates.
  • Vendor: The low level DBMS API calls.
  • Component: Some high level events.

QD5: In which unit and where in the code can I view the SQL statement, I need to do some debugging ?

A: You can do that using one of the following options:

  • You can use MonitorBy connection parameter.
  • Open uADPhysManager.pas, find there TADPhysCommand.Prepare method and there is the InternalPrepare method call. Set breakpoint there and check value of the FDbCommandText field. It is the SQL command text, as it will be sent to a DBMS.

QD6: How to get the final SQL statement with all the params and macros replaced ?

A: See TADQuery.Text. Note, that FireDAC does not substitute parameter values into the final SQL command text.

QD7: I enabled trace output and getting constant Access Violations. What is wrong ? Is it a bug ?

A: FireDAC for the ODBC based drivers uses the Microsoft ODBC driver manager tracing facilities. To produce the trace output manager internally uses C RTL functions IsBadReadPtr / IsBadWritePtr, which internally can generate a controlled AV. The exception will be not propagated outside of the manager, but IDE debugger stops on it. Just ignore them.

What do you think about this topic? Send feedback!


Integration with 3d Party Products Questions

Integration with 3d Party Products Questions
FAQ Send Feedback

The list of questions and answers related to integration with 3d party products.

Group

FAQ

Links
FAQ
Description
QP1: Is there FastReport (what else) add-on and is it supported officially?

A: Please contact FastReport.

QP2: Unidirectional query and DevExpress grid. With Query.FetchOptions.Unidirectional = True TDataset(Query) is not set as Unidirectional (TDataset(Qurey).IsUnidirectional = False). Because of that there are problems with DevExpress grid.

A: The problem is that setting TDataset(Qurey).IsUnidirectional to True will break TADDataSet functionality. At moment, I does not have a correct solution and need additional investigation. I will suggest to modify DevEx sources to overcome this issue. For that:

  • open ExpressDataController\Sources\cxDBData.pas unit
  • find there TcxDBDataProvider.IsUniDirectional and replace it with:

function TcxDBDataProvider.IsUniDirectional: Boolean;
begin
  if Assigned(DataSet) then begin
  {$IFDEF DELPHI6}
    if DataSet.IsUniDirectional then
      Result := True
    else
  {$ENDIF}
      if DataSet is TADRdbmsDataSet then
        Result := TADRdbmsDataSet(DataSet).FetchOptions.Unidirectional
      else
        Result := False;
  end
  else
    Result := False;
end;
What do you think about this topic? Send feedback!


Firebird and Interbase Servers Questions

Firebird and Interbase Servers Questions
FAQ Send Feedback

The list of questions and answers related to Firebird and Interbase Servers.

Group

FAQ

Links
FAQ
Description
QF1: How I can set up a DLL path+name for fbclient.dll ?

A: The general approach is described in Configuring Drivers. To configure a DLL at run time per application basis, do the following:

  • drop TADPhysIBDriverLink component;
  • set VendorLib property to a DLL path.

If you going to configure a DLL at design time too, then better will be to use ADDrivers.ini:

[IB]
VendorLib=C:\Program Files\Firebird 2.5\bin\fbclient.dll

QF2: Which DriverName must be used with Firebird 2.5 – IB, FB21 or ?

A: IB is the "base" driver ID. FB21 is the "virtual" driver ID. Virtual drivers are configured in the file FireDAC\DB\ADDrivers.ini. There you can see how is configured the FB21. It is the IB base driver configured to use appropriate fbclient.dll. You can create your own virtual drivers. For example:

[Firebird25]
BaseDriverID=IB
VendorLib=C:\Program Files\Firebird 2.5\bin\fbclient.dll

QF3: How to force FireDAC to recognize some field as boolean ?

A: A boolean field may be created using a domain. The domain name must contain 'BOOL' substring. And add ExtendedMetadata=True parameter to your connection definition. Example:

CREATE DOMAIN T_BOOLEAN SMALLINT;
CREATE TABLE ... (
  ...
  BOOLEAN_FIELD T_BOOLEAN,
  ...);

QF4: How to force FireDAC to recognize some field as GUID ?

A: A GUID field may be created using a domain. The domain name must contain 'GUID' substring. And add ExtendedMetadata=True parameter to your connection definition. Example:

CREATE DOMAIN T_GUID AS CHAR(16) CHARACTER SET OCTETS COLLATE OCTETS;
CREATE TABLE ... (
  ...
  GUID_FIELD T_GUID,
  ...);

QF5: Is there a possibility to drop a Firebird database by sql ?

A: It is not possible with TADQuery, because DROP DATABASE command is not a FB SQL command, but it is ISQL command. Instead specify DropDatabase=Yes in connection definition parameters or use TADScript with DROP DATABASE command.

QF6: How to change a User Password in Firebird?

A: FireDAC support password changing on Firebird 2.5 (additionally to Oracle, MySQL, PostgreSQL, SQL Server and SQLite drivers) using the code:

ADConnection1.Connected := True;
ADConnection1.ConnectionIntf.ChangePassword('new password');

QF7: How to mark a database as read only ?

A: Specify in the connection definition parameters:

IBAdvanced=set_db_readonly=1

QF8: Looks like AutoCommit works with Firebird only if FetchOptions.Mode = fmAll or does not work at all. Could you please explain how AutoCommit really works ?

A: The background is - the COMMIT will invalidate all the cursors open in this transaction. FireDAC handles transactions automatically using following rules:

  • if you preparing a command, and there is no active transaction, then it will be started;
  • if you will explicitly call Commit method, then all open in this transaction datasets will be brought into Offline state (FetchAll + closing + unpreparing underlying command, but not a dataset itself);
  • if transaction does not have more than single active cursor, then after fetching last record from this cursor it will be auto-committed (if requested by options).
  • if transaction does not have any active cursors, then after executing (ExecSQL) a command, the transaction will be auto-committed (if requested by options).

There are even more nuances, but the main rules are listed above.

Automatic committing will be issued after the last record is fetched. We cannot change the behavior, so right after Open will be performed FetchAll and then Commit. As there will be no difference between fmOnDemand and fmAll.

If you need to make the changed and posted to the DB records of this dataset visible to the other sessions, while not all records are fetched from the dataset, then just use second update transaction object. So, cursor transaction will remain active and updates will be executed in the different short transactions. That will make the changes visible to the other users.

QF9: How to connect using an alias ?

A: Just set the Protocol parameter to an empty string or do not specify it at all.

QF10: What does "[FireDAC][Phys][IB]connection rejected by remote interface" mean ?

A: You are probably connecting to the Firebird server using GDS32.DLL.

QF11: What does "Assertion failure (u:\da-soft\FireDAC\source\uADPhysIBWrapper.pas, line 2052)" mean ?

A: You are probably connecting to the Interbase server using FBCLIENT.DLL.

QF12: What does "no permission for read/select access to TABLE xxxx" with FB Embedded mean ?

A: Although the security database is not used by the Embedded server, it still uses the user name to check rights. If the user name is not specified or is specified incorrectly, you get this error.

What do you think about this topic? Send feedback!


MS SQL Server Questions

MS SQL Server Questions
FAQ Send Feedback

The list of questions and answers related to MS SQL Server.

Group

FAQ

Links
FAQ
Description
QZ1: SQL Server 2005: is it possible to use the 'Shared Memory' transport with 'SQL Native Client'?

A: In general:

  • check using "Client network utility", that Shared Memory protocol is enabled;
  • use Server=(local) in your connection definition.

QZ2: How to get OriginTabName with SQL Server 2005 ?

A: Add ExtendedMetadata=True connection definition parameter.

QZ3: Calling a stored procedure, I am getting »[FireDAC][Phys][ODBC]-345. Data too large for variable [#3]. Max len = [2], actual len = [14]«. What is wrong ?

A: That happens in most cases, when a stored procedure has a VARCHAR parameter defined without specifying a size. For example:

PROCEDURE ANALYZETABLE @T_OWNER VARCHAR, @T_TABLE VARCHAR AS
DECLARE @FOOBAR INTEGER;
BEGIN
  /* DUMMY PROCEDURE JUST FOR COMPATIBILITY PURPOSE */
  SET @FOOBAR = 1;
END;

The following code will work:

with ADStoredProc1 do begin
  FetchOptions.Items := FetchOptions.Items - [fiMeta];
  StoredProcName := 'ANALYZETABLE';
  Params.Clear;
  Params.CreateParam(ftString, 'T_OWNER', ptInput).Size := 20;
  Params.CreateParam(ftString, 'T_TABLE', ptInput).Size := 20;
  Prepare;
  ParamByName('T_OWNER').AsString := '';
  ParamByName('T_TABLE').AsString := TableName;
  ExecProc;
end;

Note:

  • Exclude fiMeta from FetchOptions.Items, so FireDAC will not fetch stored procedure parameters definition. That is required, because ODBC driver describes @T_OWNER VARCHAR as VARCHAR(1).
  • Specify all parameters properties, including Size before Prepare or first ExecProc call.

QZ4: Calling a stored procedure, I am getting »[FireDAC][Phys][ODBC][Microsoft][SQL Server Native Client 10.0][SQL Server]Line 1: Incorrect syntax near '{'«. What is wrong ?

A: It is a known issue. It happens when:

  • Connection is using SQL Server Native Client 2008 ODBC driver;
  • The DBMS is SQL Server 2000;
  • And a stored procedure has a BLOB input parameter.

At moment only workaround is to use SQL Server 2000 ODBC Driver or SQL Native Client 2005, when you are connecting to the Microsoft SQL Server 2000.

QZ5: Calling Array DML command, I am getting »"[FireDAC][Phys][ODBC][Microsoft][SQL Server Native Client 10.0]String data, length mismatc«. What is wrong ?

A: It is a known for me issue. It seems it is a bug in Microsoft SQL Native Client ODBC driver. For a while, we have not found a proper solution for that. The issue happens, when one of the parameters has a blob data type (ftBlob, ftMemo, etc). As a workaround set ResourceOptions.ArrayDMLSize to 1.

QZ6: Why is the application raising the "Invalid object name '#<my temp table name>'" exception?

A: The FireDAC application may raise the exception above, when it is working with the Microsoft SQL Server local temporary tables. To demonstrate this, the following code reproduces the issue:

ADQuery1.ExecSQL('select * into #TmpOrd from [Orders]');
ADQuery1.Open('select * from #TmpOrd');

To resolve the issue, set TADQuery.ResourceOptions.DirectExecute to True. Also this is required, when application is extensively using:

  • local temporary tables in the client SQL;
  • and/or the dynamic client SQL.

As an option, consider to use global temporary tables.

QZ7: I am getting strange SQL error (8155) "No column was specified for column 1 of 'A' ". What is wrong ?

A: It seems an application sets FetchOptions.RecsMax to a value greater than zero and executes a query with expressions in SELECT list. For example:

SELECT MIN(MyField) FROM MyTable WHERE MyIdField > 0

In that case FireDAC modifies a query to:

SELECT TOP 10 * FROM (
  SELECT MIN(MyField) FROM MyTable WHERE MyIdField > 0
) A

On SQL Server this syntax fails with the above error. To resolve this issue, specify the aliases for expressions in SELECT list.

QZ8: I am failing to get Chinese characters (Big5 encoding) from a database. How to fix that ?

A: Try to add connection definition parameter:

ODBCAdvanced=AutoTranslate=no

And add the mapping rule:

  object ADConnection1: TADConnection
.....................
    FormatOptions.AssignedValues = [fvMapRules]
    FormatOptions.OwnMapRules = True
    FormatOptions.MapRules = <
      item
        SourceDataType = dtAnsiString
        TargetDataType = dtWideString
      end>
  end

Also check that you have set correct Chinese database character set and not Latin1.

QZ9: When I insert a '2011-11-13 00:00' as a datetime value I encounter the error "The conversion of a varchar data type to a datetime data type resulted in an out-of-range value". What am I doing wrong?

A: According to [image] MSDN the used datetime format does not conform to the international standard. There are several solutions to avoid the error:

  1. Using of [image] SET DATEFORMAT option. For example, execute this to set the order of the year, month and day:

ADConnection1.ExecSQL('set dateformat ymd');

  2. Using [image] CONVERT function:

ADConnection1.ExecSQL('insert into Test (date_val) values (convert(datetime, ''2011-11-13 00:00'', 120)');

  3. Changing the format of your data to international standard:

ADConnection1.ExecSQL('insert into Test (date_val) values(''2011-11-13T00:00:00'');

QZ10: Posting updates to SQL Server table, I am getting error "Update command updated [N] instead of [1] record". What may be a reason for that ?

A: In most cases with SQL Server this error happens when the table has a trigger which modifies the DB explicitly, or implicitly by calling a stored procedure which modified the DB. Then FireDAC receives not the number of records updated by UPDATE command, but the number of records modified by the trigger.

To avoid that insert SET NOCOUNT ON at trigger beginning. Or set UpdateOptions.CountUpdatedRecords to False.

QZ11: I declared some table columns as DATETIME2 / DATE / TIME and FireDAC returns them as WideString. Or - I am getting Type mismatch, expecting Date, actual WideString. What is wrong ?

The DATETIME2 / DATE / TIME were introduced in SQL Server 2008. "SQL Server" (SQL Server 2000) ODBC driver does not know these types and maps them to WideStrings. The SQL Server Native Client v 10 knows them and represents correctly. To resolve the issue you should install SQL Server Native Client v 10. It is not installed by default, but "SQL Server" ODBC driver is installed by default.

What do you think about this topic? Send feedback!


Oracle Server Questions

Oracle Server Questions
FAQ Send Feedback

The list of questions and answers related to Oracle Server.

Group

FAQ

Links
FAQ
Description
QO1: I am looking at putting my application on a PC that already runs an Oracle client so don't want to use the registry keys. I want to make the path and TNS_Admin variables specific to my application only.

A: Just put tnsnames.ora file in the same folder, where Oracle Instant Client is located. No need to do something other, like specifying TNS_Admin or TNS_Names. If you does not need to use TNS aliases, then put empty tnsnames.ora file.

QO2: I am getting error »Cannot initialize OCI environment« in D2009 application. What is wrong ?

A: FireDAC cannot initialize OCI in the Unicode mode, that is required for D2009. Most probably, that is due to the old Oracle client version. We will suggest:

  • upgrade Oracle client software at least to v 9.0;
  • or stay with a non-Unicode Delphi (<= D2007).

QO3: I need to connect to an Oracle 8.0.5 server. Is that possible ?

A: Using the following "roadmap" you can choose the correct Oracle client and Delphi versions:

  • FireDAC with Delphi 2009 or higher requires at least Oracle 8.1.5 client. Because only starting from Oracle 8.1.5 the client works correctly with Unicode.
  • FireDAC with Delphi 2007 or less requires at least Oracle 8.0.3 client.

QO4: How to lock table with Oracle ?

A: Generic skeleton for your task may look like:

ADConnection1.StartTransaction;
try
  ADConnection1.ExecSQL('LOCK TABLE ...');
  .........
  ADConnection1.Commit;
except
  ADConnection1.Rollback;
  raise;
end;

QO5: How to get a list of Oracle services, like FireDAC is doing that in Login dialog ?

A: Use:

  • TADPhysOracleDriverLink.GetOracleHomes – to get a list of known Oracle homes;
  • TADPhysOracleDriverLink.GetTNSServices – to get a list of TNS aliases from the primary Oracle home.

QO6: Is the Oracle Objects extension supported ?

A: Not at this moment. As a workaround you can build PL/SQL wrapping procedures and functions. Using this approach, you can then work with Oracle Advanced Queuing.

What do you think about this topic? Send feedback!


SQLite Database Questions

SQLite Database Questions
FAQ Send Feedback

The list of questions and answers related to SQLite Database.

Group

FAQ

Links
FAQ
Description
QL1: How can I define collate sequence in SQLite DB?

A: There are completed collations, functions, extensions API's and demos. Check "Demos\DBMS Specific\SQLite\UserCollation".

If you need collations / functions at design-time make design-time package (fake component) where you register user collations / functions.

QL2: SQLite exception "[FireDAC][DApt]-401. Record is locked by another user."

A: The exception is raised on UPDATE command, when another DB connection has cursor on the same table and not all records are fetched from it. You must use FetchOptions.Mode=fmAll. Even you can set this option at ADConnection level, so all linked to it datasets will inherit this option.

QL3: Data type for non-table SELECT list item is wrong ? (or) My aggregated function returns string value. What is wrong ?

A: SQLite does not return a data type for non-table SELECT list items. IOW, if an item is an expression, then FireDAC cannot get it data type. So, it just describes it as ftWideString. FireDAC has ability to specify SELECT item data type: <item> as "<alias>::<data type>". For example:

SELECT count(*) as "cnt::int" from ...

QL4: It seems that character macro are not supported with SQLite? I try with CONCAT, LEFT, SUBSTR, UCASE, ..

A: These functions are implemented using FireDAC expression evaluator. When you are creating a connection at run-time, you should include uADStanExprFuncs.pas into "uses" clause.

SQLite has a limited set of build-in functions. But it allows to write and register custom functions. FireDAC has many custom functions implemented for the expression evaluator. They implementations and registrations are in ADStanExprFuncs. SQLite driver automatically registers all known expression evaluator functions with sqlite3.dll.

QL5: Is sqlite3_progress_handler implemented with FireDAC ?

A: Yes. Use the code like that:

procedure Tform1.FormCreate(Sender: TObject);
begin
  ADConnection1.Open;
  with TSQLiteDatabase(ADConnection1.ConnectionIntf.CliObj) do
  begin
    ProgressNOpers := 50000;
    OnProgress := SQLiteOnProgress;
  end;
end;

procedure Tform1.SQLiteOnProgress(ADB: TSQLiteDatabase; var ACancel: Boolean);
begin
  Application.ProcessMessages;
end;

QL6: Our WAL files are getting huge (>1 GB) when working with our multi-threaded application. Do you have any suggestion on how to prevent WAL files from growing?

A: If WAL file keeps growing that means it’s impossible to move data from the log into the database file. Probably the database is permanently used by reading threads and/or there are performed DML operations without committing a transaction. The possible solutions in this case are to use only short transactions or to create a separate thread for DML operations (in this case transactions should also be constantly committed).

If a checkpoint runs and copies all WAL data into the database file, the next writer starts writing into the start of the WAL file again. The WAL file is not usually truncated (see PRAGMA journal_size_limit if you want it to be) here. The reason being that it is faster to overwrite an existing file than it is to truncate one and then start appending to it.

So, if all goes well, SQLite should start over at the start of the WAL file after each checkpoint. Preventing the WAL file from growing indefinitely. There are two things that can go wrong:

  • A reader might prevent a check-pointer from copying all data from the WAL into the database file, or
  • While the checkpoint is underway, some other process may be writing to the database (appending to the WAL file).

If either of the above occurs, then the next writer will append to the WAL file, instead of writing into the start of it. If this happens every checkpoint, then the WAL file will grow without bound.

What do you think about this topic? Send feedback!


MySQL Server Questions

MySQL Server Questions
FAQ Send Feedback

The list of questions and answers related to MySQL Server.

Group

FAQ

Links
FAQ
Description
QY1: Is there any way to use MySQL C API function mysql_thread_id from FireDAC?

A: Yes, although a bit cryptic:

  • ADConnection1.ConnectionIntf.Driver.CliObj - returns reference to TMySQLLib;
  • ADConnection1.ConnectionIntf.CliObj - returns reference to TMySQLSession, which has MySQL property;
  • alltogether:

uses
  uADPhysMySQLCli, uADPhysMySQLWrapper;
...
  with ADConnection1.ConnectionIntf do
    TMySQLLib(Driver.CliObj).mysql_thread_id(TMySQLSession(CliObj).MySQL);

QY2: Update blob field with data greater then 512KB on MySQL cause "MySQL server has gone away" error.

A: Please, check: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html and at first the item, which suggest to increase max_allowed_packet.

QY3: Is it possible to establish SSL connection to a MySQL server ?

A: Yes, it is possible. For that set UseSSL=True for a connection definition. Then specify SSL_key, SSL_cert, SSL_ca, SSL_capath and SSL_cipher parameters. For the parameters meaning, please, read: http://dev.mysql.com/doc/refman/5.1/en/ssl-options.html. Note, that you can also use the my.cnf configuration file.

QY4: Why application hangs on for few second at exiting ? I am using only MySQL connection.

A: If your application creates threads, this issue (AD-58) is possible with libmysql.dll v 5.x. Please, read [image] http://bugs.mysql.com/bug.php?id=37226 for details. As workaround try to terminate all threads before terminating the application.

What do you think about this topic? Send feedback!


MS Access Questions

MS Access Questions
FAQ Send Feedback

The list of questions and answers related to MS Access.

Group

FAQ

Links
FAQ
Description
QA1: I am getting error "Too few parameters. Expected N". What that means ?

A: Most probably your SELECT query references to the columns, which does not exist in a table.

What do you think about this topic? Send feedback!


uADCompClient Namespace

uADCompClient Namespace
Classes Functions FireDAC Legend See Also Topics Send Feedback

Contains core data access components, including TADConnection, TADQuery, TADStoredProc, TADMemTable, etc.

Classes
Class | Description
TADAdaptedDataSet | The TADAdaptedDataSet class uses data adapter to execute DBMS queries, open DBMS cursors, fetch rows and post changes back to DBMS.
TADCommand | The class is responsible for execution of SQL commands.
TADConnection | The class is responsible to connection establishment with a DBMS.
TADCustomCommand | The base class is responsible for execution of SQL commands.
TADCustomConnection | The class is responsible to connection establishment with a DBMS.
TADCustomEventAlerter | The class is responsible for handling the database event notifications.
TADCustomLocalSQL | The base class for the Local SQL engine.
TADCustomManager | The class is responsible to connection definitions and connections management.
TADCustomMemTable | The class implementing in-memory dataset.
TADCustomQuery | The class implementing dataset, capable to execute SQL queries.
TADCustomSchemaAdapter | The class implementing Centralized Cached Updates support.
TADCustomStoredProc | The class implementing dataset, capable to execute server side stored procedures.
TADCustomTransaction | The class is responsible for connection transaction management.
TADCustomUpdateObject | The base class for update objects used to override updates posting.
TADEventAlerter | The class is responsible for handling the database event notifications.
TADLocalSQLDataSet | TADLocalSQLDataSet represents a dataset registered with Local SQL engine.
TADLocalSQLDataSets | TADLocalSQLDataSets is a collection of TADLocalSQLDataSet objects.
TADManager | The class is responsible to connection definitions and connections management.
TADMemTable | The class implementing in-memory dataset.
TADMetaInfoCommand | The class is responsible for execution of meta-data commands.
TADMetaInfoQuery | The class implementing dataset, capable to execute meta-info queries.
TADQuery | The class implementing dataset, capable to execute SQL queries.
TADRdbmsDataSet | The TADRdbmsDataSet class includes everything, required by descendants to execute SQL commands.
TADSchemaAdapter | The class implementing Centralized Cached Updates support.
TADStoredProc | The class implementing dataset, capable to execute server side stored procedures.
TADTable | The class implementing dataset, working with single database table.
TADTransaction | The class is responsible for connection transaction management.
TADUpdateSQL | TADUpdateSQL applies updates on behalf of queries or stored procedures that can't post updates directly.
Functions
Function | Description
ADManager | Function returns reference to global TADCustomManager object.
ADSetConnectionClass | Sets the TADCustomConnection descendant class.
ADSetManagerClass | Set the TADCustomManager descendant class.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Functions | The following table lists functions in this documentation.
Links
Classes, Functions, FireDAC, Legend, See Also, Topics
Description

The uADCompClient unit contains most of the core data access components:

  • TADManager - class managing all FireDAC connections;
  • TADConnection - class representing FireDAC connection to a DBMS;
  • TADTransaction - class controlling the DBMS transactions;
  • TADEventAlerter - class providing an unified interface to the DBMS events;
  • TADCommand - class implementing DBMS command;
  • TADMemTable - class implementing in-memory table;
  • TADTableAdapter;
  • TADSchemaAdapter - class servicing Centralized Cached Updates;
  • TADQuery - class implementing query object with dataset interface;
  • TADStoredProc - class implementing stored procedure object with dataset interface;
  • TADTable - class implementing table object with dataset interface;
See Also

uADCompDataSet, uADCompScript

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADCompClient Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADAdaptedDataSet | The TADAdaptedDataSet class uses data adapter to execute DBMS queries, open DBMS cursors, fetch rows and post changes back to DBMS.
TADCommand | The class is responsible for execution of SQL commands.
TADConnection | The class is responsible to connection establishment with a DBMS.
TADCustomCommand | The base class is responsible for execution of SQL commands.
TADCustomConnection | The class is responsible to connection establishment with a DBMS.
TADCustomEventAlerter | The class is responsible for handling the database event notifications.
TADCustomLocalSQL | The base class for the Local SQL engine.
TADCustomManager | The class is responsible to connection definitions and connections management.
TADCustomMemTable | The class implementing in-memory dataset.
TADCustomQuery | The class implementing dataset, capable to execute SQL queries.
TADCustomSchemaAdapter | The class implementing Centralized Cached Updates support.
TADCustomStoredProc | The class implementing dataset, capable to execute server side stored procedures.
TADCustomTransaction | The class is responsible for connection transaction management.
TADCustomUpdateObject | The base class for update objects used to override updates posting.
TADEventAlerter | The class is responsible for handling the database event notifications.
TADLocalSQLDataSet | TADLocalSQLDataSet represents a dataset registered with Local SQL engine.
TADLocalSQLDataSets | TADLocalSQLDataSets is a collection of TADLocalSQLDataSet objects.
TADManager | The class is responsible to connection definitions and connections management.
TADMemTable | The class implementing in-memory dataset.
TADMetaInfoCommand | The class is responsible for execution of meta-data commands.
TADMetaInfoQuery | The class implementing dataset, capable to execute meta-info queries.
TADQuery | The class implementing dataset, capable to execute SQL queries.
TADRdbmsDataSet | The TADRdbmsDataSet class includes everything, required by descendants to execute SQL commands.
TADSchemaAdapter | The class implementing Centralized Cached Updates support.
TADStoredProc | The class implementing dataset, capable to execute server side stored procedures.
TADTable | The class implementing dataset, working with single database table.
TADTransaction | The class is responsible for connection transaction management.
TADUpdateSQL | TADUpdateSQL applies updates on behalf of queries or stored procedures that can't post updates directly.
Namespace

uADCompClient Namespace

Links
Classes, uADCompClient Namespace, Legend
What do you think about this topic? Send feedback!


TADAdaptedDataSet Class

TADAdaptedDataSet Class
public protected TADAdaptedDataSet Members Classes See Also Send Feedback

The TADAdaptedDataSet class uses data adapter to execute DBMS queries, open DBMS cursors, fetch rows and post changes back to DBMS.

Group

Classes

Class Hierarchy
  uADCompClient_TADAdaptedDataSetuADCompClient_TADAdaptedDataSet
File

uADCompClient

Links
public, protected, TADAdaptedDataSet Members, Classes, See Also
Description

The TADAdaptedDataSet class is an intermediate class in FireDAC dataset classes hierarchy. The programmer must not use it directly.

The TADAdaptedDataSet class uses data adapter, pointed by Adapter property to execute DBMS queries, open DBMS cursors, fetch rows and post changes back to the DBMS. The dataset itself has no build-in capabilities to work with the DBMS.

For options description, please, look at uADStanOption description.

Syntax
TADAdaptedDataSet = class(TADDataSet);
See Also

TADDataSet, uADStanOption

What do you think about this topic? Send feedback!


TADAdaptedDataSet Members

TADAdaptedDataSet Members
Events TADAdaptedDataSet Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADAdaptedDataSet.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADAdaptedDataSet Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.
Links
Events, TADAdaptedDataSet Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
Events TADAdaptedDataSet Class Legend Methods Properties Send Feedback

The public members of the TADAdaptedDataSet class are listed here.

Events
Event | Description
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
Class

TADAdaptedDataSet Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
Disconnect | Disconnects the dataset from DBMS.
GetResults | Forces DBMS to return the output parameter values.
NextRecordSet | Go to the next cursor, returned by the SQL command.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
Properties
Property | Description
Adapter | The reference to a data adapter.
Command | The reference to a command, used to execute / open queries.
DatSManager | The reference to the inmemory data storage manager.
LocalSQL | The reference to a Local SQL engine.
PointedConnection | The actual connection object.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
Links
Events, TADAdaptedDataSet Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADAdaptedDataSet.Adapter Property

TADAdaptedDataSet.Adapter Property
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace Example public See Also Send Feedback

The reference to a data adapter.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, Example, public, See Also
Description

Use this property to get/set data adapter for dataset.

The dataset will use data adapter to talk to DBMS, when he needs to execute query, fetch rows, post changes back to DBMS.

Syntax
property Adapter: TADCustomTableAdapter;
See Also

TADCustomTableAdapter

Example

See FireDAC\Samples\Comp Layer\TADMemTable\IncFetching_MSSQL sample for details of how to use TADMemTable with table adapter.

See FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail sample for details of how to work with master-detail relation.

What do you think about this topic? Send feedback!


TADAdaptedDataSet.Command Property

TADAdaptedDataSet.Command Property
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public See Also Send Feedback

The reference to a command, used to execute / open queries.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public, See Also
Description

Property returns the reference to the SELECT command of data adapter. This command is used by the data adapter to execute DBMS queries by one of the Execute, ExecSQL and Open dataset methods.

Syntax
property Command: TADCustomCommand;
See Also

TADCustomCommand

What do you think about this topic? Send feedback!


TADAdaptedDataSet.DatSManager Property

TADAdaptedDataSet.DatSManager Property
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public See Also Send Feedback

The reference to the inmemory data storage manager.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public, See Also
Description

The property get/set the reference to the data storage manager. In general, data storage manager is a collection of data storage tables. Each dataset cursor will be represented by one data storage table.

Syntax
property DatSManager: TADDatSManager;
See Also

TADDatSManager, TADDatSTable

What do you think about this topic? Send feedback!


TADAdaptedDataSet.LocalSQL Property

TADAdaptedDataSet.LocalSQL Property
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public See Also Send Feedback

The reference to a Local SQL engine.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public, See Also
Description

Use this property to get / set reference to a Local SQL engine.

When engine and Local SQL connection are active, then right after setting LocalSQL property, the dataset will be opened (if not yet) and will be registered in Local SQL engine. Otherwise dataset will be registered when engine and connection will be active. The TADMemTable structure must be defined before it will be opened.

The dataset will be registered using its Name property value. So, its Name property value must be not empty and unique across all datasets linked to the same Local SQL engine.

Setting this property to nil unregisters this dataset from Local SQL engine.

Syntax
property LocalSQL: TADCustomLocalSQL;
See Also

Local SQL, TADLocalSQL, TADMemTable

What do you think about this topic? Send feedback!


TADAdaptedDataSet.OnError Event

TADAdaptedDataSet.OnError Event
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace Example public See Also Send Feedback

The event is triggered when an error happens, while dataset is talking to DBMS.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
AInitiator | The reference to interface of object, which initially raised the exception.
AException | The exception object, which may be modified or even replaced by another exception object instance.
Description

The OnError event is triggered, when dataset executes one of the following dataset operations and error happens:

  • Prepare. The dataset is preparing DBMS command for execution.
  • Open. The dataset is executing DBMS command to open cursor.
  • ExecSQL / ExecProc/Execute. The dataset is executing DBMS command.
  • Fetch. The dataset is fetching rows from cursor.

You can use also OnExecuteError event to handle Array DML errors, and OnUpdateError event to handle updates posting errors.

Syntax
property OnError: TADErrorEvent;
See Also

TADDataSet.Execute, TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, OnExecuteError, OnUpdateError

Example

See FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\BatchErrorHandling demo for details.

What do you think about this topic? Send feedback!


TADAdaptedDataSet.OnExecuteError Event

TADAdaptedDataSet.OnExecuteError Event
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace Example public See Also Send Feedback

The event is triggered when an error happens, while executing a Array DML query.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
ATimes | The current Array DML size. It may be different from value of the Execute method ATimes parameter, if full operation is splitted into few more small (on Firebird, for example).
AOffset | The current Array DML offset. It may be different from value of the Execute method AOffset parameter, if there was skipped erroneous rows or full operation is splitted into few more small (on Firebird, for example).
AError | The original DBMS returned error. Check AError.Errors[i].RowIndex for the index of erroneous row in parameters array.
AAction | The action dataset should take after return from event handler.
Description

The OnExecuteError event is triggered, when the dataset failed to execute Array DML using Execute method and ATimes > 1. Using this event handler you can:

  • skip erroneous row of the parameters array;
  • change values in erroneous row of the parameters array;
  • stop full Array DML execution.

Note, OnExecuteError will be not called for the syntax errors or when ATimes = 1.

Syntax
property OnExecuteError: TADExecuteErrorEvent;
See Also

Array DML, EADDBEngineException, TADErrorAction, TADDataSet.Execute

Example
procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AError: EADDBEngineException; var AAction: TADErrorAction);
begin
  if AException.Errors[0].Kind = ekUKViolated then
    AAction := eaSkip
  else
    AAction := eaFail;
end;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.PointedConnection Property

TADAdaptedDataSet.PointedConnection Property
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public See Also Send Feedback

The actual connection object.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public, See Also
Description

The PointedConnection property returns reference to a connection object, which:

  • is referenced by descendant dataset Connection property;
  • has the name specified by descendant dataset ConnectionName property.
Syntax
property PointedConnection: TADCustomConnection;
See Also

TADRdbmsDataSet.Connection, TADRdbmsDataSet.ConnectionName, TADCustomConnection

What do you think about this topic? Send feedback!


TADAdaptedDataSet.ServerEditRequest Property

TADAdaptedDataSet.ServerEditRequest Property
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public Send Feedback

Used by TADDataMove to edit directly DBMS data.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public
Syntax
property ServerEditRequest: TADActionRequest;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.AbortJob Method

TADAdaptedDataSet.AbortJob Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Use the AbortJob method to abort current dataset operation.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
AWait: Boolean = False | If True, then caller will wait until a current operation will be terminated.
Description

The AbortJob method aborts one of the following dataset operations:

  • Open. The dataset is executing DBMS command to open cursor.
  • ExecSQL/Execute. The dataset is executing DBMS command.
  • Fetch. The dataset is fetching rows from cursor.

After AbortJob call dataset state will be Active=False and Prepared=True for Open/ExecSQL/Execute. And Active=True for Fetch. The AbortJob method must be called from the other thread, than where a operation is performing.

Syntax
procedure AbortJob(AWait: Boolean = False);
See Also

Asynchronous Execution, TADResourceOptions.CmdExecMode, TADResourceOptions.CmdExecTimeout, Disconnect, TADCustomConnection.AbortJob

Example
ADQuery1.ResourceOptions.CmdExecMode := amAsync;
ADQuery1.Open('select OrderID, count(*) from "Order Details" group by OrderID');
ADQuery1.AbortJob(True);
What do you think about this topic? Send feedback!


TADAdaptedDataSet.AttachTable Method

TADAdaptedDataSet.AttachTable Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Use the AttachTable to attach the dataset to existing DatS table or view.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ATable: TADDatSTable | A table to attach.
AView: TADDatSView | A view to attach.
Description

The AttachTable method attaches the dataset to existing DatS table and or view.

After attaching the application may call Open method to open and browse the dataset. This method is primary useful for TADMemTable. At least one of the parameters must be not nil.

Syntax
procedure AttachTable(ATable: TADDatSTable; AView: TADDatSView); override;
See Also

TADMemTable

Example
ADMemTable1.AttachTable(oTab, nil) ;
ADMemTable1.Open;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.Disconnect Method

TADAdaptedDataSet.Disconnect Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Disconnects the dataset from DBMS.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
AAbortJob: Boolean = False | If True, then current dataset task will be aborted. The code will wait, while task abortion will be finished.
Description

The Disconnect method optionally aborts current dataset task, like a Open, Execute, ExecSQL or rows fetching. Then closes dataset and unprepares it.

Syntax
procedure Disconnect(AAbortJob: Boolean = False); override;
See Also

AbortJob

Example
ADQuery1.Disconnect(True);
// is equivalent to:
// ADQuery1.AbortJob(True);
// ADQuery1.Close;
// ADQuery1.Unprepare;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.GetResults Method

TADAdaptedDataSet.GetResults Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public See Also Send Feedback

Forces DBMS to return the output parameter values.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public, See Also
Description

Use GetResults to force a DBMS to return the output parameter values. This method is optional for most cases, because FireDAC will receive the output parameter values automatically. Although, when the command has few active not yet processed result sets, and you do not plan to use these result sets, but going to get output parameter values, then depending on a DBMS you may need to call first the GetResults method.

Syntax
procedure GetResults;
See Also

Executing Command, Executing Stored Procedure

What do you think about this topic? Send feedback!


TADAdaptedDataSet.NextRecordSet Method

TADAdaptedDataSet.NextRecordSet Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Go to the next cursor, returned by the SQL command.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

The NextRecordSet method closes current cursor, forwards it to the next accessible cursor and opens dataset. If there is no more accessible cursors, then after call dataset is closed. See "Command Batches" chapter for more details.

The Close method closes current cursor. The CloseAll method call discards all associated cursors. So, to get all cursors, you should set FetchOptions.AutoClose to False before opening dataset.

For FireDAC the Oracle and PostgreSQL REF CURSOR is a command cursors, and a NextRecordSet call will select the next REF CURSOR parameter. For SQL Server, Sybase SQL Anywhere, MySQL, etc a NextRecordSet call will select next result set, produced by batch, stored procedure or how else.

In design time, you can forward dataset to the next cursor, by right clicking component and choosing the "Next record set" popup menu item. See the "Executing Command" chapter for more details.

Syntax
procedure NextRecordSet;
See Also

Executing Command, Command Batches, TADFetchOptions.AutoClose, TDataSet.Open, TDataSet.Close

Example 1
ADQuery1.FetchOptions.AutoClose := False;
ADQuery1.SQL.Text := 'select 1 as i; select ''qwe'' as s';
ADQuery1.Open;
ShowMessage(ADQuery1.Fields[0].FieldName + ' ' + ADQuery1.Fields[0].AsString); // output "i 1"
ADQuery1.NextRecordSet;
ShowMessage(ADQuery1.Fields[0].FieldName + ' ' + ADQuery1.Fields[0].AsString); // output "s qwe"
ADQuery1.Close;
Example 2

See FireDAC\Samples\Comp Layer\TADStoredProc\Oracl_NextRecordSet demo for details of how to work with Oracle stored procedure, returning multiple REF CURSOR's.

What do you think about this topic? Send feedback!


TADAdaptedDataSet.ServerAppend Method

TADAdaptedDataSet.ServerAppend Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public Send Feedback

Used by TADDataMove to edit directly DBMS data.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public
Syntax
procedure ServerAppend;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.ServerCancel Method

TADAdaptedDataSet.ServerCancel Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public Send Feedback

Used by TADDataMove to edit directly DBMS data.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public
Description
Syntax
procedure ServerCancel;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.ServerDelete Method

TADAdaptedDataSet.ServerDelete Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public Send Feedback

Used by TADDataMove to edit directly DBMS data.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public
Syntax
procedure ServerDelete;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.ServerDeleteAll Method

TADAdaptedDataSet.ServerDeleteAll Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Deletes all records from an associated database table.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ANoUndo: Boolean = False | Use TRUNCATE command.
Description

Use ServerDeleteAll method to delete all records from a database table, specified in UpdateOptions.UpdateTableName, otherwise in SQL command or TableName property.

Set ANoUndo to True, to empty a table using the TRUNCATE SQL command, if DBMS supports it. Otherwise, method will issue DELETE SQL command without WHERE clause. Note, that on most DBMS's TRUNCATE command is not journaled and cannot be rolled back.

The ServerDeleteAll method may be used on inactive dataset.

Syntax
procedure ServerDeleteAll(ANoUndo: Boolean = False);
See Also

ExecSQL

Example
ADQuery1.SQL.Text := 'select * from {id MyTab}';
ADQuery1.ServerDeleteAll(True);
What do you think about this topic? Send feedback!


TADAdaptedDataSet.ServerEdit Method

TADAdaptedDataSet.ServerEdit Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public Send Feedback

Used by TADDataMove to edit directly DBMS data.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public
Syntax
procedure ServerEdit;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.ServerGotoKey Method

TADAdaptedDataSet.ServerGotoKey Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public Send Feedback

Used by TADDataMove to edit directly DBMS data.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public
Syntax
function ServerGotoKey: Boolean;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.ServerPerform Method

TADAdaptedDataSet.ServerPerform Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public Send Feedback

Used by TADDataMove to edit directly DBMS data.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public
Syntax
procedure ServerPerform;
What do you think about this topic? Send feedback!


TADAdaptedDataSet.ServerSetKey Method

TADAdaptedDataSet.ServerSetKey Method
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace public Send Feedback

Used by TADDataMove to edit directly DBMS data.

Group

public

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, public
Syntax
procedure ServerSetKey;
What do you think about this topic? Send feedback!


protected

protected
TADAdaptedDataSet Class Legend Properties Send Feedback

The protected members of the TADAdaptedDataSet class are listed here.

Class

TADAdaptedDataSet Class

Properties
Property | Description
UpdateObject | Specifies the update object component used to post updates by dataset.
Links
TADAdaptedDataSet Class, Legend, Properties
What do you think about this topic? Send feedback!


TADAdaptedDataSet.UpdateObject Property

TADAdaptedDataSet.UpdateObject Property
TADAdaptedDataSet Class TADAdaptedDataSet Members uADCompClient Namespace Example 1 Example 2 protected See Also Send Feedback

Specifies the update object component used to post updates by dataset.

Group

protected

Links
TADAdaptedDataSet Class, TADAdaptedDataSet Members, uADCompClient Namespace, Example 1, Example 2, protected, See Also
Description

Use UpdateObject to specify the TADUpdateSQL component to use in an application that must be able to post updates in a non-standard way.

The FireDAC has build in updates command generator, which using multiple information sources is able to generate SQL update commands for most of scenarios. In some cases, such as a query made against multiple tables, which may require multi-statement update, FireDAC cannot generate SQL update commands. In these cases, UpdateObject can be used to specify a TADUpdateSQL component that allows to specify custom SQL commands for each update posting case, like a insert / update / delete.

As alternative to update object usage, you can consider to use OnUpdateRecord event. It gives more options, but requires manual coding of posting updates. Also, in OnUpdateRecord handler you can use multiple update objects. See demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.

Syntax
property UpdateObject: TADCustomUpdateObject;
See Also

OnUpdateRecord, TADUpdateSQL

Example 1
ADUpdateSQL1.InsertSQL.Text := 'insert into mytab values (:new_id, :new_name)';
ADQuery1.UpdateObject := ADUpdateSQL1;
ADQuery1.Append;
ADQuery1['id'] := 100;
ADQuery1['name'] := 'qwe';
ADQuery1.Post;
Example 2

Demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.

What do you think about this topic? Send feedback!


TADCommand Class

TADCommand Class
published TADCommand Members Classes See Also Send Feedback

The class is responsible for execution of SQL commands.

Group

Classes

Class Hierarchy
  uADCompClient_TADCommanduADCompClient_TADCommand
File

uADCompClient

Links
published, TADCommand Members, Classes, See Also
Description

Use the TADCommand class to execute SQL command. The class does not provide TDataSet-aware access to returned result sets.

Syntax
TADCommand = class(TADCustomCommand);
See Also

Executing Command, Executing Stored Procedure, TADCustomCommand, TADCustomQuery, TADCustomStoredProc

What do you think about this topic? Send feedback!


TADCommand Members

TADCommand Members
Events TADCommand Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCommand.

Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterFetch | The event fires after fetching from command cursor.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeFetch | The event fires before fetching from command cursor.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.
Class

TADCommand Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current command operation.
AcquireConnection | Acquires reference to the actual connection object.
Close | Closes command current cursor.
CloseAll | Closes all command cursors.
Define | Defines DatS manager for command multiple result sets.
Define | Define DatS table structure for command's current cursor.
Disconnect | Use Disconnect method to release DBMS resources, used by this command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Fetch | Fetches rows from current command cursor.
FillParams | Fills the Params collection.
FindMacro | Returns macro by its name.
FindParam | Returns parameter by its name.
GetConnection | Returns the connection object.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Open | Executes SQL command, returning cursor.
OpenOrExecute | Execute SQL command, optionally returning cursor.
ParamByName | Returns parameter by its name.
Prepare | Prepares SQL command for execution.
ReleaseConnection | Releases reference to the actual connection object.
Unprepare | Releases SQL command resources.
Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Identifies base object name for some of command kinds.
BindedBy | Determines how command is connected to connection object.
CatalogName | Identifies catalog name for some command kinds.
CommandIntf | Returns IADPhysCommand interface.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
DataSet | Reference to dataset object owning this command.
FetchOptions | The set of options to control rows fetching.
FixedCommandKind | True, if the CommandKind property value is set explicitly.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
Overload | Oracle stored procedure overload index.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | The collection of parameters for a SQL command.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Identifies schema name for some of command kinds.
SQLText | The SQL command text as it will be sent to the DBMS.
State | Returns the current state of the command object.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.
Values | Provides access to the values for all parameters for the command.
Links
Events, TADCommand Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
Events TADCommand Class Legend Properties Send Feedback

The published members of the TADCommand class are listed here.

Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.
Class

TADCommand Class

Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Identifies base object name for some of command kinds.
CatalogName | Identifies catalog name for some command kinds.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
FetchOptions | The set of options to control rows fetching.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
Overload | Oracle stored procedure overload index.
Params | The collection of parameters for a SQL command.
ResourceOptions | The set of options to control resources usage.
SchemaName | Identifies schema name for some of command kinds.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.
Links
Events, TADCommand Class, Legend, Properties
What do you think about this topic? Send feedback!


TADCommand.Active Property

TADCommand.Active Property
TADCommand Class TADCommand Members uADCompClient Namespace Example published See Also Send Feedback

Gets or sets command active status.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example, published, See Also
Description

Set Active to True to execute SQL command and return cursor. After that the State = csOpen and you can fetch rows from current cursor using Fetch method. Setting Active to True, will call Open method.

Set Active to False to close current command cursor. After that State = csPrepared. Setting Active to False, will call Closemethod. To close all command cursors (if command returns multiple result sets), use CloseAll method.

Syntax
property Active: Boolean;
See Also

Fetch, Define, Open, Close, CloseAll, State

Example
ADCommand1.CommandText.Text := 'select * from "Orders"';
ADCommand1.Active := True;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ....
finally
  oTab.Free;
end;
What do you think about this topic? Send feedback!


TADCommand.ActiveStoredUsage Property

TADCommand.ActiveStoredUsage Property
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

Controls how to use Active property value saved to DFM.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
See Also

Active

What do you think about this topic? Send feedback!


TADCommand.AfterClose Event

TADCommand.AfterClose Event
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires after command is closed.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The AfterClose event fires, after command is closed by calling Close or setting Active = False.

Syntax
property AfterClose: TNotifyEvent;
See Also

BeforeClose, Close, Active

What do you think about this topic? Send feedback!


TADCommand.AfterExecute Event

TADCommand.AfterExecute Event
TADCommand Class TADCommand Members uADCompClient Namespace Example published See Also Send Feedback

The event fires after command is executed.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example, published, See Also
Description

The AfterExecute event fires, after command is executed by calling Execute method.

Syntax
property AfterExecute: TNotifyEvent;
See Also

BeforeExecute, Execute

Example
procedure TForm1.ADCommand1AfterExecute(ASender: TObject);
begin
  if ADCommand1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADCommand1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADCommand1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADCommand1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADCommand1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADCommand1.RowsAffected]);
    end;
end;
What do you think about this topic? Send feedback!


TADCommand.AfterOpen Event

TADCommand.AfterOpen Event
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires after command is opened.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The AfterOpen event fires, after command is opened by calling Open or setting Active = True.

Syntax
property AfterOpen: TNotifyEvent;
See Also

BeforeOpen, Open, Active

What do you think about this topic? Send feedback!


TADCommand.AfterPrepare Event

TADCommand.AfterPrepare Event
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires after command is prepared.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The AfterPrepare event fires, after command is prepared by calling Prepare method.

Syntax
property AfterPrepare: TNotifyEvent;
See Also

BeforePrepare, Prepare

What do you think about this topic? Send feedback!


TADCommand.AfterUnprepare Event

TADCommand.AfterUnprepare Event
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires after command is unprepared.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The AfterUnprepare event fires, after command is unprepared by calling Unprepare method.

Syntax
property AfterUnprepare: TNotifyEvent;
See Also

BeforeUnprepare, Unprepare

What do you think about this topic? Send feedback!


TADCommand.BaseObjectName Property

TADCommand.BaseObjectName Property
TADCommand Class TADCommand Members uADCompClient Namespace Example published See Also Send Feedback

Identifies base object name for some of command kinds.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example, published, See Also
Description

The BaseObjectName identifies the name of the base object. The meaning depends on CommandKind and MetaInfoKind:

  • If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then BaseObjectName specifies the name of the package, if procedure is packaged procedure.
  • If MetaInfoKind in [mkIndexFields, mkPrimaryKeyFields, mkForeignKeyFields], then BaseObjectName specifies the name of the table.
  • If MetaInfoKind in [mkProcs, mkProcArgs], then BaseObjectName specifies the name of the package.
Syntax
property BaseObjectName: String;
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind

Example
ADCommand1.BaseObjectName := 'MY_PACK';
ADCommand1.CommandText.Text := 'PROC1';
// or just ADCommand1.CommandText.Text := 'MY_PACK.PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Codegear Delphi';
ADCommand1.Execute;
What do you think about this topic? Send feedback!


TADCommand.BeforeClose Event

TADCommand.BeforeClose Event
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires before command will be closed.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The BeforeClose event fires, before command will be closed by calling Close or setting Active = False.

Syntax
property BeforeClose: TNotifyEvent;
See Also

AfterClose, Close, Active

What do you think about this topic? Send feedback!


TADCommand.BeforeExecute Event

TADCommand.BeforeExecute Event
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires before command will be executed.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The BeforeExecute event fires, before command will be executed by calling Execute method.

Syntax
property BeforeExecute: TNotifyEvent;
See Also

AfterExecute, Execute

What do you think about this topic? Send feedback!


TADCommand.BeforeOpen Event

TADCommand.BeforeOpen Event
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires before command will be opened.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The BeforeOpen event fires, before command will be opened by calling Open or setting Active = True.

Syntax
property BeforeOpen: TNotifyEvent;
See Also

AfterOpen, Open, Active

What do you think about this topic? Send feedback!


TADCommand.BeforePrepare Event

TADCommand.BeforePrepare Event
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires before command will be prepared.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The BeforePrepare event fires, before command will be prepared by calling Prepare method.

Syntax
property BeforePrepare: TNotifyEvent;
See Also

AfterPrepare, Prepare

What do you think about this topic? Send feedback!


TADCommand.BeforeUnprepare Event

TADCommand.BeforeUnprepare Event
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires before command will be unprepared.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The BeforeUnprepare event fires, before command wille be unprepared by calling Unprepare method.

Syntax
property BeforeUnprepare: TNotifyEvent;
See Also

BeforePrepare, Unprepare

What do you think about this topic? Send feedback!


TADCommand.CatalogName Property

TADCommand.CatalogName Property
TADCommand Class TADCommand Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Identifies catalog name for some command kinds.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

The CatalogName identifies the name of the catalog where resides command object. The meaning depends on CommandKind and MetainfoKind:

  • If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then CatalogName specifies the name of the catalog, where resides the procedure.
  • If MetainfoKind is not mkNone, then CatalogName specifies the name of the catalog, where resides the describing object.
Syntax
property CatalogName: String;
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName

Example 1
ADCommand1.CatalogName := 'MY_APP';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;
Example 2
ADMetaInfoCommand1.CatalogName := 'MY_APP';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on SQL Server just ADMetaInfoCommand1.ObjectName := 'MY_APP..MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;
What do you think about this topic? Send feedback!


TADCommand.CommandKind Property

TADCommand.CommandKind Property
TADCommand Class TADCommand Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Identifies the command kind.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

The CommandKind property identifies the kind of the content of CommandText property. You can explicitly set it value before Prepare call, otherwise it will be automatically assigned by FireDAC after analyzing CommandText content. There is only single need to assign it - when you are preparing stored procedure.

Syntax
property CommandKind: TADPhysCommandKind;
See Also

CommandText

Example 1
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'MY_PROC';
ADCommand1.Prepare;
Example 2
ADCommand1.CommandText.Text := 'ALTER PROCEDURE MY_PROC COMPILE';
case ADCommand1.CommandKind of
skAlter: ShowMessage('Alter command');
..........
else     ShowMessage('Other command');
end;
What do you think about this topic? Send feedback!


TADCommand.CommandText Property

TADCommand.CommandText Property
TADCommand Class TADCommand Members uADCompClient Namespace Example 1 Example 2 Example 3 published See Also Send Feedback

The SQL command text to execute.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example 1, Example 2, Example 3, published, See Also
Description

The CommandText set/get:

  • SQL command text to execute
  • or name of the stored procedure to execute, if CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs].

After setting CommandText, FireDAC will do for non-stored procedures:

  • extract parameters names and fill Params collection, if ResourceOptions.ParamCreate = True;
  • extract macro name and fill Macros collection, if ResourceOptions.MacroCreate = True;
  • extract FROM table name for SELECT commands and assign it to CommandIntf.SourceObjectName, if ResourceOptions.PreprocessCmdText = True;
  • fill CommandKind property value, if it is not explicitly set.

If you are adding long command, using CommandText.Add method, then it is recommended before command modification to call CommandText.BeginUpdate and after finishing command modification to call CommandText.EndUpdate.

Later on Prepare call command text will be preprocessed and transformed in target DBMS command. See chapter Preprocessing Command Text for details about FireDAC macros and escape sequences - preprocessor instructions.

Syntax
property CommandText: TStrings;
See Also

Preprocessing Command Text, Executing Command, TADResourceOptions.ParamCreate, TADResourceOptions.MacroCreate,TADResourceOptions.PreprocessCmdText, CommandKind, Params, Macros, ResourceOptions

Example 1

Stored procedure:

ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'MY_PROC';
ADCommand1.Prepare;
ADCommand1.Params[0].AsString := 'qwe';
ADCommand1.Execute;
Example 2

General SQL command:

ADCommand1.CommandText.Text := 'insert into MyTab values (:p1)';
ADCommand1.Params[0].AsString := 'qwe';
ADCommand1.Execute;
Example 3

Adding long command:

with ADCommand1.CommandText do begin
  BeginUpdate;
  Add('............');
  ......
  Add('............');
  EndUpdate;
end;
What do you think about this topic? Send feedback!


TADCommand.Connection Property

TADCommand.Connection Property
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

Specifies the connection object.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The Connection property value points to the connection object. Alternatively may be specified the ConnectionName property value. The Connection property value must be specified before Prepare call.

Syntax
property Connection: TADCustomConnection;
See Also

ConnectionName, Prepare

What do you think about this topic? Send feedback!


TADCommand.ConnectionName Property

TADCommand.ConnectionName Property
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

Specifies connection name.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The ConnectionName property value specifies the name of the connection. It must match to the:

  • name of one of connection definitions, either stored in external file or created on fly;
  • ConnectionName of one of the TADConnection objects.

Alternatively may be specified the Connection property value. The ConnectionName property value must be specified before Preparecall. If is specified the name of one of connection definitions, then FireDAC will transparently create connection object and link it with command.

Syntax
property ConnectionName: String;
See Also

Connection, Prepare

What do you think about this topic? Send feedback!


TADCommand.FetchOptions Property

TADCommand.FetchOptions Property
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The set of options to control rows fetching.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The FetchOptions property is the set of properties, controlling the fetching of cursor rows. These properties will inherit its values from FetchOptions of connection object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions, Fetch

What do you think about this topic? Send feedback!


TADCommand.FormatOptions Property

TADCommand.FormatOptions Property
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The set of options to control data representation.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Fetch, Params

What do you think about this topic? Send feedback!


TADCommand.Macros Property

TADCommand.Macros Property
TADCommand Class TADCommand Members uADCompClient Namespace Example 1 Example 2 Example 3 published See Also Send Feedback

The collection of macro substitution variables.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example 1, Example 2, Example 3, published, See Also
Description

The Macros property is the collection of macro substitution variables. It is populated automatically after assigning CommandText, if ResourceOptions.MacroCreate = True. Otherwise it may be populated by hands. At Prepare call, macro values will be substituted into CommandText, if ResourceOptions.MacroExpand = True.

Syntax
property Macros: TADMacros;
See Also

Executing Command, Preprocessing Command Text, CommandText, Params, Prepare, TADMacros, TADResourceOptions.MacroCreate, TADResourceOptions.MacroExpand

Example 1

Substitute table name:

ADCommand1.CommandText.Text := 'select * from &Tab';
ADCommand1.Macros[0].AsIdentifier := 'Order Details';
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from "Order Details"
Example 2

Substitute WHERE condition:

ADCommand1.CommandText.Text := 'select * from MyTab {if !cond} where !cond {fi}';
ADCommand1.Macros[0].AsString := 'ID > 100';
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from MyTab where ID > 100
ADCommand1.Macros[0].Clear;
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from MyTab
Example 3

See FireDAC\Samples\Comp Layer\TADQuery\Macros demo for details.

What do you think about this topic? Send feedback!


TADCommand.OnCommandChanged Event

TADCommand.OnCommandChanged Event
TADCommand Class TADCommand Members uADCompClient Namespace Example published See Also Send Feedback

The event fires after CommandText is changed.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example, published, See Also
Description

The OnCommandChanged event fires, after CommandText is changed.

Syntax
property OnCommandChanged: TNotifyEvent;
See Also

CommandText

Example
procedure TForm1.ADCommand1CommandChanged(ASender: TObject);
begin
  if ADCommand1.FindParam('ID') <> nil then
    ADCommand1.FindParams('ID').AsInteger := 100;
end;
What do you think about this topic? Send feedback!


TADCommand.OnError Event

TADCommand.OnError Event
TADCommand Class TADCommand Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The event fires when an error happens, while command is communicating with DBMS.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Parameters
Parameters | Description
ASender | The reference to command.
AInitiator | The reference to interface of object, which initially raised the exception.
AException | The exception object, which may be modified or even replaced by another exception object instance.
Description

The OnError event fires, when command executes one of the following operations and an error happens:

  • Prepare. The command is preparing DBMS command text for execution.
  • Open. The command is executing DBMS command to open cursor.
  • Execute. The command is executing DBMS command text.
  • Fetch. The command is fetching rows from cursor.

If most cases AException object will of EADDBEngineException class. If AException is of EADDBArrayExecuteError class, then it is Array DML error handling case. You should use code like in the example.

Syntax
property OnError: TADErrorEvent;
See Also

Handling Errors, Array DML, Open, Execute, Prepare, Fetch, EADDBArrayExecuteError class, EADDBEngineException class

Example 1

Handling Array DML errors:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;
Example 2

Error substitution:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;
What do you think about this topic? Send feedback!


TADCommand.Overload Property

TADCommand.Overload Property
TADCommand Class TADCommand Members uADCompClient Namespace Example published See Also Send Feedback

Oracle stored procedure overload index.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example, published, See Also
Description

The Overload property specifies Oracle packaged stored procedure overload index. It has no meaning for other DBMS's.

Syntax
property Overload: Word;
See Also

CommandText, CommandKind

Example
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'DBMS_SQL.PARSE';
ADCommand1.Overload := 1;
What do you think about this topic? Send feedback!


TADCommand.Params Property

TADCommand.Params Property
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The collection of parameters for a SQL command.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The Params property is the collection of parameters for a SQL command.

If CommandKind is not in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then Params is populated automatically after assigning CommandText, if ResourceOptions.ParamCreate = True.

If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then Params is populated automatically after calling Prepare method, if fiMeta is in FetchOption.Items.

Otherwise Params may be populated by hands. At Prepare call, parameters will be binded to prepared SQL command. After that you cannot change parameter types, otherwise will get an exception.

Syntax
property Params: TADParams;
See Also

Executing Command, CommandText, Macros, Prepare, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items

What do you think about this topic? Send feedback!


TADCommand.ResourceOptions Property

TADCommand.ResourceOptions Property
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The set of options to control resources usage.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The ResourceOptions property is the set of properties, controlling the resources usage by the command. These properties will inherit its values from ResourceOptions of connection object.

Syntax
property ResourceOptions: TADBottomResourceOptions;
See Also

Setting Options, TADBottomResourceOptions

What do you think about this topic? Send feedback!


TADCommand.SchemaName Property

TADCommand.SchemaName Property
TADCommand Class TADCommand Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Identifies schema name for some of command kinds.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

The SchemaName identifies the name of the schema where resides command object. The meaning depends on CommandKind and MetainfoKind:

  • If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then SchemaName specifies the name of the schema, where resides the procedure.
  • If MetainfoKind is not mkNone, then SchemaName specifies the name of the schema, where resides the describing object.
Syntax
property SchemaName: String;
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName

Example 1
ADCommand1.SchemaName := 'SCOTT';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;
Example 2
ADMetaInfoCommand1.SchemaName := 'ADDEMO';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on Oracle just ADMetaInfoCommand1.ObjectName := 'ADDEMO.MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;
What do you think about this topic? Send feedback!


TADCommand.Transaction Property

TADCommand.Transaction Property
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

Specifies a transaction object.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The Transaction property value points to a transaction object. The SQL command will be prepared and executed in the context of this transaction. The Transaction property value must be specified before Prepare call. If a value is not specified, then command will use default transaction object, specified at TADCustomConnection.Transaction or internal connection transaction object.

Note, at moment only Interbase / Firebird driver supports assignment of transaction to the command.

Syntax
property Transaction: TADCustomTransaction;
See Also

Managing Transactions, TADTransaction, TADCustomConnection.Transaction

What do you think about this topic? Send feedback!


TADCommand.UpdateOptions Property

TADCommand.UpdateOptions Property
TADCommand Class TADCommand Members uADCompClient Namespace published See Also Send Feedback

The set of options to control updates posting.

Group

published

Links
TADCommand Class, TADCommand Members, uADCompClient Namespace, published, See Also
Description

The UpdateOptions property is the set of properties, controlling the posting of updates. These properties will inherit its values from UpdateOptions of a connection object.

Syntax
property UpdateOptions: TADBottomUpdateOptions;
See Also

Setting Options, TADBottomUpdateOptions

What do you think about this topic? Send feedback!


TADConnection Class

TADConnection Class
published TADConnection Members Classes See Also Send Feedback

The class is responsible to connection establishment with a DBMS.

Group

Classes

Class Hierarchy
  uADCompClient_TADConnectionuADCompClient_TADConnection
File

uADCompClient

Links
published, TADConnection Members, Classes, See Also
Description

Use TADConnection to establish connection to a DBMS and manage associated datasets.

Syntax
TADConnection = class(TADCustomConnection);
See Also

Working with Connections, Managing Transactions, TADCustomConnection

What do you think about this topic? Send feedback!


TADConnection Members

TADConnection Members
Events TADConnection Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADConnection.

Events
Event | Description
AfterCommit | Fires after transaction is committed.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
OnError | Fires before FireDAC will raise exception.
OnLogin | Fires when an application connects to a DBMS.
OnLosted | Fires after FireDAC was not able to restore losted connection to DBMS.
OnRecover | Fires after FireDAC discovered that connection to DBMS is losted.
OnRestored | Fires after FireDAC successfully restored losted connection to DBMS.
Class

TADConnection Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort all running dataset operations on this connection.
ApplyUpdates | Applies change logs of specified datasets to the DBMS.
Assign | Assigns all properties of one connection to this connection.
CheckActive | Checks to see if the connection is active.
CheckConnectionDef | Checks that connection definition is filled correctly.
CheckInactive | Checks to see if the connection is inactive.
CheckOnline | Checks to see if the connection is in online mode.
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
DecodeObjectName | Splits DB object name into parts.
EncodeObjectName | Assembles DB object name from it parts.
ExecSQL | Executes a SQL command without parameters.
ExecSQL | Executes SQL command with parameters.
ExecSQL | Executes a SQL command with parameters.
ExecSQLScalar | Executes a SQL command without parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetInfoReport | Populates a string list with a detailed report about a connection state.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetLastAutoGenValue | Returns last auto generated value.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
Offline | Sets connection to offline mode.
Online | Sets connection to online mode.
Open | Open connection to the database, using specified connection string.
Open | Open connection to the database, using specified user name and password.
Open | Open connection to the database, using specified connection parameters, user name and password.
Ping | Pings the DBMS server.
RefreshMetadataCache | Invalidates meta data cache.
ReleaseClients | Performs resource releasing operation on all associated datasets and commands.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.
Properties
Property | Description
CliHandle | CLI handle for connection sharing.
CliObj | Returns a CLI connection wrapping object.
CommandCount | The number of assocciated TADCustomCommand objects.
Commands | Returns assocciated TADCustomCommand objects.
Connected | Gets / sets connection active status.
ConnectedStoredUsage | Controls how to use Connected property value saved to DFM.
ConnectionDefName | The name of connection definition to use.
ConnectionIntf | Returns the IADPhysConnection interface.
ConnectionMetaDataIntf | Returns an IADPhysConnectionMetadata interface.
ConnectionName | Specifies the name of the connection to associate with this connection object.
DataSets | Returns assocciated TADDataSet objects.
DriverName | Specifies the ID of the FireDAC driver for the connection.
FetchOptions | The set of default options to control rows fetching.
FormatOptions | The set of default options to control data representation.
InTransaction | Indicates whether a connection transaction is in progress or not.
IsSQLBased | Property returns True, if a data source supports SQL language.
LastUsed | The date and time of last usage of the connection.
LoginDialog | Gets / sets the reference to login dialog interface.
LoginPrompt | Specifies whether a login dialog appears immediately before opening a new connection.
Messages | Returns a list of messages returned by DBMS after recent database operation.
Offlined | Gets / sets connection offline status.
OptionsIntf | The reference to IADStanOptions interface.
Params | Lists database connection parameters for the FireDAC connection definition associated with the connection object.
RDBMSKind | Returns the brand of DBMS currently connected.
RefCount | Returns the number of references to this connection object.
ResourceOptions | The set of default options to control resources usage.
ResultConnectionDef | The actual connection definition used to establish connection to a DBMS.
SharedCliHandle | CLI handle shared with other connection.
Temporary | Shows whether a connection object is created on fly (temporary one) and managed automatically or a persistent one explicitly created, managed, and freed by the application.
Transaction | The reference to TADCustomTransaction object.
TxOptions | The set of options to control transactions.
UpdateOptions | The set of default options to control data updating.
UpdateTransaction | The reference to TADCustomTransaction object, which will be used to post changes to DB.
Links
Events, TADConnection Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
Events TADConnection Class Legend Properties Send Feedback

The published members of the TADConnection class are listed here.

Events
Event | Description
AfterCommit | Fires after transaction is committed.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
OnError | Fires before FireDAC will raise exception.
OnLogin | Fires when an application connects to a DBMS.
OnLosted | Fires after FireDAC was not able to restore losted connection to DBMS.
OnRecover | Fires after FireDAC discovered that connection to DBMS is losted.
OnRestored | Fires after FireDAC successfully restored losted connection to DBMS.
Class

TADConnection Class

Properties
Property | Description
Connected | Gets / sets connection active status.
ConnectedStoredUsage | Controls how to use Connected property value saved to DFM.
ConnectionDefName | The name of connection definition to use.
ConnectionName | Specifies the name of the connection to associate with this connection object.
DriverName | Specifies the ID of the FireDAC driver for the connection.
FetchOptions | The set of default options to control rows fetching.
FormatOptions | The set of default options to control data representation.
LoginDialog | Gets / sets the reference to login dialog interface.
LoginPrompt | Specifies whether a login dialog appears immediately before opening a new connection.
Params | Lists database connection parameters for the FireDAC connection definition associated with the connection object.
ResourceOptions | The set of default options to control resources usage.
Transaction | The reference to TADCustomTransaction object.
TxOptions | The set of options to control transactions.
UpdateOptions | The set of default options to control data updating.
UpdateTransaction | The reference to TADCustomTransaction object, which will be used to post changes to DB.
Links
Events, TADConnection Class, Legend, Properties
What do you think about this topic? Send feedback!


TADConnection.AfterCommit Event

TADConnection.AfterCommit Event
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Fires after transaction is committed.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.

Syntax
property AfterCommit: TNotifyEvent;
See Also

BeforeCommit

What do you think about this topic? Send feedback!


TADConnection.AfterRollback Event

TADConnection.AfterRollback Event
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Fires after transaction is rolled back.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The AfterRollback event fires after the Rollback method is executed and the transaction is rolled back. In case of a nested transaction in AfterRollback event handler the transaction is not yet rolled back in full, but nesting level is decremented.

Syntax
property AfterRollback: TNotifyEvent;
See Also

BeforeRollback

What do you think about this topic? Send feedback!


TADConnection.AfterStartTransaction Event

TADConnection.AfterStartTransaction Event
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Fires after transaction is started.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The AfterStartTransaction event fires after the StartTransaction method is executed and the transaction is started. In case of a nested transaction in AfterStartTransaction event handler the transaction is not just started, but nesting level is incremented.

Syntax
property AfterStartTransaction: TNotifyEvent;
See Also

BeforeStartTransaction

What do you think about this topic? Send feedback!


TADConnection.BeforeCommit Event

TADConnection.BeforeCommit Event
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Fires before transaction will be committed.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The BeforeCommit event fires before the Commit method will be executed and the transaction will be committed.

Syntax
property BeforeCommit: TNotifyEvent;
See Also

AfterCommit

What do you think about this topic? Send feedback!


TADConnection.BeforeRollback Event

TADConnection.BeforeRollback Event
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Fires before transaction will be rolled back.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The BeforeRollback event fires before the Rollback method will be executed and the transaction will be rolled back.

Syntax
property BeforeRollback: TNotifyEvent;
See Also

AfterRollback

What do you think about this topic? Send feedback!


TADConnection.BeforeStartTransaction Event

TADConnection.BeforeStartTransaction Event
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Fires before transaction will be started.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The BeforeStartTransaction event fires before the StartTransaction method will be executed and the transaction will be started.

Syntax
property BeforeStartTransaction: TNotifyEvent;
See Also

AfterStartTransaction

What do you think about this topic? Send feedback!


TADConnection.Connected Property

TADConnection.Connected Property
TADConnection Class TADConnection Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Gets / sets connection active status.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Set Connected to True to establish a connection to a DBMS. Set Connected to False to close a connection. The default value for Connected is False.

An application can check Connected to determine the current status of a connection. If Connected is True, the connection is active; if False, and the KeepConnection property is also False, then the connection is inactive.

To open connection, it must be setup in one of the following ways:

  1. Set ConnectionDefName to a name of one of a existing connection definitions and optionally override connection definition parameters in Params. Existing connection definition may be defined either in connection definitions INI file or created on fly, for example, using TADCustomManager.AddConnectionDef;
  2. Set DriverName to a name of one of a registered drivers (or add DriverID into Params) and specify connection definition parameters in Params.

When the connection definition is pooled (Pooled=True), then use (1) and does not override any of parameters, otherwise you will get an exception.

Setting Connected to False will try to connect to a DB. If somehow the connecting fails, then Connected will remain False and an an exception will be raised. If connecting failed due to a DB unavailability, then application may use Automatic Connection Recovery feature to wait and try to establish the connection.

Setting Connected to False will disconnect (close and unprepare) all associated commands and datasets. If you just need to disconnect from DBMS, but does not close objects, then use Offlined property.

Syntax
property Connected;
See Also

TCustomConnection.BeforeConnect, TCustomConnection.AfterConnect, TCustomConnection.BeforeDisconnect, TCustomConnection.AfterDisconnect, ConnectionDefName, DriverName, Params, Offlined, OnRecover

Example 1
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;
Example 2

See FireDAC\Samples\Comp Layer\TADConnection\Pooling sample for details of how to work with pooled connections.

What do you think about this topic? Send feedback!


TADConnection.ConnectedStoredUsage Property

TADConnection.ConnectedStoredUsage Property
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Controls how to use Connected property value saved to DFM.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The ConnectedStoredUsage property controls how to use Connected property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ConnectedStoredUsage: TADStoredActivationUsage;
See Also

Connected

What do you think about this topic? Send feedback!


TADConnection.ConnectionDefName Property

TADConnection.ConnectionDefName Property
TADConnection Class TADConnection Members uADCompClient Namespace Example 1 Example 2 Example 3 published See Also Send Feedback

The name of connection definition to use.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example 1, Example 2, Example 3, published, See Also
Description

The ConnectionDefName property specifies the name of one of a existing connection definitions. It must be stored in ADConnectionDefs.ini or created dynamically.

Note, attempting to set ConnectionDefName when the Connected property is true raises an exception.

Syntax
property ConnectionDefName: String;
See Also

Defining Connection, TADCustomManager

Example 1
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;
Example 2

See demo FireDAC\Samples\Comp Layer\TADConnection\ConnectionDefs for details how to create and use connection definitions.

Example 3

Specifying pooled connection:

var
  oList: TStringList;
  ......
  oList := TStringList.Create;
  oList.Add('Server=MyServer');
  oList.Add('Database=Northwind');
  oList.Add('User_Name=sa');
  oList.Add('Password=');
  oList.Add('Pooled=True');
  ADManager.AddConnectionDef('myconn', 'MSSQL', oList);
  ......
  ADConnection1.ConnectionDefName := 'myconn';
  ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADConnection.ConnectionName Property

TADConnection.ConnectionName Property
TADConnection Class TADConnection Members uADCompClient Namespace Example published See Also Send Feedback

Specifies the name of the connection to associate with this connection object.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example, published, See Also
Description

Use ConnectionName to specify the name of the connection to use with a connection object. If ConnectionName is the same as an existing connection definition, then the ConnectionDefName and DriverName properties need not be set. If ConnectionName does not match an existing connection definition, then either the application must also supply a valid connection definition in the ConnectionDefName property in addition to the or it must supply the DriverName and Params properties.

You can specifiy as ConnectionName for TADCustomCommand or TADRDBMSDataSet component and its descendants (TADQuery, TADStoredProc, TADTable), the ConnectionName of one of the existing TADConnection objects or the name of one of the existing connection definitions.

Notes
  1. Attempting to set ConnectionName when the Connected property is true raises an exception.
  2. At design time double-click a TConnection component to invoke the Database editor and set the ConnectionName.
Syntax
property ConnectionName: String;
See Also

ConnectionDefName, DriverName, Params, TADCustomCommand.ConnectionName, TADRDBMSDataSet.ConnectionName

Example
ADConnection1.ConnectionName := 'TestConn';
ADConnection1.DriverName := 'Oracl';'
ADConnection1.Params.Add('Database=testdb');
....
ADQuery1.ConnectionName := 'TestConn';
ADQuery1.Open('select * from test_tab');
What do you think about this topic? Send feedback!


TADConnection.DriverName Property

TADConnection.DriverName Property
TADConnection Class TADConnection Members uADCompClient Namespace Example published See Also Send Feedback

Specifies the ID of the FireDAC driver for the connection.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example, published, See Also
Description

Use DriverName to specify the ID of the FireDAC driver to use for connection that do not specify an ConnectionDefName. DriverName must be a valid FireDAC registered driver ID.

If an application sets DriverName, it must also specify connection parameters in the Params property. Ordinarily the alias specified in the ConnectionDefName property supplies connection parameters, but when DriverName is set, the ConnectionDefName property is automatically cleared to avoid FireDAC driver ID contention.

Attempting to set DriverName when the Connected property is True raises an exception.

Setting DriverName value, will add DriverID=<xxx> parameter to the Params list.

Notes

At design time double-click a TConnection component to invoke the Connection editor and set the DriverName.

Or choose DriverName value in property inspector from drop-down list.

Syntax
property DriverName: string;
See Also

Params, ConnectionDefName

Example
ADConnection1.DriverName := 'Oracl';'
ADConnection1.Params.Add('Database=testdb');
....
ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select * from test_tab');
What do you think about this topic? Send feedback!


TADConnection.FetchOptions Property

TADConnection.FetchOptions Property
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

The set of default options to control rows fetching.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The FetchOptions property is the set of default properties, controlling the fetching of cursor rows. These properties will be inherited by commands and datasets, associated with this connection. Also these properties will inherit its values from FetchOptions of ADManager object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions, ADManager

What do you think about this topic? Send feedback!


TADConnection.FormatOptions Property

TADConnection.FormatOptions Property
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

The set of default options to control data representation.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The FormatOptions property is the set of the default properties, controlling the data type mapping, and some other aspects of data handling. These properties will be inherited by commands and datasets, accossiated with this connection. Also these properties will inherit its values from FormatOptions of ADManager object.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, ADManager

What do you think about this topic? Send feedback!


TADConnection.LoginDialog Property

TADConnection.LoginDialog Property
TADConnection Class TADConnection Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the reference to login dialog interface.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example, published, See Also
Description

The LoginDialog property allows to associate the login dialog TADGUIxLoginDialog with this connection. The dialog instance assigned to the LoginDialog will be used only by this connection object.

If the LoginDialog property is not assigned, but the TADGUIxLoginDialog is in your application or one of the units uADGUIxXxxxLogin is linked into application, then the connection object will use the global login dialog instance.

The login dialog will popup at connecting to a DBMS only if all of the following conditions are met:

  • LoginPrompt=True;
  • connection definition is not pooled (Pooled=False);
  • global silent flag is not set to True (ADGUIxSilent() = False);
  • connection object does not use shared CLI handle (SharedCliHandle = nil).
Syntax
property LoginDialog: TADGUIxLoginDialog;
See Also

Establishing Connection, TADGUIxLoginDialog, LoginPrompt, SharedCliHandle, ADGUIxSilent

Example

Using private login dialog:

ADGUIxLoginDialog1.Caption := 'Welcome to the Northwind DB';
ADGUIxLoginDialog1.VisibleItems.Add('User_name');
ADGUIxLoginDialog1.VisibleItems.Add('Password');
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.LoginPrompt := True;
ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADConnection.LoginPrompt Property

TADConnection.LoginPrompt Property
TADConnection Class TADConnection Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Specifies whether a login dialog appears immediately before opening a new connection.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Set LoginPrompt to True to provide login support when establishing a connection. When LoginPrompt is True, a dialog appears to prompt users for a name, password and other optional parameters. The dialog appears after the BeforeConnect event and before the AfterConnect event, unless you supply an OnLogin event handler. If there is an OnLogin event handler, that event occurs in place of the login dialog. If correct values for the user name, password and other optional parameters are not supplied in the dialog or by the OnLogin event handler, the connection fails. This OnLogin event does not fire unless LoginPrompt is set to True.

When LoginPrompt is False, the application must supply user name, password and other optional parameter values programmatically. For that application can specify User_name, Password, etc parameters in Params.

The login dialog will popup at connecting to a DBMS only if all of the following conditions are met:

  • LoginPrompt=True;
  • connection definition is not pooled (Pooled=False);
  • global silent flag is not set to True (ADGUIxSilent() = False);
  • connection object does not use shared CLI handle (SharedCliHandle = nil).
Syntax
property LoginPrompt;
See Also

Establishing Connection, OnLogin, LoginDialog, Params, SharedCliHandle, ADGUIxSilent, AfterConnect

Example 1

Using login dialog:

ADGUIxLoginDialog1.Caption := 'Welcome to the Northwind DB';
ADGUIxLoginDialog1.VisibleItems.Add('User_name');
ADGUIxLoginDialog1.VisibleItems.Add('Password');
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.LoginPrompt := True;
ADConnection1.Connected := True;
Example 2

Connecting without login dialog:

procedure TForm1.ADConnection1Login(AConnection: TADCustomConnection; const AConnectionDef: IADStanConnectionDef);
begin
  AConnectionDef.UserName := 'dba';
  AConnectionDef.Password := 'sql';
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  ADConnection1.OnLogin := ADConnection1Login;
  ADConnection1.LoginPrompt := True;
  ADConnection1.Connected := True;
end;
What do you think about this topic? Send feedback!


TADConnection.OnError Event

TADConnection.OnError Event
TADConnection Class TADConnection Members uADCompClient Namespace Example published See Also Send Feedback

Fires before FireDAC will raise exception.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example, published, See Also
Parameters
Parameters | Description
ASender | This connection object.
AInitiator | The interface of the object initially discovered error.
AException | The exception object to be raised.
Description

The OnError event handler fires before FireDAC will raise exception inside of call of one of the connection or assocciated commands or datasets methods. In most cases AException will be of EADDBEngineException class.

The event handler can replace AException object with some other custom exception. In this case original object must be freed.

Syntax
property OnError: TADErrorEvent;
See Also

Handling Errors, EADDBEngineException

Example
procedure TForm1.ADConnection1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if (AException is EADDBEngineException) and (EADDBEngineException(AException).Kind = ekUKViolated) then begin
    AException.Free;
    AException := Exception.Create('You must enter unique document number !');
  end;
end;
What do you think about this topic? Send feedback!


TADConnection.OnLogin Event

TADConnection.OnLogin Event
TADConnection Class TADConnection Members uADCompClient Namespace Example published See Also Send Feedback

Fires when an application connects to a DBMS.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example, published, See Also
Description

Write an OnLogin event handler to take specific actions when an application attempts to connect to a DBMS. When the LoginPrompt property is True, a database login is required. The login dialog and OnLogin event only occur when the LoginPromptproperty is true.

If there is no OnLogin event handler, the current User_Name is read from the Params property or connection definition, and a standard Login dialog box opens. The dialog prompts for a user name, password and other optional parameters, and then uses the values entered by the user to set the User_Name, Password and other optional values in the Params property. These values are then passed to the DBMS.

Applications that provide alternative OnLogin event handlers may set the User_Name, Password and other optional values in AConnectionDef. AConnectionDef is a temporary connection definition and is freed automatically when no longer needed.

Syntax
property OnLogin: TADConnectionLoginEvent;
See Also

Establishing Connection, LoginPrompt, Connected, IADStanConnectionDef

Example

Connecting without login dialog:

procedure TForm1.ADConnection1Login(AConnection: TADCustomConnection; const AConnectionDef: IADStanConnectionDef);
begin
  AConnectionDef.UserName := 'dba';
  AConnectionDef.Password := InputBox('Login', 'Please enter DBA password', 'sql');
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  ADConnection1.OnLogin := ADConnection1Login;
  ADConnection1.LoginPrompt := True;
  ADConnection1.Connected := True;
end;
What do you think about this topic? Send feedback!


TADConnection.OnLosted Event

TADConnection.OnLosted Event
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Fires after FireDAC was not able to restore losted connection to DBMS.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The OnLosted event fires after FireDAC was not able to automatically restore connection to the DBMS, after discovering that it is losted.

Syntax
property OnLosted: TNotifyEvent;
See Also

Recovering Connection, OnRecover, OnRestored

What do you think about this topic? Send feedback!


TADConnection.OnRecover Event

TADConnection.OnRecover Event
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Fires after FireDAC discovered that connection to DBMS is losted.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Parameters
Parameters | Description
ASender | This connection object.
AInitiator | The interface of the object initially discovered error.
AException | The exception object describing losted connection issue.
AAction | The action FireDAC should take after return from event handler.
Description

The OnRecover event fires after FireDAC discovered that connection to DBMs is losted. The event handler can analyze the reason, ask user how to proceed, show some status and returns the action, FireDAC should take:

Action | Description
faDefault | If ResourceOptions.AutoReconnect =True, then FireDAC will try to reconnect, otherwise will raise an exception, that connection is losted. By default ResourceOptions.AutoReconnect = False.
faFail | Close connection and raise an exception, that connection is losted.
faRetry | Try to reconnect.
faCloseAbort | Close connection and abort current operation.
faOfflineAbort | Switch connection to the offline mode and abort current operation.

If event handler is not assigned, then FireDAC will take default (faDefault) action. If after 3 trials connection cannot be restored, then FireDAC will close connection and raise an exception, that connection is losted.

Syntax
property OnRecover: TADConnectionRecoverEvent;
See Also

Recovering Connection, OnLosted, OnRestored, TADTopResourceOptions.AutoReconnect, Connected, Offlined

What do you think about this topic? Send feedback!


TADConnection.OnRestored Event

TADConnection.OnRestored Event
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

Fires after FireDAC successfully restored losted connection to DBMS.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The OnRestored event fires after FireDAC successfully restored connection to the DBMS, after discovering that it is losted.

Syntax
property OnRestored: TNotifyEvent;
See Also

Recovering Connection, OnLosted, OnRecover

What do you think about this topic? Send feedback!


TADConnection.Params Property

TADConnection.Params Property
TADConnection Class TADConnection Members uADCompClient Namespace Example published See Also Send Feedback

Lists database connection parameters for the FireDAC connection definition associated with the connection object.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example, published, See Also
Description

Use Params to list DBMS connection definition parameters, such server name, port, database, client character set, user name and password. The possible set of parameters depends on the DBMS kind to connect to.

Params is a list of string items, each representing a different DBMS connection definition parameter. If the ConnectionDefName property specifies a valid FireDAC connection definition, then parameters, specified in Params, will override corresponsding connection definition parameters. If an application need to specify connection definition parameter on-fly, then an application must fill-in all required connection definition parameter into Params.

At design time double-click a TConnection component to invoke the Connection editor and set Params.

Syntax
property Params: TStrings;
See Also

Defining Connection, ConnectionDefName, DriverName, OnLogin

Example
with ADConnection1.Params do begin
  Clear;
  Add('DriverID=Ora');
  Add('Database=ORA_920_APP');
  Add('User_Name=ADDemo');
  Add('Password=a');
end;
ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADConnection.ResourceOptions Property

TADConnection.ResourceOptions Property
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

The set of default options to control resources usage.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The ResourceOptions property is the set of the default properties, controlling the resources usage by the command. These properties will be inherited by commands and datasets, accossiated with this connection. Also these properties will inherit its values from ResourceOptions of ADManager object.

Syntax
property ResourceOptions: TADTopResourceOptions;
See Also

Setting Options, TADTopResourceOptions, ADManager

What do you think about this topic? Send feedback!


TADConnection.Transaction Property

TADConnection.Transaction Property
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

The reference to TADCustomTransaction object.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The Transaction property get/set reference to the transaction object, which will be default one for the connection and all associated datasets and commands without explicitly assigned Transaction property. At moment, this behavior has the meaning only for Interbase / Firebird connection.

Syntax
property Transaction: TADCustomTransaction;
See Also

UpdateTransaction, TADCustomTransaction

What do you think about this topic? Send feedback!


TADConnection.TxOptions Property

TADConnection.TxOptions Property
TADConnection Class TADConnection Members uADCompClient Namespace Example published See Also Send Feedback

The set of options to control transactions.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, Example, published, See Also
Description

The TxOptions property is the set of the properties, controlling the transactions in this connection.

You can change transaction properties while there is no active transactions. If you set Transaction property, then application should use Transaction.Options, instead of TxOptions.

Syntax
property TxOptions: TADTxOptions;
See Also

Transaction, TADTxOptions

Example

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.

What do you think about this topic? Send feedback!


TADConnection.UpdateOptions Property

TADConnection.UpdateOptions Property
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

The set of default options to control data updating.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The UpdateOptions property is the set of the default properties, controlling the data updating by the datasets. These properties will be inherited by datasets, associated with this connection. Also these properties will inherit its values from UpdateOptions of ADManager object.

Syntax
property UpdateOptions: TADUpdateOptions;
See Also

Setting Options, TADUpdateOptions, ADManager

What do you think about this topic? Send feedback!


TADConnection.UpdateTransaction Property

TADConnection.UpdateTransaction Property
TADConnection Class TADConnection Members uADCompClient Namespace published See Also Send Feedback

The reference to TADCustomTransaction object, which will be used to post changes to DB.

Group

published

Links
TADConnection Class, TADConnection Members, uADCompClient Namespace, published, See Also
Description

The UpdateTransaction property get/set reference to the transaction object, which will be default one for all associated datasets without explicitly assigned UpdateTransaction property. This transaction will be used by datasets to post changes to the DB.

If UpdateTransaction is not assigned, but Transaction is assigned, then Transaction object will be used as update transaction.

At moment, this behaviour has the meaning only for Interbase / Firebird connection.

Syntax
property UpdateTransaction: TADCustomTransaction;
See Also

Transaction, TADCustomTransaction

What do you think about this topic? Send feedback!


TADCustomCommand Class

TADCustomCommand Class
public TADCustomCommand Members Classes See Also Send Feedback

The base class is responsible for execution of SQL commands.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomCommand
File

uADCompClient

Links
public, TADCustomCommand Members, Classes, See Also
Description

Use the TADCustomCommand class to execute SQL command. The class does not provide TDataSet-aware access to returned resultsets.

This class hides some of properties, allowing to control visibility of properties by descendant classes. End users should use TADCommand.

Syntax
TADCustomCommand = class(TADComponent, IUnknown, IADStanOptions, IADStanErrorHandler, IADStanObject, IADStanAsyncHandler, IADPhysCommandStateHandler);
See Also

Executing Command, Executing Stored Procedure, TADCommand, TADCustomQuery, IADPhysCommand

What do you think about this topic? Send feedback!


TADCustomCommand Members

TADCustomCommand Members
Events TADCustomCommand Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomCommand.

Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterFetch | The event fires after fetching from command cursor.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeFetch | The event fires before fetching from command cursor.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.
Class

TADCustomCommand Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current command operation.
AcquireConnection | Acquires reference to the actual connection object.
Close | Closes command current cursor.
CloseAll | Closes all command cursors.
Define | Defines DatS manager for command multiple result sets.
Define | Define DatS table structure for command's current cursor.
Disconnect | Use Disconnect method to release DBMS resources, used by this command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Fetch | Fetches rows from current command cursor.
FillParams | Fills the Params collection.
FindMacro | Returns macro by its name.
FindParam | Returns parameter by its name.
GetConnection | Returns the connection object.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Open | Executes SQL command, returning cursor.
OpenOrExecute | Execute SQL command, optionally returning cursor.
ParamByName | Returns parameter by its name.
Prepare | Prepares SQL command for execution.
ReleaseConnection | Releases reference to the actual connection object.
Unprepare | Releases SQL command resources.
Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Identifies base object name for some of command kinds.
BindedBy | Determines how command is connected to connection object.
CatalogName | Identifies catalog name for some command kinds.
CommandIntf | Returns IADPhysCommand interface.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
DataSet | Reference to dataset object owning this command.
FetchOptions | The set of options to control rows fetching.
FixedCommandKind | True, if the CommandKind property value is set explicitly.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
Overload | Oracle stored procedure overload index.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | The collection of parameters for a SQL command.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Identifies schema name for some of command kinds.
SQLText | The SQL command text as it will be sent to the DBMS.
State | Returns the current state of the command object.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.
Values | Provides access to the values for all parameters for the command.
Links
Events, TADCustomCommand Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
Events TADCustomCommand Class Legend Methods Properties Send Feedback

The public members of the TADCustomCommand class are listed here.

Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterFetch | The event fires after fetching from command cursor.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeFetch | The event fires before fetching from command cursor.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.
Class

TADCustomCommand Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current command operation.
AcquireConnection | Acquires reference to the actual connection object.
Close | Closes command current cursor.
CloseAll | Closes all command cursors.
Define | Defines DatS manager for command multiple result sets.
Define | Define DatS table structure for command's current cursor.
Disconnect | Use Disconnect method to release DBMS resources, used by this command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Fetch | Fetches rows from current command cursor.
FillParams | Fills the Params collection.
FindMacro | Returns macro by its name.
FindParam | Returns parameter by its name.
GetConnection | Returns the connection object.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Open | Executes SQL command, returning cursor.
OpenOrExecute | Execute SQL command, optionally returning cursor.
ParamByName | Returns parameter by its name.
Prepare | Prepares SQL command for execution.
ReleaseConnection | Releases reference to the actual connection object.
Unprepare | Releases SQL command resources.
Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Identifies base object name for some of command kinds.
BindedBy | Determines how command is connected to connection object.
CatalogName | Identifies catalog name for some command kinds.
CommandIntf | Returns IADPhysCommand interface.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
DataSet | Reference to dataset object owning this command.
FetchOptions | The set of options to control rows fetching.
FixedCommandKind | True, if the CommandKind property value is set explicitly.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
Overload | Oracle stored procedure overload index.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | The collection of parameters for a SQL command.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Identifies schema name for some of command kinds.
SQLText | The SQL command text as it will be sent to the DBMS.
State | Returns the current state of the command object.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.
Values | Provides access to the values for all parameters for the command.
Links
Events, TADCustomCommand Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomCommand.Active Property

TADCustomCommand.Active Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Gets or sets command active status.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Description

Set Active to True to execute SQL command and return cursor. After that the State = csOpen and you can fetch rows from current cursor using Fetch method. Setting Active to True, will call Open method.

Set Active to False to close current command cursor. After that State = csPrepared. Setting Active to False, will call Closemethod. To close all command cursors (if command returns multiple result sets), use CloseAll method.

Syntax
property Active: Boolean;
See Also

Fetch, Define, Open, Close, CloseAll, State

Example
ADCommand1.CommandText.Text := 'select * from "Orders"';
ADCommand1.Active := True;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ....
finally
  oTab.Free;
end;
What do you think about this topic? Send feedback!


TADCustomCommand.ActiveStoredUsage Property

TADCustomCommand.ActiveStoredUsage Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Controls how to use Active property value saved to DFM.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
See Also

Active

What do you think about this topic? Send feedback!


TADCustomCommand.AfterClose Event

TADCustomCommand.AfterClose Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires after command is closed.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The AfterClose event fires, after command is closed by calling Close or setting Active = False.

Syntax
property AfterClose: TNotifyEvent;
See Also

BeforeClose, Close, Active

What do you think about this topic? Send feedback!


TADCustomCommand.AfterExecute Event

TADCustomCommand.AfterExecute Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

The event fires after command is executed.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Description

The AfterExecute event fires, after command is executed by calling Execute method.

Syntax
property AfterExecute: TNotifyEvent;
See Also

BeforeExecute, Execute

Example
procedure TForm1.ADCommand1AfterExecute(ASender: TObject);
begin
  if ADCommand1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADCommand1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADCommand1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADCommand1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADCommand1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADCommand1.RowsAffected]);
    end;
end;
What do you think about this topic? Send feedback!


TADCustomCommand.AfterFetch Event

TADCustomCommand.AfterFetch Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

The event fires after fetching from command cursor.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Description

The AfterFetch event fires, after rows are fetched from command cursor by calling Fetch method.

Syntax
property AfterFetch: TNotifyEvent;
See Also

BeforeFetch, Fetch

Example
procedure TForm1.ADCommand1AfterFetch(ASender: TObject);
begin
  StatusBar1.SimpleText := Format('%d rows fetched', [ADCommand1.RowsAffected]);
end;
What do you think about this topic? Send feedback!


TADCustomCommand.AfterOpen Event

TADCustomCommand.AfterOpen Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires after command is opened.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The AfterOpen event fires, after command is opened by calling Open or setting Active = True.

Syntax
property AfterOpen: TNotifyEvent;
See Also

BeforeOpen, Open, Active

What do you think about this topic? Send feedback!


TADCustomCommand.AfterPrepare Event

TADCustomCommand.AfterPrepare Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires after command is prepared.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The AfterPrepare event fires, after command is prepared by calling Prepare method.

Syntax
property AfterPrepare: TNotifyEvent;
See Also

BeforePrepare, Prepare

What do you think about this topic? Send feedback!


TADCustomCommand.AfterUnprepare Event

TADCustomCommand.AfterUnprepare Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires after command is unprepared.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The AfterUnprepare event fires, after command is unprepared by calling Unprepare method.

Syntax
property AfterUnprepare: TNotifyEvent;
See Also

BeforeUnprepare, Unprepare

What do you think about this topic? Send feedback!


TADCustomCommand.BaseObjectName Property

TADCustomCommand.BaseObjectName Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Identifies base object name for some of command kinds.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Description

The BaseObjectName identifies the name of the base object. The meaning depends on CommandKind and MetaInfoKind:

  • If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then BaseObjectName specifies the name of the package, if procedure is packaged procedure.
  • If MetaInfoKind in [mkIndexFields, mkPrimaryKeyFields, mkForeignKeyFields], then BaseObjectName specifies the name of the table.
  • If MetaInfoKind in [mkProcs, mkProcArgs], then BaseObjectName specifies the name of the package.
Syntax
property BaseObjectName: String;
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind

Example
ADCommand1.BaseObjectName := 'MY_PACK';
ADCommand1.CommandText.Text := 'PROC1';
// or just ADCommand1.CommandText.Text := 'MY_PACK.PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Codegear Delphi';
ADCommand1.Execute;
What do you think about this topic? Send feedback!


TADCustomCommand.BeforeClose Event

TADCustomCommand.BeforeClose Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires before command will be closed.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The BeforeClose event fires, before command will be closed by calling Close or setting Active = False.

Syntax
property BeforeClose: TNotifyEvent;
See Also

AfterClose, Close, Active

What do you think about this topic? Send feedback!


TADCustomCommand.BeforeExecute Event

TADCustomCommand.BeforeExecute Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires before command will be executed.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The BeforeExecute event fires, before command will be executed by calling Execute method.

Syntax
property BeforeExecute: TNotifyEvent;
See Also

AfterExecute, Execute

What do you think about this topic? Send feedback!


TADCustomCommand.BeforeFetch Event

TADCustomCommand.BeforeFetch Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires before fetching from command cursor.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The BeforeFetch event fires, before rows will be fetched from command cursor by calling Fetch method.

Syntax
property BeforeFetch: TNotifyEvent;
See Also

AfterFetch, Fetch

What do you think about this topic? Send feedback!


TADCustomCommand.BeforeOpen Event

TADCustomCommand.BeforeOpen Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires before command will be opened.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The BeforeOpen event fires, before command will be opened by calling Open or setting Active = True.

Syntax
property BeforeOpen: TNotifyEvent;
See Also

AfterOpen, Open, Active

What do you think about this topic? Send feedback!


TADCustomCommand.BeforePrepare Event

TADCustomCommand.BeforePrepare Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires before command will be prepared.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The BeforePrepare event fires, before command will be prepared by calling Prepare method.

Syntax
property BeforePrepare: TNotifyEvent;
See Also

AfterPrepare, Prepare

What do you think about this topic? Send feedback!


TADCustomCommand.BeforeUnprepare Event

TADCustomCommand.BeforeUnprepare Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The event fires before command will be unprepared.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The BeforeUnprepare event fires, before command wille be unprepared by calling Unprepare method.

Syntax
property BeforeUnprepare: TNotifyEvent;
See Also

BeforePrepare, Unprepare

What do you think about this topic? Send feedback!


TADCustomCommand.BindedBy Property

TADCustomCommand.BindedBy Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Determines how command is connected to connection object.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The BindedBy property returns value, determining how command is connected to the connection object:

  • bbObject if Connection property is not nil;
  • bbName is ConnectionName property is not empty.
Syntax
property BindedBy: TADBindedBy;
See Also

Connection, ConnectionName

What do you think about this topic? Send feedback!


TADCustomCommand.CatalogName Property

TADCustomCommand.CatalogName Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Identifies catalog name for some command kinds.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

The CatalogName identifies the name of the catalog where resides command object. The meaning depends on CommandKind and MetainfoKind:

  • If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then CatalogName specifies the name of the catalog, where resides the procedure.
  • If MetainfoKind is not mkNone, then CatalogName specifies the name of the catalog, where resides the describing object.
Syntax
property CatalogName: String;
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName

Example 1
ADCommand1.CatalogName := 'MY_APP';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;
Example 2
ADMetaInfoCommand1.CatalogName := 'MY_APP';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on SQL Server just ADMetaInfoCommand1.ObjectName := 'MY_APP..MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;
What do you think about this topic? Send feedback!


TADCustomCommand.CommandIntf Property

TADCustomCommand.CommandIntf Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Returns IADPhysCommand interface.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The CommandIntf property returns the reference to the IADPhysCommand interface. It is not nil, if the command is prepared. Otherwise it is nil. It is not recommended to mix usage of TADCommand API and TADCommand.CommandIntf API.

Syntax
property CommandIntf: IADPhysCommand;
See Also

IADPhysCommand

What do you think about this topic? Send feedback!


TADCustomCommand.CommandKind Property

TADCustomCommand.CommandKind Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Identifies the command kind.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

The CommandKind property identifies the kind of the content of CommandText property. You can explicitly set it value before Prepare call, otherwise it will be automatically assigned by FireDAC after analyzing CommandText content. There is only single need to assign it - when you are preparing stored procedure.

Syntax
property CommandKind: TADPhysCommandKind;
See Also

CommandText

Example 1
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'MY_PROC';
ADCommand1.Prepare;
Example 2
ADCommand1.CommandText.Text := 'ALTER PROCEDURE MY_PROC COMPILE';
case ADCommand1.CommandKind of
skAlter: ShowMessage('Alter command');
..........
else     ShowMessage('Other command');
end;
What do you think about this topic? Send feedback!


TADCustomCommand.CommandText Property

TADCustomCommand.CommandText Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example 1 Example 2 Example 3 public See Also Send Feedback

The SQL command text to execute.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example 1, Example 2, Example 3, public, See Also
Description

The CommandText set/get:

  • SQL command text to execute
  • or name of the stored procedure to execute, if CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs].

After setting CommandText, FireDAC will do for non-stored procedures:

  • extract parameters names and fill Params collection, if ResourceOptions.ParamCreate = True;
  • extract macro name and fill Macros collection, if ResourceOptions.MacroCreate = True;
  • extract FROM table name for SELECT commands and assign it to CommandIntf.SourceObjectName, if ResourceOptions.PreprocessCmdText = True;
  • fill CommandKind property value, if it is not explicitly set.

If you are adding long command, using CommandText.Add method, then it is recommended before command modification to call CommandText.BeginUpdate and after finishing command modification to call CommandText.EndUpdate.

Later on Prepare call command text will be preprocessed and transformed in target DBMS command. See chapter Preprocessing Command Text for details about FireDAC macros and escape sequences - preprocessor instructions.

Syntax
property CommandText: TStrings;
See Also

Preprocessing Command Text, Executing Command, TADResourceOptions.ParamCreate, TADResourceOptions.MacroCreate,TADResourceOptions.PreprocessCmdText, CommandKind, Params, Macros, ResourceOptions

Example 1

Stored procedure:

ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'MY_PROC';
ADCommand1.Prepare;
ADCommand1.Params[0].AsString := 'qwe';
ADCommand1.Execute;
Example 2

General SQL command:

ADCommand1.CommandText.Text := 'insert into MyTab values (:p1)';
ADCommand1.Params[0].AsString := 'qwe';
ADCommand1.Execute;
Example 3

Adding long command:

with ADCommand1.CommandText do begin
  BeginUpdate;
  Add('............');
  ......
  Add('............');
  EndUpdate;
end;
What do you think about this topic? Send feedback!


TADCustomCommand.Connection Property

TADCustomCommand.Connection Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Specifies the connection object.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The Connection property value points to the connection object. Alternatively may be specified the ConnectionName property value. The Connection property value must be specified before Prepare call.

Syntax
property Connection: TADCustomConnection;
See Also

ConnectionName, Prepare

What do you think about this topic? Send feedback!


TADCustomCommand.ConnectionName Property

TADCustomCommand.ConnectionName Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Specifies connection name.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The ConnectionName property value specifies the name of the connection. It must match to the:

  • name of one of connection definitions, either stored in external file or created on fly;
  • ConnectionName of one of the TADConnection objects.

Alternatively may be specified the Connection property value. The ConnectionName property value must be specified before Preparecall. If is specified the name of one of connection definitions, then FireDAC will transparently create connection object and link it with command.

Syntax
property ConnectionName: String;
See Also

Connection, Prepare

What do you think about this topic? Send feedback!


TADCustomCommand.DataSet Property

TADCustomCommand.DataSet Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Reference to dataset object owning this command.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

Use the DataSet property to get a reference to the dataset object, which is owning this command object. For example, TADQuery.Command.DataSet returns the reference to the TADQuery.

Syntax
property DataSet: TADDataSet;
See Also

TADAdaptedDataSet Class

What do you think about this topic? Send feedback!


TADCustomCommand.FetchOptions Property

TADCustomCommand.FetchOptions Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The set of options to control rows fetching.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The FetchOptions property is the set of properties, controlling the fetching of cursor rows. These properties will inherit its values from FetchOptions of connection object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions, Fetch

What do you think about this topic? Send feedback!


TADCustomCommand.FixedCommandKind Property

TADCustomCommand.FixedCommandKind Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

True, if the CommandKind property value is set explicitly.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Syntax
property FixedCommandKind: Boolean;
See Also

CommandKind

What do you think about this topic? Send feedback!


TADCustomCommand.FormatOptions Property

TADCustomCommand.FormatOptions Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The set of options to control data representation.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Fetch, Params

What do you think about this topic? Send feedback!


TADCustomCommand.Macros Property

TADCustomCommand.Macros Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example 1 Example 2 Example 3 public See Also Send Feedback

The collection of macro substitution variables.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example 1, Example 2, Example 3, public, See Also
Description

The Macros property is the collection of macro substitution variables. It is populated automatically after assigning CommandText, if ResourceOptions.MacroCreate = True. Otherwise it may be populated by hands. At Prepare call, macro values will be substituted into CommandText, if ResourceOptions.MacroExpand = True.

Syntax
property Macros: TADMacros;
See Also

Executing Command, Preprocessing Command Text, CommandText, Params, Prepare, TADMacros, TADResourceOptions.MacroCreate, TADResourceOptions.MacroExpand

Example 1

Substitute table name:

ADCommand1.CommandText.Text := 'select * from &Tab';
ADCommand1.Macros[0].AsIdentifier := 'Order Details';
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from "Order Details"
Example 2

Substitute WHERE condition:

ADCommand1.CommandText.Text := 'select * from MyTab {if !cond} where !cond {fi}';
ADCommand1.Macros[0].AsString := 'ID > 100';
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from MyTab where ID > 100
ADCommand1.Macros[0].Clear;
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from MyTab
Example 3

See FireDAC\Samples\Comp Layer\TADQuery\Macros demo for details.

What do you think about this topic? Send feedback!


TADCustomCommand.OnCommandChanged Event

TADCustomCommand.OnCommandChanged Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

The event fires after CommandText is changed.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Description

The OnCommandChanged event fires, after CommandText is changed.

Syntax
property OnCommandChanged: TNotifyEvent;
See Also

CommandText

Example
procedure TForm1.ADCommand1CommandChanged(ASender: TObject);
begin
  if ADCommand1.FindParam('ID') <> nil then
    ADCommand1.FindParams('ID').AsInteger := 100;
end;
What do you think about this topic? Send feedback!


TADCustomCommand.OnError Event

TADCustomCommand.OnError Event
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

The event fires when an error happens, while command is communicating with DBMS.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
ASender | The reference to command.
AInitiator | The reference to interface of object, which initially raised the exception.
AException | The exception object, which may be modified or even replaced by another exception object instance.
Description

The OnError event fires, when command executes one of the following operations and an error happens:

  • Prepare. The command is preparing DBMS command text for execution.
  • Open. The command is executing DBMS command to open cursor.
  • Execute. The command is executing DBMS command text.
  • Fetch. The command is fetching rows from cursor.

If most cases AException object will of EADDBEngineException class. If AException is of EADDBArrayExecuteError class, then it is Array DML error handling case. You should use code like in the example.

Syntax
property OnError: TADErrorEvent;
See Also

Handling Errors, Array DML, Open, Execute, Prepare, Fetch, EADDBArrayExecuteError class, EADDBEngineException class

Example 1

Handling Array DML errors:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;
Example 2

Error substitution:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;
What do you think about this topic? Send feedback!


TADCustomCommand.Overload Property

TADCustomCommand.Overload Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Oracle stored procedure overload index.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Description

The Overload property specifies Oracle packaged stored procedure overload index. It has no meaning for other DBMS's.

Syntax
property Overload: Word;
See Also

CommandText, CommandKind

Example
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'DBMS_SQL.PARSE';
ADCommand1.Overload := 1;
What do you think about this topic? Send feedback!


TADCustomCommand.ParamBindMode Property

TADCustomCommand.ParamBindMode Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

Get or set ParamBindMode to determine the order in which parameters in the Params property are matched to the parameters used by the SQL command on the server. ParamBindMode can be one of the following:

Value | Ordering
pbByName | Parameters specified in the Params property are matched to identically named parameters on the server. This is the default.
pbByNumber | Parameters in Params are assigned one-by-one to the next available parameter on the server (for example, the first parameter in Params is assigned to the first parameter used by the SQL command, and so on).

Whenever possible, ParamBindMode should be pbByName. This guarantees that parameters are matched to the correct parameters used by the SQL command regardless of physical ordering in Params. At design time, the names of known parameters appear in the Parameters editor.

Syntax
property ParamBindMode: TADParamBindMode;
See Also

Params

What do you think about this topic? Send feedback!


TADCustomCommand.Params Property

TADCustomCommand.Params Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The collection of parameters for a SQL command.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The Params property is the collection of parameters for a SQL command.

If CommandKind is not in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then Params is populated automatically after assigning CommandText, if ResourceOptions.ParamCreate = True.

If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then Params is populated automatically after calling Prepare method, if fiMeta is in FetchOption.Items.

Otherwise Params may be populated by hands. At Prepare call, parameters will be binded to prepared SQL command. After that you cannot change parameter types, otherwise will get an exception.

Syntax
property Params: TADParams;
See Also

Executing Command, CommandText, Macros, Prepare, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items

What do you think about this topic? Send feedback!


TADCustomCommand.Prepared Property

TADCustomCommand.Prepared Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Gets or sets command prepare for execution status.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

Set Prepared to True to prepare SQL command for execution. After that the State = csPrepared. Setting Prepared to True, will call Prepare method. It is not required to set Prepared to True for standard SQL command before execution, because first Execute / Open call will automatically prepare command. But it is required for stored procedures, if you need to automatically populate Params collection. After command is prepared, SQLText will return SQL command text as it is sent to the DBMS.

To prepare SQL command DBMS connection must be active, otherwise an exception will be raised.

After SQL command preparation application cannot change command parameter data types and sizes, otherwise on next Execute or Open call an exception will be raised. So, setup parameters before setting Prepared to True.

Set Prepared to False to unprepare SQL command and release all it resources. After that State = csInactive. Setting Prepared to False, will call Unprepare method.

Syntax
property Prepared: Boolean;
See Also

Prepare, Unprepare, State, Params

What do you think about this topic? Send feedback!


TADCustomCommand.ResourceOptions Property

TADCustomCommand.ResourceOptions Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The set of options to control resources usage.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The ResourceOptions property is the set of properties, controlling the resources usage by the command. These properties will inherit its values from ResourceOptions of connection object.

Syntax
property ResourceOptions: TADBottomResourceOptions;
See Also

Setting Options, TADBottomResourceOptions

What do you think about this topic? Send feedback!


TADCustomCommand.RowsAffected Property

TADCustomCommand.RowsAffected Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Returns the number of rows operated upon by the latest query execution.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Description

Inspect RowsAffected to determine how many rows were inserted, updated, deleted or fetched by the last command operation. If no rows were processed, RowsAffected = 0. If numbers of processed rows is not accessible, RowsAffected = –1.

At MS SQL Server RowsAffected may be unexpectedly equal to -1, if stored procedure or table trigger omits SET NOCOUNT ON. Check BOL for more details.

Syntax
property RowsAffected: TADCounter;
See Also

Execute, Fetch

Example
procedure TForm1.ADCommand1AfterExecute(ASender: TObject);
begin
  if ADCommand1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADCommand1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADCommand1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADCommand1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADCommand1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADCommand1.RowsAffected]);
    end;
end;
What do you think about this topic? Send feedback!


TADCustomCommand.SchemaName Property

TADCustomCommand.SchemaName Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Identifies schema name for some of command kinds.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

The SchemaName identifies the name of the schema where resides command object. The meaning depends on CommandKind and MetainfoKind:

  • If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then SchemaName specifies the name of the schema, where resides the procedure.
  • If MetainfoKind is not mkNone, then SchemaName specifies the name of the schema, where resides the describing object.
Syntax
property SchemaName: String;
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName

Example 1
ADCommand1.SchemaName := 'SCOTT';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;
Example 2
ADMetaInfoCommand1.SchemaName := 'ADDEMO';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on Oracle just ADMetaInfoCommand1.ObjectName := 'ADDEMO.MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;
What do you think about this topic? Send feedback!


TADCustomCommand.SQLText Property

TADCustomCommand.SQLText Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The SQL command text as it will be sent to the DBMS.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The SQLText property returns SQL command text as it will be sent to the DBMS. It is accessible only after command is prepared. This text will not have any of command preprocess instructions (macros, escapes, etc), will have adjusted parameter markers and end-of-line markers.

Syntax
property SQLText: String;
See Also

CommandText, Prepare

What do you think about this topic? Send feedback!


TADCustomCommand.State Property

TADCustomCommand.State Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Returns the current state of the command object.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The property State returns the current state of the command object. It has one of the following values:

Value | Description
csInactive | The command is not prepared for execution.
csPrepared | The command is prepared for execution.
csExecuting | The command is executing.
csOpen | The command is executed and it has active cursor.
csFetching | The command is fetching rows.
csAborting | The command is aborting current operation.

csExecuting, csFetching, csAborting values are "visible" if command is executing asynchronously or State property is checked from other thread than performing operation.

Syntax
property State: TADPhysCommandState;
See Also

Prepare, Execute, Open, AbortJob, Fetch, Close, Unprepare

What do you think about this topic? Send feedback!


TADCustomCommand.Transaction Property

TADCustomCommand.Transaction Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Specifies a transaction object.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The Transaction property value points to a transaction object. The SQL command will be prepared and executed in the context of this transaction. The Transaction property value must be specified before Prepare call. If a value is not specified, then command will use default transaction object, specified at TADCustomConnection.Transaction or internal connection transaction object.

Note, at moment only Interbase / Firebird driver supports assignment of transaction to the command.

Syntax
property Transaction: TADCustomTransaction;
See Also

Managing Transactions, TADTransaction, TADCustomConnection.Transaction

What do you think about this topic? Send feedback!


TADCustomCommand.UpdateOptions Property

TADCustomCommand.UpdateOptions Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

The set of options to control updates posting.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The UpdateOptions property is the set of properties, controlling the posting of updates. These properties will inherit its values from UpdateOptions of a connection object.

Syntax
property UpdateOptions: TADBottomUpdateOptions;
See Also

Setting Options, TADBottomUpdateOptions

What do you think about this topic? Send feedback!


TADCustomCommand.Values Property

TADCustomCommand.Values Property
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Provides access to the values for all parameters for the command.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

The property Values gets / sets values for parameters in a command. AParamNames is the single parameter name or ';' separated list of the parameter names to read from or write to.

Values accepts and returns a Variant, so it can handle and convert parameters of any data type. Because Values is the default property for TADCommand, the property name may be omitted when referencing this property.

Syntax
property Values [const AParamNames: String]: Variant;
See Also

Params, ParamByName, FindParam, TADParam.Value

Example 1

The following statements are semantically identical and write the value from an edit box into an integer parameter:

ADCommand1.Values['CustNo'] := Edit1.Text;
ADCommand1['CustNo'] := Edit1.Text;
Example 2

The next statement reads a string value from a parameter into an edit box:

Edit1.Text := ADCommand1['Company'];
What do you think about this topic? Send feedback!


TADCustomCommand.AbortJob Method

TADCustomCommand.AbortJob Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Use the AbortJob method to abort current command operation.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
AWait: Boolean = False | If True, then caller will wait until a current operation will be terminated.
Description

The AbortJob method aborts one of the following command operations:

  • Open. The command is executing DBMS command to open cursor.
  • Execute. The command is executing DBMS command.
  • Fetch. The command is fetching rows from cursor.

After AbortJob call command state will be csPrepared for Open/Execute calls. And csActive for Fetch. The AbortJob method must be called from the other thread, than where a operation is performing.

Note, not all DBMS API's support abortion of command execution. In this case the AbortJob method will wait until the execution will be finished.

Syntax
procedure AbortJob(AWait: Boolean = False);
See Also

Asynchronous Execution

Example
ADCommand1.ResourceOptions.CmdExecMode := amAsync;
ADCommand1.Prepare('select OrderID, count(*) from "Order Details" group by OrderID');
ADCommand1.Open;
ADCommand1.AbortJob(True);
What do you think about this topic? Send feedback!


TADCustomCommand.AcquireConnection Method

TADCustomCommand.AcquireConnection Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Acquires reference to the actual connection object.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Returns

The connection object. Or raises exception, if Connection and ConnectionName property values are empty.

Description

The AcquireConnection method acquires connection object reference, depending on Connection or ConnectionName property values, and increment it usage count. After usage connection object must be released, by calling ReleaseConnection method. Command object automatically acquires connection at Prepare call and releases connection at Unprepare call.

Syntax
function AcquireConnection: TADCustomConnection;
See Also

ReleaseConnection, Connection, ConnectionName

What do you think about this topic? Send feedback!


TADCustomCommand.Close Method

TADCustomCommand.Close Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Closes command current cursor.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Description

The Close method closes current command cursor. After that State = csPrepared.

To close all command cursors (if command returns multiple result sets) use CloseAll method. If there is only single result set, then Close is equivalent to CloseAll. After Close call to forward command to next accessible cursor use NextRecordSet method.

The command object will automatically close all command cursors after fetching of last record from current cursor, if FetchOptions.AutoClose = False.

Syntax
procedure Close;
See Also

Open, Active, CloseAll, NextRecordSet, BeforeClose, AfterClose

Example
var
  oTab: TADDatSTable;
....
  ADCommand1.Prepare('select * from "Orders"');
  oTab := ADCommand1.Define;
  try
    ADCommand1.Fetch(oTab);
  finally
    ADCommand1.Close;
    oTab.Free;
  end;
What do you think about this topic? Send feedback!


TADCustomCommand.CloseAll Method

TADCustomCommand.CloseAll Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Closes all command cursors.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

The CloseAll method closes all command cursors. After that State = csPrepared.

Syntax
procedure CloseAll;
See Also

Open, Active, Close, NextRecordSet, BeforeClose, AfterClose

What do you think about this topic? Send feedback!


TADCustomCommand.Define Method (TADDatSManager, TADDatSTable, TADPhysMetaInfoMergeMode)

TADCustomCommand.Define Method (TADDatSManager, TADDatSTable, TADPhysMetaInfoMergeMode)
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Defines DatS manager for command multiple result sets.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ASchema: TADDatSManager | _nt_
ATable: TADDatSTable = nil | _nt_
AMetaInfoMergeMode: TADPhysMetaInfoMergeMode = mmReset | _nt_
Returns

..

Description

..

Syntax
function Define(ASchema: TADDatSManager; ATable: TADDatSTable = nil; AMetaInfoMergeMode: TADPhysMetaInfoMergeMode = mmReset): TADDatSTable; overload;
See Also

..

Example

..

What do you think about this topic? Send feedback!


TADCustomCommand.Define Method (TADDatSTable, TADPhysMetaInfoMergeMode)

TADCustomCommand.Define Method (TADDatSTable, TADPhysMetaInfoMergeMode)
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Define DatS table structure for command's current cursor.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ATable: TADDatSTable = nil | A reference to the existing DatS table or nil.
AMetaInfoMergeMode: TADPhysMetaInfoMergeMode = mmReset | Defines how to adjust ATable DatS table structure using current result set structure.
Returns

The reference to the existing DatS table.

If ATable was nil, then returned value is new created DatS table. The calling code is responsible for freeing it after usage.

Description

The Define method defines DatS table structure for command's current cursor if command is open or for first cursor if it is closed. Method creates new DatS table, if ATable parameter value is nil. If the SQL command is SELECT and fiMeta in FetchOptions.Items, then Define will request DBMS for primary key fields for table in FROM clause. And method will fill DatS table column list.

Syntax
function Define(ATable: TADDatSTable = nil; AMetaInfoMergeMode: TADPhysMetaInfoMergeMode = mmReset): TADDatSTable; overload;
See Also

TADDatSTable, TADDatSTable.Columns

Example
var
  oTab: TADDatSTable;
....
  ADCommand1.Prepare('select * from MyTab');
  oTab := ADCommand1.Define;
  ADCommand1.Open;
  ADCommand1.Fetch(oTab);
  ADCommand1.Close;

  // Some time later, after the structure of DB table MyTab have changed.
  // For example, field was removed.

  ADCommand1.Prepare('select * from MyTab');
  oTab := ADCommand1.Define(oTab, mmOverride);
  ADCommand1.Open;
  ADCommand1.Fetch(oTab);
  ADCommand1.Close;
What do you think about this topic? Send feedback!


TADCustomCommand.Disconnect Method

TADCustomCommand.Disconnect Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public Send Feedback

Use Disconnect method to release DBMS resources, used by this command.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public
Parameters
Parameters | Description
AAbortJob: Boolean = False | If True, then method will abort current operation.
Description

The Disconnect method optionally abort current operation and releases DBMS resources, used by this command. After the call command is in csInactive state.

Syntax
procedure Disconnect(AAbortJob: Boolean = False);
Example
ADCommand1.CommandText.Text := 'select * from [Order Details]';
ADCommand1.Prepare := True;
ADCommand1.Active := True;
ADCommand1.Disconnect;
// Active = False and Prepare = False
What do you think about this topic? Send feedback!


TADCustomCommand.Execute Method (Integer, Integer, Boolean)

TADCustomCommand.Execute Method (Integer, Integer, Boolean)
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Executes SQL command.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ATimes: Integer = 0 | A number of times to execute SQL command.
AOffset: Integer = 0 | A index of first row in parameters array, to start execution.
Description

The Execute method executes SQL command specified by the CommandText, which does not return result sets. If command will return result sets, then all they will be discarded. The command may be executed in one of the modes:

Mode | Parameter values | RowsAffected meaning
Standard or default. The SQL command will be executed single time. | ATimes <= 1 | The number of rows affected by SQL command (inserted, updated, deleted, etc). This information is provided by DBMS and is not "reviewed" by FireDAC.
Array DML. | ATimes > 1 | The number of successfull command executions for each of parameter array items. For detailed description see chapter Array DML.
Syntax
procedure Execute(ATimes: Integer = 0; AOffset: Integer = 0; ABlocked: Boolean = False); overload;
See Also

Executing Command, RowsAffected, CommandText, Params

Example
ADCommand1.CommandText.Text := 'create table MyTab (f1 number, f2 varchar2(10))';
ADCommand1.Execute;
What do you think about this topic? Send feedback!


TADCustomCommand.Execute Method (String)

TADCustomCommand.Execute Method (String)
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Executes SQL command.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | The SQL command text to execute.
Description

The Execute method executes SQL command specified by the ASQL parameter, which does not return result sets. If command will return result sets, then all they will be discarded.

Syntax
function Execute(const ASQL: String): LongInt; overload;
See Also

Executing Command, RowsAffected, CommandText, Params

Example
ADCommand1.Execute('DROP TABLE MyTab');
What do you think about this topic? Send feedback!


TADCustomCommand.Execute Method (String, array of Variant)

TADCustomCommand.Execute Method (String, array of Variant)
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Executes SQL command.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | The SQL command text to execute.
const AParams: array of Variant | The open array of parameter values. The values will be assigned in order of accurencies in the SQL command text.
Description

The Execute method executes parameterized SQL command specified by the ASQL parameter, which does not return result sets. If command will return result sets, then all they will be discarded.

Syntax
function Execute(const ASQL: String; const AParams: array of Variant): LongInt; overload;
See Also

Executing Command, RowsAffected, CommandText, Params

Example
ADCommand1.Execute('delete from MyTab where id = : id', [100]);
What do you think about this topic? Send feedback!


TADCustomCommand.Execute Method (String, array of Variant, array of TFieldType)

TADCustomCommand.Execute Method (String, array of Variant, array of TFieldType)
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Executes SQL command.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | The SQL command text to execute.
const AParams: array of Variant | The open array of parameter values. The values will be assigned in order of occurrences in the SQL command text.
const ATypes: array of TFieldType | The open array of parameter data types.
Description

The Execute method executes parameterized SQL command specified by the ASQL parameter, which does not return result sets. If command will return result sets, then all they will be discarded. The method requires to specify parameter data types.

Syntax
function Execute(const ASQL: String; const AParams: array of Variant; const ATypes: array of TFieldType): LongInt; overload;
See Also

Executing Command, RowsAffected, CommandText, Params

Example
ADCommand1.Execute('insert into MyTab (id, bval) values (:id, :bval)', [100, StringOfChar('x', 100000)], [ftInteger, ftBLOB]);
What do you think about this topic? Send feedback!


TADCustomCommand.Fetch Method

TADCustomCommand.Fetch Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Fetches rows from current command cursor.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ATable: TADDatSTable | DatS table into which store fetched rows.
AAll: Boolean = True | If True, then at first Fetch call FireDAC will fetch all rows from the current cursor.
Description

The Fetch method fetches rows from current command cursor into DatS table. To call Fetch, command must be opened (in csActive state) by Open call, otherwise it will raise exception.

At each call will be fetched up to FetchOptions.RowsetSize rows. If FetchOptions.AutoClose =True, then after fetching of last row FireDAC will automatically call CloseAll method.

If fiBlobs in FetchOptions.Items, then BLOB field values will be fetched together with other field values. If fiDetails in FetchOptions.Items, then nested dataset will be fetched together with other field values. While fetching, field values will be converted according FormatOptions and stored into DatS rows.

Syntax
procedure Fetch(ATable: TADDatSTable; AAll: Boolean = True; ABlocked: Boolean = False); overload;
See Also

TADFetchOptions, Close, CloseAll, Open, Active

Example
var
  oTab: TADDatSTable;
...
  ADCommand1.CommandKind := skStoredProc;
  ADCommand1.CommandText.Text := 'SEL_CUST_PROC';
  oTab := ADCommand1.Define;
  try
    ADCommand1.Open;
    repeat
      oTab.Clear;
      ADCommand1.Fetch(oTab, False);
      // process next rowset
    until ADCommand1.RowsAffected = 0;
  finally
    oTab.Free;
  end;
What do you think about this topic? Send feedback!


TADCustomCommand.FillParams Method

TADCustomCommand.FillParams Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Fills the Params collection.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
AParams: TADParams | The parameters collection to fill in.
const ASQL: String = '' | The SQL command from which to get parameters. If it is empty string, then will be used CommandText.
Description

The FillParams method fills the Params collection, if it is not done automatically in one of the following cases:

  • CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs] and fiMeta is not in FetchOptions.Items;
  • CommandKind is not in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs] and ResourceOptions.ParamCreate = False.
Syntax
procedure FillParams(AParams: TADParams; const ASQL: String = '');
See Also

CommandText, CommandKind, Params, TADFetchOptions.Items, TADResourceOptions.ParamCreate

What do you think about this topic? Send feedback!


TADCustomCommand.FindMacro Method

TADCustomCommand.FindMacro Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Returns macro by its name.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const AValue: string | Name of a macro.
Returns

The macro with Name = AValue or nil if such macro does not exists.

Description

The FindMacro method returns a macro from Macros collection by its name AValue. If there is no such macro, then method will return nil.

Syntax
function FindMacro(const AValue: string): TADMacro;
See Also

Macros, MacroByName

What do you think about this topic? Send feedback!


TADCustomCommand.FindParam Method

TADCustomCommand.FindParam Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Returns parameter by its name.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const AValue: string | Name of a parameter.
Returns

The parameter with Name = AValue or nil if such parameter does not exists.

Description

The FindParam method returns a parameter from Params collection by its name AValue. If there is no such parameter, then method will return nil.

Syntax
function FindParam(const AValue: string): TADParam;
See Also

Params, ParamByName, Values

What do you think about this topic? Send feedback!


TADCustomCommand.GetConnection Method

TADCustomCommand.GetConnection Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Returns the connection object.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
ACheck: Boolean | If True, and connection object is not found then method will raise the exception.
Description

Returns the connection object using either Connection or ConnectionName properties.

Syntax
function GetConnection(ACheck: Boolean): TADCustomConnection;
See Also

Connection, ConnectionName, AcquireConnection, ReleaseConnection

What do you think about this topic? Send feedback!


TADCustomCommand.MacroByName Method

TADCustomCommand.MacroByName Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Returns macro by its name.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const AValue: string | Name of a macro.
Returns

The macro with Name = AValue.

Description

The MacroByName method returns a macro from Macros collection by its name AValue. If there is no such macro, then exception will be raised.

Syntax
function MacroByName(const AValue: string): TADMacro;
See Also

Macros, FindMacro

What do you think about this topic? Send feedback!


TADCustomCommand.NextRecordSet Method

TADCustomCommand.NextRecordSet Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Go to the next cursor, returned by the SQL command.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Description

The NextRecordSet method closes current cursor, forwards it to the next accessible cursor and opens command. If there is no more accessible cursors, then after call command is closed (State = csPrepared).

The Close method closes current cursor. The CloseAll method discards all assocciated cursors. So, to get all cursors, you should set FetchOptions.AutoClose to False before opening command.

Oracle REF CURSOR's for FireDAC are also command cursors, and NextRecordSet call will select next PL/SQL REF CURSOR parameter.

In design time, you can forward dataset to the next cursor, by right clicking component and choosing "Next record set" popup menu item.

Syntax
procedure NextRecordSet;
See Also

TADFetchOptions.AutoClose, Open, Close, CloseAll, Fetch

Example
ADCommand1.FetchOptions.AutoClose := False;
ADCommand1.CommandText.Text := 'select 1 as i; select ''qwe'' as s';
ADCommand1.Open;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ShowMessage(oTab.Rows[0].DumpRow(True)); // output "i: 1"
finally
  oTab.Free;
end;
ADCommand1.NextRecordSet;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ShowMessage(oTab.Rows[0].DumpRow(True)); // output "s: qwe"
finally
  oTab.Free;
end;
ADQuery1.CloseAll;
What do you think about this topic? Send feedback!


TADCustomCommand.Open Method

TADCustomCommand.Open Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Executes SQL command, returning cursor.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

Call the Open method to execute SQL command and return cursor. After that the State = csOpen and you can fetch rows from current cursor using Fetch method. The Open method will raise an exception, if command does not return cursors.

Syntax
procedure Open(ABlocked: Boolean = False);
See Also

Active, Close, CloseAll, State

What do you think about this topic? Send feedback!


TADCustomCommand.OpenOrExecute Method

TADCustomCommand.OpenOrExecute Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Execute SQL command, optionally returning cursor.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Returns

True, if command returned cursor.

Description

Call the OpenOrExecute method to execute SQL command, optionally returning cursor. If the SQL command returns cursor, then after call the State=csActive and you can fetch rows from current cursor using Fetch method. If the SQL command does not return cursors, then the State=csPrepared.

The OpenOrExecute method is useful, when you does not know a command kind to be executed.

Syntax
function OpenOrExecute(ABlocked: Boolean = False): Boolean;
See Also

Execute, Open, Active, Close, CloseAll

Example
if ADCommand1.OpenOrExecute then begin
  oTab := ADCommand1.Define;
  try
    ADCommand1.Fetch(oTab);
  finally
    ADCommand1.CloseAll;
    oTab.Free;
  end;
end;
What do you think about this topic? Send feedback!


TADCustomCommand.ParamByName Method

TADCustomCommand.ParamByName Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Returns parameter by its name.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const AValue: string | Name of a parameter.
Returns

The parameter with Name = AValue.

Description

The ParamByName method returns a parameter from Params collection by its name AValue. If there is no such parameter, then exception will be raised.

Syntax
function ParamByName(const AValue: string): TADParam;
See Also

Params, FindParam, Values

What do you think about this topic? Send feedback!


TADCustomCommand.Prepare Method

TADCustomCommand.Prepare Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace Example public See Also Send Feedback

Prepares SQL command for execution.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ACommandText: String = '' | Optional SQL command text to prepare.
Description

Call the Prepare method to prepare SQL command for execution. After that the State = csPrepared. It is not required to call Prepare for standard SQL command before execution, because first Execute / Open call will automatically prepare command. But it is required for stored procedures, if you need to automatically populate Params collection. After command is prepared, SQLTextwill return SQL command text as it is sent to the DBMS.

To prepare SQL command DBMS connection must be active, otherwise exception will be raised.

After prepare call application cannot change command parameter data types and sizes, otherwise on next Execute or Open call an exception will be raised. So, setup parameters before Prepare call.

Syntax
procedure Prepare(const ACommandText: String = '');
See Also

Prepared, Unprepare, State, Params

Example
ADCommand1.Prepare('select * from MyTab');
What do you think about this topic? Send feedback!


TADCustomCommand.ReleaseConnection Method

TADCustomCommand.ReleaseConnection Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Releases reference to the actual connection object.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
var AConnection: TADCustomConnection | The reference to the connection to release. It must be previously acquired by AcquireConnection call.
Description

The ReleaseConnection method releases connection object reference, and decrement it usage count. Command object automatically releases connection at Unprepare call.

Syntax
procedure ReleaseConnection(var AConnection: TADCustomConnection);
See Also

AcquireConnection, Connection, ConnectionName

What do you think about this topic? Send feedback!


TADCustomCommand.Unprepare Method

TADCustomCommand.Unprepare Method
TADCustomCommand Class TADCustomCommand Members uADCompClient Namespace public See Also Send Feedback

Releases SQL command resources.

Group

public

Links
TADCustomCommand Class, TADCustomCommand Members, uADCompClient Namespace, public, See Also
Description

Use Unprepare call to release prepared SQL command resources. After call the State=csInactive. You can unprepare command by setting Prepared to False.

Syntax
procedure Unprepare;
See Also

Prepare, Prepared

What do you think about this topic? Send feedback!


TADCustomConnection Class

TADCustomConnection Class
public TADCustomConnection Members Classes See Also Send Feedback

The class is responsible to connection establishment with a DBMS.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomConnection
File

uADCompClient

Links
public, TADCustomConnection Members, Classes, See Also
Description

Use TADCustomConnection to establish connection to a DBMS and manage associated datasets.

This class hides some of properties, allowing to control visibility of properties by descendant classes. End users should use TADConnection.

Syntax
TADCustomConnection = class(TCustomConnection, IUnknown, IADStanOptions, IADStanErrorHandler, IADStanObject, IADPhysConnectionRecoveryHandler, IADPhysTransactionStateHandler);
See Also

Working with Connections, Managing Transactions, TADConnection, IADPhysConnection

What do you think about this topic? Send feedback!


TADCustomConnection Members

TADCustomConnection Members
Events TADCustomConnection Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomConnection.

Events
Event | Description
AfterCommit | Fires after transaction is committed.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
OnError | Fires before FireDAC will raise exception.
OnLogin | Fires when an application connects to a DBMS.
OnLosted | Fires after FireDAC was not able to restore losted connection to DBMS.
OnRecover | Fires after FireDAC discovered that connection to DBMS is losted.
OnRestored | Fires after FireDAC successfully restored losted connection to DBMS.
Class

TADCustomConnection Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort all running dataset operations on this connection.
ApplyUpdates | Applies change logs of specified datasets to the DBMS.
Assign | Assigns all properties of one connection to this connection.
CheckActive | Checks to see if the connection is active.
CheckConnectionDef | Checks that connection definition is filled correctly.
CheckInactive | Checks to see if the connection is inactive.
CheckOnline | Checks to see if the connection is in online mode.
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
DecodeObjectName | Splits DB object name into parts.
EncodeObjectName | Assembles DB object name from it parts.
ExecSQL | Executes a SQL command without parameters.
ExecSQL | Executes SQL command with parameters.
ExecSQL | Executes a SQL command with parameters.
ExecSQLScalar | Executes a SQL command without parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetInfoReport | Populates a string list with a detailed report about a connection state.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetLastAutoGenValue | Returns last auto generated value.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
Offline | Sets connection to offline mode.
Online | Sets connection to online mode.
Open | Open connection to the database, using specified connection string.
Open | Open connection to the database, using specified user name and password.
Open | Open connection to the database, using specified connection parameters, user name and password.
Ping | Pings the DBMS server.
RefreshMetadataCache | Invalidates meta data cache.
ReleaseClients | Performs resource releasing operation on all associated datasets and commands.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.
Properties
Property | Description
CliHandle | CLI handle for connection sharing.
CliObj | Returns a CLI connection wrapping object.
CommandCount | The number of assocciated TADCustomCommand objects.
Commands | Returns assocciated TADCustomCommand objects.
Connected | Gets / sets connection active status.
ConnectedStoredUsage | Controls how to use Connected property value saved to DFM.
ConnectionDefName | The name of connection definition to use.
ConnectionIntf | Returns the IADPhysConnection interface.
ConnectionMetaDataIntf | Returns an IADPhysConnectionMetadata interface.
ConnectionName | Specifies the name of the connection to associate with this connection object.
DataSets | Returns assocciated TADDataSet objects.
DriverName | Specifies the ID of the FireDAC driver for the connection.
FetchOptions | The set of default options to control rows fetching.
FormatOptions | The set of default options to control data representation.
InTransaction | Indicates whether a connection transaction is in progress or not.
IsSQLBased | Property returns True, if a data source supports SQL language.
LastUsed | The date and time of last usage of the connection.
LoginDialog | Gets / sets the reference to login dialog interface.
LoginPrompt | Specifies whether a login dialog appears immediately before opening a new connection.
Messages | Returns a list of messages returned by DBMS after recent database operation.
Offlined | Gets / sets connection offline status.
OptionsIntf | The reference to IADStanOptions interface.
Params | Lists database connection parameters for the FireDAC connection definition associated with the connection object.
RDBMSKind | Returns the brand of DBMS currently connected.
RefCount | Returns the number of references to this connection object.
ResourceOptions | The set of default options to control resources usage.
ResultConnectionDef | The actual connection definition used to establish connection to a DBMS.
SharedCliHandle | CLI handle shared with other connection.
Temporary | Shows whether a connection object is created on fly (temporary one) and managed automatically or a persistent one explicitly created, managed, and freed by the application.
Transaction | The reference to TADCustomTransaction object.
TxOptions | The set of options to control transactions.
UpdateOptions | The set of default options to control data updating.
UpdateTransaction | The reference to TADCustomTransaction object, which will be used to post changes to DB.
Links
Events, TADCustomConnection Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
Events TADCustomConnection Class Legend Methods Properties Send Feedback

The public members of the TADCustomConnection class are listed here.

Events
Event | Description
AfterCommit | Fires after transaction is committed.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
OnError | Fires before FireDAC will raise exception.
OnLogin | Fires when an application connects to a DBMS.
OnLosted | Fires after FireDAC was not able to restore losted connection to DBMS.
OnRecover | Fires after FireDAC discovered that connection to DBMS is losted.
OnRestored | Fires after FireDAC successfully restored losted connection to DBMS.
Class

TADCustomConnection Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort all running dataset operations on this connection.
ApplyUpdates | Applies change logs of specified datasets to the DBMS.
Assign | Assigns all properties of one connection to this connection.
CheckActive | Checks to see if the connection is active.
CheckConnectionDef | Checks that connection definition is filled correctly.
CheckInactive | Checks to see if the connection is inactive.
CheckOnline | Checks to see if the connection is in online mode.
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
DecodeObjectName | Splits DB object name into parts.
EncodeObjectName | Assembles DB object name from it parts.
ExecSQL | Executes a SQL command without parameters.
ExecSQL | Executes SQL command with parameters.
ExecSQL | Executes a SQL command with parameters.
ExecSQLScalar | Executes a SQL command without parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetInfoReport | Populates a string list with a detailed report about a connection state.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetLastAutoGenValue | Returns last auto generated value.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
Offline | Sets connection to offline mode.
Online | Sets connection to online mode.
Open | Open connection to the database, using specified connection string.
Open | Open connection to the database, using specified user name and password.
Open | Open connection to the database, using specified connection parameters, user name and password.
Ping | Pings the DBMS server.
RefreshMetadataCache | Invalidates meta data cache.
ReleaseClients | Performs resource releasing operation on all associated datasets and commands.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.
Properties
Property | Description
Connected | Gets / sets connection active status.
CliHandle | CLI handle for connection sharing.
CliObj | Returns a CLI connection wrapping object.
CommandCount | The number of assocciated TADCustomCommand objects.
Commands | Returns assocciated TADCustomCommand objects.
ConnectedStoredUsage | Controls how to use Connected property value saved to DFM.
ConnectionDefName | The name of connection definition to use.
ConnectionIntf | Returns the IADPhysConnection interface.
ConnectionMetaDataIntf | Returns an IADPhysConnectionMetadata interface.
ConnectionName | Specifies the name of the connection to associate with this connection object.
DataSets | Returns assocciated TADDataSet objects.
DriverName | Specifies the ID of the FireDAC driver for the connection.
FetchOptions | The set of default options to control rows fetching.
FormatOptions | The set of default options to control data representation.
InTransaction | Indicates whether a connection transaction is in progress or not.
IsSQLBased | Property returns True, if a data source supports SQL language.
LastUsed | The date and time of last usage of the connection.
LoginDialog | Gets / sets the reference to login dialog interface.
LoginPrompt | Specifies whether a login dialog appears immediately before opening a new connection.
Messages | Returns a list of messages returned by DBMS after recent database operation.
Offlined | Gets / sets connection offline status.
OptionsIntf | The reference to IADStanOptions interface.
Params | Lists database connection parameters for the FireDAC connection definition associated with the connection object.
RDBMSKind | Returns the brand of DBMS currently connected.
RefCount | Returns the number of references to this connection object.
ResourceOptions | The set of default options to control resources usage.
ResultConnectionDef | The actual connection definition used to establish connection to a DBMS.
SharedCliHandle | CLI handle shared with other connection.
Temporary | Shows whether a connection object is created on fly (temporary one) and managed automatically or a persistent one explicitly created, managed, and freed by the application.
Transaction | The reference to TADCustomTransaction object.
TxOptions | The set of options to control transactions.
UpdateOptions | The set of default options to control data updating.
UpdateTransaction | The reference to TADCustomTransaction object, which will be used to post changes to DB.
Links
Events, TADCustomConnection Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomConnection.AfterCommit Event

TADCustomConnection.AfterCommit Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Fires after transaction is committed.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.

Syntax
property AfterCommit: TNotifyEvent;
See Also

BeforeCommit

What do you think about this topic? Send feedback!


TADCustomConnection.AfterRollback Event

TADCustomConnection.AfterRollback Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Fires after transaction is rolled back.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The AfterRollback event fires after the Rollback method is executed and the transaction is rolled back. In case of a nested transaction in AfterRollback event handler the transaction is not yet rolled back in full, but nesting level is decremented.

Syntax
property AfterRollback: TNotifyEvent;
See Also

BeforeRollback

What do you think about this topic? Send feedback!


TADCustomConnection.Connected Property

TADCustomConnection.Connected Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Gets / sets connection active status.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

Set Connected to True to establish a connection to a DBMS. Set Connected to False to close a connection. The default value for Connected is False.

An application can check Connected to determine the current status of a connection. If Connected is True, the connection is active; if False, and the KeepConnection property is also False, then the connection is inactive.

To open connection, it must be setup in one of the following ways:

  1. Set ConnectionDefName to a name of one of a existing connection definitions and optionally override connection definition parameters in Params. Existing connection definition may be defined either in connection definitions INI file or created on fly, for example, using TADCustomManager.AddConnectionDef;
  2. Set DriverName to a name of one of a registered drivers (or add DriverID into Params) and specify connection definition parameters in Params.

When the connection definition is pooled (Pooled=True), then use (1) and does not override any of parameters, otherwise you will get an exception.

Setting Connected to False will try to connect to a DB. If somehow the connecting fails, then Connected will remain False and an an exception will be raised. If connecting failed due to a DB unavailability, then application may use Automatic Connection Recovery feature to wait and try to establish the connection.

Setting Connected to False will disconnect (close and unprepare) all associated commands and datasets. If you just need to disconnect from DBMS, but does not close objects, then use Offlined property.

Syntax
property Connected;
See Also

TCustomConnection.BeforeConnect, TCustomConnection.AfterConnect, TCustomConnection.BeforeDisconnect, TCustomConnection.AfterDisconnect, ConnectionDefName, DriverName, Params, Offlined, OnRecover

Example 1
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;
Example 2

See FireDAC\Samples\Comp Layer\TADConnection\Pooling sample for details of how to work with pooled connections.

What do you think about this topic? Send feedback!


TADCustomConnection.AfterStartTransaction Event

TADCustomConnection.AfterStartTransaction Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Fires after transaction is started.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The AfterStartTransaction event fires after the StartTransaction method is executed and the transaction is started. In case of a nested transaction in AfterStartTransaction event handler the transaction is not just started, but nesting level is incremented.

Syntax
property AfterStartTransaction: TNotifyEvent;
See Also

BeforeStartTransaction

What do you think about this topic? Send feedback!


TADCustomConnection.BeforeCommit Event

TADCustomConnection.BeforeCommit Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Fires before transaction will be committed.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The BeforeCommit event fires before the Commit method will be executed and the transaction will be committed.

Syntax
property BeforeCommit: TNotifyEvent;
See Also

AfterCommit

What do you think about this topic? Send feedback!


TADCustomConnection.BeforeRollback Event

TADCustomConnection.BeforeRollback Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Fires before transaction will be rolled back.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The BeforeRollback event fires before the Rollback method will be executed and the transaction will be rolled back.

Syntax
property BeforeRollback: TNotifyEvent;
See Also

AfterRollback

What do you think about this topic? Send feedback!


TADCustomConnection.BeforeStartTransaction Event

TADCustomConnection.BeforeStartTransaction Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Fires before transaction will be started.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The BeforeStartTransaction event fires before the StartTransaction method will be executed and the transaction will be started.

Syntax
property BeforeStartTransaction: TNotifyEvent;
See Also

AfterStartTransaction

What do you think about this topic? Send feedback!


TADCustomConnection.CliHandle Property

TADCustomConnection.CliHandle Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

CLI handle for connection sharing.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

The CliHandle property returns DBMS Call Level Interface connection handle. Then this value may be assigned to another TADCustomConnection object SharedCliHandle property. This is useful to transfer a connection from an application into a DLL. See DLL Development.

After setting Connected=True for the DLL connection, both connections will share the same physical DBMS connection. This connection must be closed after all other connections, sharing the same CLI handle.

Syntax
property CliHandle: Pointer;
See Also

DLL Development, SharedCliHandle, Connected

Example 1

See demo application FireDAC\Samples\Comp Layer\TADConnection\DLL_Sharing.

Example 2

Application code (without checks):

  FhDll := LoadLibrary(PChar('Project2.dll'));
  @FpShowData := GetProcAddress(FhDll, PChar('ShowData'));
  FpShowData(ADConnection1.CliHandle);

DLL code:

procedure ShowData(ACliHandle: LongWord);
begin
  ADConnection1.SharedCliHandle := ACliHandle;
  ADConnection1.Connected := True;
  ADQuery1.Active := True;
end;
What do you think about this topic? Send feedback!


TADCustomConnection.CliObj Property

TADCustomConnection.CliObj Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public Send Feedback

Returns a CLI connection wrapping object.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public
Description

The CliObj property returns a DBMS Call Level Interface connection wrapping object. The class of the object depends on FireDAC driver. Following table lists drivers, connection wrapping classes and units. The wrapping object may be useful for performing low-level operations with the DBMS Call Level Interface.

Driver | Wrapping class and unit
Advantage | TADSConnection, uADPhysADSWrapper.pas
dbExpress (v <= 3) | ISQLConnection
Interbase, Firebird | TIBDatabase, uADPhysIBWrapper.pas
MySQL | TMySQLSession, uADPhysMySQLWrapper.pas
Microsoft SQL Server Microsoft Access IBM DB2 Sybase SQL Anywhere ODBC | TODBCConnection, uADPhysODBCWrapper.pas
Oracle | TOCIService, uADPhysOracleWrapper.pas
PostgreSQL | TPgConnection, uADPhysPgWrapper.pas
SQLite | TSQLiteDatabase, uADPhysSQLiteWrapper.pas
TDBX (v >= 4) DataSnap | TDBXConnection
Syntax
property CliObj: Pointer;
Example
uses
  uADPhysODBCWrapper;
....
  // returns ODBC driver DLL name for an ODBC based connection
  ShowMessage(TODBCConnection(ADConnection1.CliObj).DRIVER_NAME);
What do you think about this topic? Send feedback!


TADCustomConnection.CommandCount Property

TADCustomConnection.CommandCount Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

The number of assocciated TADCustomCommand objects.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

The CommandCount property returns the number of prepared (State <> csInactive) TADCustomCommand objects, assocciated with this connection object.

Syntax
property CommandCount: Integer;
See Also

Commands, TADCustomCommand

Example
var
  i: Integer;
...
  for i := ADConnection1.CommandCount - 1 downto 0 do
    ADConnection1.Commands[i].Disconnect(True);
What do you think about this topic? Send feedback!


TADCustomConnection.Commands Property

TADCustomConnection.Commands Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Returns assocciated TADCustomCommand objects.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

The Commands indexed property returns a prepared (State <> csInactive) TADCustomCommand object, assocciated with this connection object, by it index.

Syntax
property Commands [AIndex: Integer]: TADCustomCommand;
See Also

CommandCount, TADCustomCommand

Example
var
  i: Integer;
...
  for i := ADConnection1.CommandCount - 1 downto 0 do
    ADConnection1.Commands[i].Disconnect(True);
What do you think about this topic? Send feedback!


TADCustomConnection.ConnectedStoredUsage Property

TADCustomConnection.ConnectedStoredUsage Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Controls how to use Connected property value saved to DFM.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The ConnectedStoredUsage property controls how to use Connected property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ConnectedStoredUsage: TADStoredActivationUsage;
See Also

Connected

What do you think about this topic? Send feedback!


TADCustomConnection.ConnectionDefName Property

TADCustomConnection.ConnectionDefName Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 Example 3 public See Also Send Feedback

The name of connection definition to use.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, Example 3, public, See Also
Description

The ConnectionDefName property specifies the name of one of a existing connection definitions. It must be stored in ADConnectionDefs.ini or created dynamically.

Note, attempting to set ConnectionDefName when the Connected property is true raises an exception.

Syntax
property ConnectionDefName: String;
See Also

Defining Connection, TADCustomManager

Example 1
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;
Example 2

See demo FireDAC\Samples\Comp Layer\TADConnection\ConnectionDefs for details how to create and use connection definitions.

Example 3

Specifying pooled connection:

var
  oList: TStringList;
  ......
  oList := TStringList.Create;
  oList.Add('Server=MyServer');
  oList.Add('Database=Northwind');
  oList.Add('User_Name=sa');
  oList.Add('Password=');
  oList.Add('Pooled=True');
  ADManager.AddConnectionDef('myconn', 'MSSQL', oList);
  ......
  ADConnection1.ConnectionDefName := 'myconn';
  ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADCustomConnection.ConnectionIntf Property

TADCustomConnection.ConnectionIntf Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Returns the IADPhysConnection interface.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The ConnectionIntf property returns a reference to the IADPhysConnection interface. It is not nil, if a connection is established. Otherwise it is nil. It is not recommended to mix usage of TADCustomConnection API and TADCustomConnection.ConnectionIntf API.

Syntax
property ConnectionIntf: IADPhysConnection;
See Also

IADPhysConnection

What do you think about this topic? Send feedback!


TADCustomConnection.ConnectionMetaDataIntf Property

TADCustomConnection.ConnectionMetaDataIntf Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Returns an IADPhysConnectionMetadata interface.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

The ConnectionMetaDataIntf property returns a reference to the IADPhysConnectionMetadata interface. The IADPhysConnectionMetadata interface allows to get knowledge about a DBMS behavior.

Syntax
property ConnectionMetaDataIntf: IADPhysConnectionMetadata;
See Also

Connected, ConnectionIntf, IADPhysConnectionMetadata

Example
procedure TMainForm.Button2Click(Sender: TObject);
var
  oMetaIntf: IADPhysConnectionMetadata;
begin
  // Get client and server versions
  oMetaIntf := ADConnection1.ConnectionMetaDataIntf;
  try
    ShowMessage(Format('Client version: %.10d; Server version: %.10d',
      [oMetaIntf.ClientVersion, oMetaIntf.ServerVersion]));
  finally
    oMetaIntf:= nil; // always release the Interface before you close the connection
  end;
end;
What do you think about this topic? Send feedback!


TADCustomConnection.ConnectionName Property

TADCustomConnection.ConnectionName Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Specifies the name of the connection to associate with this connection object.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Use ConnectionName to specify the name of the connection to use with a connection object. If ConnectionName is the same as an existing connection definition, then the ConnectionDefName and DriverName properties need not be set. If ConnectionName does not match an existing connection definition, then either the application must also supply a valid connection definition in the ConnectionDefName property in addition to the or it must supply the DriverName and Params properties.

You can specifiy as ConnectionName for TADCustomCommand or TADRDBMSDataSet component and its descendants (TADQuery, TADStoredProc, TADTable), the ConnectionName of one of the existing TADConnection objects or the name of one of the existing connection definitions.

Notes
  1. Attempting to set ConnectionName when the Connected property is true raises an exception.
  2. At design time double-click a TConnection component to invoke the Database editor and set the ConnectionName.
Syntax
property ConnectionName: String;
See Also

ConnectionDefName, DriverName, Params, TADCustomCommand.ConnectionName, TADRDBMSDataSet.ConnectionName

Example
ADConnection1.ConnectionName := 'TestConn';
ADConnection1.DriverName := 'Oracl';'
ADConnection1.Params.Add('Database=testdb');
....
ADQuery1.ConnectionName := 'TestConn';
ADQuery1.Open('select * from test_tab');
What do you think about this topic? Send feedback!


TADCustomConnection.DataSets Property

TADCustomConnection.DataSets Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Returns assocciated TADDataSet objects.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

The DataSets indexed property returns a prepared (State <> csInactive) TADRdbmsDataSet objects, assocciated with this connection object, by it index.

Syntax
property DataSets [AIndex: Integer]: TADDataSet;
See Also

DataSetCount, TADRdbmsDataSet

Example
var
  i: Integer;
...
  for i := ADConnection1.DataSetCount - 1 downto 0 do
    ADConnection1.DataSets[i].Disconnect(True);
What do you think about this topic? Send feedback!


TADCustomConnection.DriverName Property

TADCustomConnection.DriverName Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Specifies the ID of the FireDAC driver for the connection.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Use DriverName to specify the ID of the FireDAC driver to use for connection that do not specify an ConnectionDefName. DriverName must be a valid FireDAC registered driver ID.

If an application sets DriverName, it must also specify connection parameters in the Params property. Ordinarily the alias specified in the ConnectionDefName property supplies connection parameters, but when DriverName is set, the ConnectionDefName property is automatically cleared to avoid FireDAC driver ID contention.

Attempting to set DriverName when the Connected property is True raises an exception.

Setting DriverName value, will add DriverID=<xxx> parameter to the Params list.

Notes

At design time double-click a TConnection component to invoke the Connection editor and set the DriverName.

Or choose DriverName value in property inspector from drop-down list.

Syntax
property DriverName: string;
See Also

Params, ConnectionDefName

Example
ADConnection1.DriverName := 'Oracl';'
ADConnection1.Params.Add('Database=testdb');
....
ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select * from test_tab');
What do you think about this topic? Send feedback!


TADCustomConnection.FetchOptions Property

TADCustomConnection.FetchOptions Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

The set of default options to control rows fetching.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The FetchOptions property is the set of default properties, controlling the fetching of cursor rows. These properties will be inherited by commands and datasets, associated with this connection. Also these properties will inherit its values from FetchOptions of ADManager object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions, ADManager

What do you think about this topic? Send feedback!


TADCustomConnection.FormatOptions Property

TADCustomConnection.FormatOptions Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

The set of default options to control data representation.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The FormatOptions property is the set of the default properties, controlling the data type mapping, and some other aspects of data handling. These properties will be inherited by commands and datasets, accossiated with this connection. Also these properties will inherit its values from FormatOptions of ADManager object.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, ADManager

What do you think about this topic? Send feedback!


TADCustomConnection.InTransaction Property

TADCustomConnection.InTransaction Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Indicates whether a connection transaction is in progress or not.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Examine InTransaction at run-time to determine if a connection transaction is currently in progress. InTransaction is True if a transaction is in progress, False otherwise.

The value of InTransaction cannot be changed directly. Calling StartTransaction sets InTransaction to True. Calling Commit or Rollback sets InTransaction to False.

InTransaction is the shortcut for ConnectionIntf.Transaction.Active or Transaction.Active.

Syntax
property InTransaction: Boolean;
See Also

StartTransaction, Commit, Rollback, TADTransaction

Example

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.

What do you think about this topic? Send feedback!


TADCustomConnection.IsSQLBased Property

TADCustomConnection.IsSQLBased Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public Send Feedback

Property returns True, if a data source supports SQL language.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public
Description

Property returns True, if a data source supports SQL language. Actually, the property were introduced for BDE compatibility. All FireDAC drivers support SQL language, so IsSQLBased is always True.

Syntax
property IsSQLBased: Boolean;
What do you think about this topic? Send feedback!


TADCustomConnection.LastUsed Property

TADCustomConnection.LastUsed Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public Send Feedback

The date and time of last usage of the connection.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public
Description

The LastUsed property returns the date and time of the last activity on this connection.

Syntax
property LastUsed: TDateTime;
What do you think about this topic? Send feedback!


TADCustomConnection.LoginDialog Property

TADCustomConnection.LoginDialog Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Gets / sets the reference to login dialog interface.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

The LoginDialog property allows to associate the login dialog TADGUIxLoginDialog with this connection. The dialog instance assigned to the LoginDialog will be used only by this connection object.

If the LoginDialog property is not assigned, but the TADGUIxLoginDialog is in your application or one of the units uADGUIxXxxxLogin is linked into application, then the connection object will use the global login dialog instance.

The login dialog will popup at connecting to a DBMS only if all of the following conditions are met:

  • LoginPrompt=True;
  • connection definition is not pooled (Pooled=False);
  • global silent flag is not set to True (ADGUIxSilent() = False);
  • connection object does not use shared CLI handle (SharedCliHandle = nil).
Syntax
property LoginDialog: TADGUIxLoginDialog;
See Also

Establishing Connection, TADGUIxLoginDialog, LoginPrompt, SharedCliHandle, ADGUIxSilent

Example

Using private login dialog:

ADGUIxLoginDialog1.Caption := 'Welcome to the Northwind DB';
ADGUIxLoginDialog1.VisibleItems.Add('User_name');
ADGUIxLoginDialog1.VisibleItems.Add('Password');
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.LoginPrompt := True;
ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADCustomConnection.LoginPrompt Property

TADCustomConnection.LoginPrompt Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Specifies whether a login dialog appears immediately before opening a new connection.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

Set LoginPrompt to True to provide login support when establishing a connection. When LoginPrompt is True, a dialog appears to prompt users for a name, password and other optional parameters. The dialog appears after the BeforeConnect event and before the AfterConnect event, unless you supply an OnLogin event handler. If there is an OnLogin event handler, that event occurs in place of the login dialog. If correct values for the user name, password and other optional parameters are not supplied in the dialog or by the OnLogin event handler, the connection fails. This OnLogin event does not fire unless LoginPrompt is set to True.

When LoginPrompt is False, the application must supply user name, password and other optional parameter values programmatically. For that application can specify User_name, Password, etc parameters in Params.

The login dialog will popup at connecting to a DBMS only if all of the following conditions are met:

  • LoginPrompt=True;
  • connection definition is not pooled (Pooled=False);
  • global silent flag is not set to True (ADGUIxSilent() = False);
  • connection object does not use shared CLI handle (SharedCliHandle = nil).
Syntax
property LoginPrompt;
See Also

Establishing Connection, OnLogin, LoginDialog, Params, SharedCliHandle, ADGUIxSilent, AfterConnect

Example 1

Using login dialog:

ADGUIxLoginDialog1.Caption := 'Welcome to the Northwind DB';
ADGUIxLoginDialog1.VisibleItems.Add('User_name');
ADGUIxLoginDialog1.VisibleItems.Add('Password');
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.LoginPrompt := True;
ADConnection1.Connected := True;
Example 2

Connecting without login dialog:

procedure TForm1.ADConnection1Login(AConnection: TADCustomConnection; const AConnectionDef: IADStanConnectionDef);
begin
  AConnectionDef.UserName := 'dba';
  AConnectionDef.Password := 'sql';
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  ADConnection1.OnLogin := ADConnection1Login;
  ADConnection1.LoginPrompt := True;
  ADConnection1.Connected := True;
end;
What do you think about this topic? Send feedback!


TADCustomConnection.Messages Property

TADCustomConnection.Messages Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Returns a list of messages returned by DBMS after recent database operation.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Read the Messages property to get a list of the messages, hints or warnings, returned by a DBMS after a recent DBMS call. The property is of type EADDBEngineException. The content definition depends on a DBMS kind.

DBMS
Description
Advantage Database Server
None.
Microsoft Access Database
None.
DataSnap server
None.
IBM DB2
None.
Firebird / Interbase
None.
MySQL Server
Output of SHOW WARNINGS command.
Oracle Server
Output produced by DBMS_OUTPUT package.
PostgreSQL
Notice and warning messages.
SQLite
None.
Sybase SQL Anywhere
  • ODBC warnings;
  • Output of MESSAGE command.
Microsoft SQL Server
  • ODBC warnings;
  • Messages from RAISERROR with severity <= 16. For example output of EXEC sp_configure call.

Not all supported DBMS's are returning non-error messages automatically. For example, for Oracle and MySQL FireDAC need to call additional DBMS API to bring the messages to a client. That requires additional server round trips. But for SQL Server and Sybase SQL Anywhere the messages are returned always automatically. Setting ResourceOptions.ServerOutput to True guarantees, that for any DBMS the messages will be returned to client automatically.

The messages will be stored in the Messages list until next DBMS call (Open, ExecSQL, StartTransaction, etc).

Syntax
property Messages: EADDBEngineException;
See Also

Executing Command, EADDBEngineException

Example
var
  i: Integer;
begin
  ADConnection1.ResourceOptions.ServerOutput := True;
  ADQuery1.ExecSQL;
  for i := 0 to ADConnection1.ConnectionIntf.Messages.ErrorCount - 1 do
    Memo1.Lines.Add(ADConnection1.ConnectionIntf.Messages[i].Message);
end;
What do you think about this topic? Send feedback!


TADCustomConnection.Offlined Property

TADCustomConnection.Offlined Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Gets / sets connection offline status.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

Set Offlined to True to switch connection and associated with it commands and datasets to the offline mode. In offline mode connection to DBMS is closed, but datasets remain open.

If dataset, associated with this connection object is active and not all records are fetched from DBMS cursor, then depending on FetchOptions.AutoFetchAll value the following actions will be performed:

  • afAll - the dataset will fetch all records from cursor and will go to offline mode. This is the default mode.
  • afTruncate - the dataset will truncate result set and will go to offline mode.
  • afDisable - exception will be raised.

If application will try to perform on a command or a dataset objects any operation requiring DBMS connection, then if ResourceOptions.AutoConnect =True, the connection will automatically establish connection to the DBMS. This is the default mode. If ResourceOptions.AutoConnect = False, then connection object will raise an exception.

Set Offlined to False to establish connection with DBMS and switch to online mode.

Syntax
property Offlined: Boolean;
See Also

Offlining Connection, TADFetchOptions.AutoFetchAll, TADTopResourceOptions.AutoConnect, Connected, Offline, Online

What do you think about this topic? Send feedback!


TADCustomConnection.OnError Event

TADCustomConnection.OnError Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Fires before FireDAC will raise exception.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ASender | This connection object.
AInitiator | The interface of the object initially discovered error.
AException | The exception object to be raised.
Description

The OnError event handler fires before FireDAC will raise exception inside of call of one of the connection or assocciated commands or datasets methods. In most cases AException will be of EADDBEngineException class.

The event handler can replace AException object with some other custom exception. In this case original object must be freed.

Syntax
property OnError: TADErrorEvent;
See Also

Handling Errors, EADDBEngineException

Example
procedure TForm1.ADConnection1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if (AException is EADDBEngineException) and (EADDBEngineException(AException).Kind = ekUKViolated) then begin
    AException.Free;
    AException := Exception.Create('You must enter unique document number !');
  end;
end;
What do you think about this topic? Send feedback!


TADCustomConnection.OnLogin Event

TADCustomConnection.OnLogin Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Fires when an application connects to a DBMS.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Write an OnLogin event handler to take specific actions when an application attempts to connect to a DBMS. When the LoginPrompt property is True, a database login is required. The login dialog and OnLogin event only occur when the LoginPromptproperty is true.

If there is no OnLogin event handler, the current User_Name is read from the Params property or connection definition, and a standard Login dialog box opens. The dialog prompts for a user name, password and other optional parameters, and then uses the values entered by the user to set the User_Name, Password and other optional values in the Params property. These values are then passed to the DBMS.

Applications that provide alternative OnLogin event handlers may set the User_Name, Password and other optional values in AConnectionDef. AConnectionDef is a temporary connection definition and is freed automatically when no longer needed.

Syntax
property OnLogin: TADConnectionLoginEvent;
See Also

Establishing Connection, LoginPrompt, Connected, IADStanConnectionDef

Example

Connecting without login dialog:

procedure TForm1.ADConnection1Login(AConnection: TADCustomConnection; const AConnectionDef: IADStanConnectionDef);
begin
  AConnectionDef.UserName := 'dba';
  AConnectionDef.Password := InputBox('Login', 'Please enter DBA password', 'sql');
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  ADConnection1.OnLogin := ADConnection1Login;
  ADConnection1.LoginPrompt := True;
  ADConnection1.Connected := True;
end;
What do you think about this topic? Send feedback!


TADCustomConnection.OnLosted Event

TADCustomConnection.OnLosted Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Fires after FireDAC was not able to restore losted connection to DBMS.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The OnLosted event fires after FireDAC was not able to automatically restore connection to the DBMS, after discovering that it is losted.

Syntax
property OnLosted: TNotifyEvent;
See Also

Recovering Connection, OnRecover, OnRestored

What do you think about this topic? Send feedback!


TADCustomConnection.OnRecover Event

TADCustomConnection.OnRecover Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Fires after FireDAC discovered that connection to DBMS is losted.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
ASender | This connection object.
AInitiator | The interface of the object initially discovered error.
AException | The exception object describing losted connection issue.
AAction | The action FireDAC should take after return from event handler.
Description

The OnRecover event fires after FireDAC discovered that connection to DBMs is losted. The event handler can analyze the reason, ask user how to proceed, show some status and returns the action, FireDAC should take:

Action | Description
faDefault | If ResourceOptions.AutoReconnect =True, then FireDAC will try to reconnect, otherwise will raise an exception, that connection is losted. By default ResourceOptions.AutoReconnect = False.
faFail | Close connection and raise an exception, that connection is losted.
faRetry | Try to reconnect.
faCloseAbort | Close connection and abort current operation.
faOfflineAbort | Switch connection to the offline mode and abort current operation.

If event handler is not assigned, then FireDAC will take default (faDefault) action. If after 3 trials connection cannot be restored, then FireDAC will close connection and raise an exception, that connection is losted.

Syntax
property OnRecover: TADConnectionRecoverEvent;
See Also

Recovering Connection, OnLosted, OnRestored, TADTopResourceOptions.AutoReconnect, Connected, Offlined

What do you think about this topic? Send feedback!


TADCustomConnection.OnRestored Event

TADCustomConnection.OnRestored Event
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Fires after FireDAC successfully restored losted connection to DBMS.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The OnRestored event fires after FireDAC successfully restored connection to the DBMS, after discovering that it is losted.

Syntax
property OnRestored: TNotifyEvent;
See Also

Recovering Connection, OnLosted, OnRecover

What do you think about this topic? Send feedback!


TADCustomConnection.OptionsIntf Property

TADCustomConnection.OptionsIntf Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

The reference to IADStanOptions interface.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The OptionsIntf returns reference to the IADStanOptions interface, implemented by this connection.

Syntax
property OptionsIntf: IADStanOptions;
See Also

IADStanOptions

What do you think about this topic? Send feedback!


TADCustomConnection.Params Property

TADCustomConnection.Params Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Lists database connection parameters for the FireDAC connection definition associated with the connection object.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Use Params to list DBMS connection definition parameters, such server name, port, database, client character set, user name and password. The possible set of parameters depends on the DBMS kind to connect to.

Params is a list of string items, each representing a different DBMS connection definition parameter. If the ConnectionDefName property specifies a valid FireDAC connection definition, then parameters, specified in Params, will override corresponsding connection definition parameters. If an application need to specify connection definition parameter on-fly, then an application must fill-in all required connection definition parameter into Params.

At design time double-click a TConnection component to invoke the Connection editor and set Params.

Syntax
property Params: TStrings;
See Also

Defining Connection, ConnectionDefName, DriverName, OnLogin

Example
with ADConnection1.Params do begin
  Clear;
  Add('DriverID=Ora');
  Add('Database=ORA_920_APP');
  Add('User_Name=ADDemo');
  Add('Password=a');
end;
ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADCustomConnection.RDBMSKind Property

TADCustomConnection.RDBMSKind Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Returns the brand of DBMS currently connected.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

The RDBMSKind property returns the brand of the DBMS, to which connection object is currently connected. If connection is not active, then property returns mkUnknown.

Syntax
property RDBMSKind: TADRDBMSKind;
See Also

TADRDBMSKind, Connected

Example
case ADConnection1.RDBMSKind of
mkOracle:    s := 'select mySeq.NextVal from dual';
mkInterbase: s := 'select gen_id(myGen, 1) from rdb$database';
else         Exit;
end;
ADQuery1.Open(s);
What do you think about this topic? Send feedback!


TADCustomConnection.RefCount Property

TADCustomConnection.RefCount Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Returns the number of references to this connection object.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Read the RefCount property to see how many command, dataset and transaction objects are referencing to this connection object. Really the property value is not the exact count of objects, because some of objects may reference twice or more to the same connection object.

When no more objects are referencing to this connection object, then RefCount is equal to 0.

Syntax
property RefCount: Integer;
See Also

Temporary, DataSets, DataSetCount, Commands, CommandCount

Example
if ADConnection1.RefCount = 0 then
  ADConnection1.Close;
What do you think about this topic? Send feedback!


TADCustomConnection.ResourceOptions Property

TADCustomConnection.ResourceOptions Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

The set of default options to control resources usage.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The ResourceOptions property is the set of the default properties, controlling the resources usage by the command. These properties will be inherited by commands and datasets, accossiated with this connection. Also these properties will inherit its values from ResourceOptions of ADManager object.

Syntax
property ResourceOptions: TADTopResourceOptions;
See Also

Setting Options, TADTopResourceOptions, ADManager

What do you think about this topic? Send feedback!


TADCustomConnection.ResultConnectionDef Property

TADCustomConnection.ResultConnectionDef Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

The actual connection definition used to establish connection to a DBMS.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The ResultConnectionDef property returns reference to the resulting connection definition used by connection object. It represents original connection definition specified by ConnectionDefName (if it is specified), overriden by Params connection parameters.

Syntax
property ResultConnectionDef: IADStanConnectionDef;
See Also

ConnectionDefName, Params, DriverName, IADStanConnectionDef

What do you think about this topic? Send feedback!


TADCustomConnection.SharedCliHandle Property

TADCustomConnection.SharedCliHandle Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

CLI handle shared with other connection.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

Use SharedCliHandle, to set shared DBMS Call Level Interface connection handle, returned by other connection CliHandle property. This is useful to transfer connection from an application into a DLL. See DLL Development. Note, a connection cannot be shared with other process, as the sharing works only inside the same address space.

After setting Connected=True for this connection, it will use the same physical DBMS connection / session as other connection. And will share the same transaction state.

After setting Connected=False, this DLL connection will not release connection resources to the DBMC client. The application connection is responsible for resources releasing. Because that the application connection must be closed after closing all of the sharing connections.

Syntax
property SharedCliHandle: Pointer;
See Also

DLL Development, CliHandle, Connected

Example 1

See demo application FireDAC\Samples\Comp Layer\TADConnection\DLL_Sharing.

Example 2

Application code (without checks):

  FhDll := LoadLibrary(PChar('Project2.dll'));
  @FpShowData := GetProcAddress(FhDll, PChar('ShowData'));
  FpShowData(ADConnection1.CliHandle);

DLL code:

procedure ShowData(ACliHandle: LongWord);
begin
  ADConnection1.SharedCliHandle := ACliHandle;
  ADConnection1.Connected := True;
  ADQuery1.Active := True;
end;
What do you think about this topic? Send feedback!


TADCustomConnection.Temporary Property

TADCustomConnection.Temporary Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Shows whether a connection object is created on fly (temporary one) and managed automatically or a persistent one explicitly created, managed, and freed by the application.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Use Temporary property to determine if a connection component is created on fly (temporary one) and managed automatically - True, or a persistent one explicitly created, managed, and freed by the application - False.

A temporary connection object is created when a dataset / command has set ConnectionName to the name of the existing connection definition and needs real connection object to communicate with DBMS. That happens at Prepare / Open / Execute / ExecSQL / ExecProc calls.

A temporary connection object is freed when the dataset / command is unprepared. An application can keep temporary connection object for later reusing by setting Temporary to False. After that the application is then responsible for closing the connection when it is no longer needed.

Syntax
property Temporary: Boolean;
See Also

RefCount

Example
var
  oConn: TADconnection;
...
ADQuery1.ConnectionName := 'Access_Demo';
ADQuery1.Open;
...
oConn := ADManager.FindConnection('Access_Demo');
// here oConn.Temporary = True. The oConn will bedestroyed after disconnecting of ADQuery1
oConn.Temporary := False;
...
ADQuery1.Disconnect;
// here oConn is alive due to setting of oConn.Temporary to False
What do you think about this topic? Send feedback!


TADCustomConnection.Transaction Property

TADCustomConnection.Transaction Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

The reference to TADCustomTransaction object.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The Transaction property get/set reference to the transaction object, which will be default one for the connection and all associated datasets and commands without explicitly assigned Transaction property. At moment, this behavior has the meaning only for Interbase / Firebird connection.

Syntax
property Transaction: TADCustomTransaction;
See Also

UpdateTransaction, TADCustomTransaction

What do you think about this topic? Send feedback!


TADCustomConnection.TxOptions Property

TADCustomConnection.TxOptions Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

The set of options to control transactions.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

The TxOptions property is the set of the properties, controlling the transactions in this connection.

You can change transaction properties while there is no active transactions. If you set Transaction property, then application should use Transaction.Options, instead of TxOptions.

Syntax
property TxOptions: TADTxOptions;
See Also

Transaction, TADTxOptions

Example

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.

What do you think about this topic? Send feedback!


TADCustomConnection.UpdateOptions Property

TADCustomConnection.UpdateOptions Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

The set of default options to control data updating.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The UpdateOptions property is the set of the default properties, controlling the data updating by the datasets. These properties will be inherited by datasets, associated with this connection. Also these properties will inherit its values from UpdateOptions of ADManager object.

Syntax
property UpdateOptions: TADUpdateOptions;
See Also

Setting Options, TADUpdateOptions, ADManager

What do you think about this topic? Send feedback!


TADCustomConnection.UpdateTransaction Property

TADCustomConnection.UpdateTransaction Property
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

The reference to TADCustomTransaction object, which will be used to post changes to DB.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

The UpdateTransaction property get/set reference to the transaction object, which will be default one for all associated datasets without explicitly assigned UpdateTransaction property. This transaction will be used by datasets to post changes to the DB.

If UpdateTransaction is not assigned, but Transaction is assigned, then Transaction object will be used as update transaction.

At moment, this behaviour has the meaning only for Interbase / Firebird connection.

Syntax
property UpdateTransaction: TADCustomTransaction;
See Also

Transaction, TADCustomTransaction

What do you think about this topic? Send feedback!


TADCustomConnection.AbortJob Method

TADCustomConnection.AbortJob Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Use the AbortJob method to abort all running dataset operations on this connection.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
AWait: Boolean = False | If True, then caller will wait until the current operations will be terminated.
Description

The AbortJob method aborts all following dataset operations, running on this connection:

  • Open. The dataset is executing DBMS command to open cursor.
  • ExecSQL/Execute. The dataset is executing DBMS command.
  • Fetch. The dataset is fetching rows from cursor.
Syntax
procedure AbortJob(AWait: Boolean = False);
See Also

TADAdaptedDataSet.AbortJob

Example
ADConnection1.AbortJob(True);
ADConnection1.Connected := False;
What do you think about this topic? Send feedback!


TADCustomConnection.ApplyUpdates Method

TADCustomConnection.ApplyUpdates Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Applies change logs of specified datasets to the DBMS.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const ADataSets: array of TADDataSet | A open array, containing a list of datasets to post pending updates.
Description

Call ApplyUpdates to apply change logs for specified active datasets to the database. ApplyUpdates is only meaningful if the CachedUpdates property is True for specified datasets.

ADataSets is an open array of datasets. For each specified dataset this method calls the dataset’s ApplyUpdates and CommitUpdates methods to apply that dataset’s change log to database.

Note, this method is for compatibility with BDE components. To apply updates for few datasets consider to use Centralized Cached Updates.

Syntax
procedure ApplyUpdates(const ADataSets: array of TADDataSet);
See Also

Caching Updates, ApplyUpdates, CommitUpdates

What do you think about this topic? Send feedback!


TADCustomConnection.Assign Method

TADCustomConnection.Assign Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Assigns all properties of one connection to this connection.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
Source: TPersistent | A connection to copy.
Description

Use Assign method to copy all properties and event handlers of one connection to this connection. Assign allows to create a duplicated connection.

Note, a pooled connection and copied connection are not the same. Pooled connections may be used to improve performance in multi-threaded environment.

Syntax
procedure Assign(Source: TPersistent); override;
See Also

Multi Threading

Example
oConn := TADConnection.Create(nil);
oConn.Assign(ADConnection1);
What do you think about this topic? Send feedback!


TADCustomConnection.CheckActive Method

TADCustomConnection.CheckActive Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Checks to see if the connection is active.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

Call CheckActive to assert that the connection to a DBMS is active. If the connection is inactive, then if ResourceOptions.AutoConnect=True, then connection object will automatically connect to the DBMS, otherwise an exception is raised.

Syntax
procedure CheckActive;
See Also

TADTopResourceOptions.AutoConnect, Connected

What do you think about this topic? Send feedback!


TADCustomConnection.CheckConnectionDef Method

TADCustomConnection.CheckConnectionDef Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public Send Feedback

Checks that connection definition is filled correctly.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public
Description

Checks that connection definition is filled correctly with minimal set of required parameters for current environment. The method is mostly usefull for tools or applications, creating the connection definitions of fly.

Syntax
procedure CheckConnectionDef; virtual;
What do you think about this topic? Send feedback!


TADCustomConnection.CheckInactive Method

TADCustomConnection.CheckInactive Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Checks to see if the connection is inactive.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

Call CheckInactive to assert that the connection to a DBMS is inactive. If the connection is active, then if ResourceOptions.AutoConnect=True, then connection object will automatically disconnect from the DBMS, otherwise an exception is raised.

Syntax
procedure CheckInactive;
See Also

TADTopResourceOptions.AutoConnect, Connected

What do you think about this topic? Send feedback!


TADCustomConnection.CheckOnline Method

TADCustomConnection.CheckOnline Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace public See Also Send Feedback

Checks to see if the connection is in online mode.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, public, See Also
Description

Call CheckOnline to assert that the connection to a DBMS is in online mode. If the connection is offlined, then if ResourceOptions.AutoConnect=True, then connection object will automatically go to the online mode, otherwise an exception is raised.

Syntax
procedure CheckOnline;
See Also

TADTopResourceOptions.AutoConnect, Offlined

What do you think about this topic? Send feedback!


TADCustomConnection.Commit Method

TADCustomConnection.Commit Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

Call Commit to permanently store modifications, like a INSERT's / UPDATE's / DELETE's, made in current transaction to the database.

FireDAC supports nested transactions, so the current transaction is the one started with most recent StartTransaction call. If the database does not support nested transactions, like most of DBMS's, then FireDAC will emulate nested transactions using savepoints.

Before calling Commit, an application may check the status of the InTransaction property. If an application calls Commit and there is no current transaction, an exception is raised.

A Commit call on Interbase / Firebird will close and unprepare all datasets and commands, associated with this transaction object. On some other DBMS's a call will invalidate all active result sets. For example, on MS SQL Server 2005. To force FetchAll on active datasets use ReleaseClients method.

The Commit call is the shortcut to Transaction.Commit, if Transaction property is assigned. Otherwise Commit will operate on default connection transaction.

Syntax
procedure Commit;
See Also

Managing Transactions, StartTransaction, InTransaction, Rollback, CommitRetaining, ReleaseClients

Example 1
procedure TForm1.DoThatButtonClick(Sender: TObject);
begin
  ADConnection1.StartTransaction;
  try
    if CustomerQuery.Locate('ID', [100]) then begin
      CustomerQuery.Edit;
      CustomerQuery.FieldByName('status').AsString := 'top';
      CustomerQuery.Post;
      ADConnection1.ExecSQL('delete from debt where CustID = 100');
      ADConnection1.Commit;
    end;
  except
    ADConnection1.Rollback;
    raise;
  end;
end;
Example 2

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.

What do you think about this topic? Send feedback!


TADCustomConnection.CommitRetaining Method

TADCustomConnection.CommitRetaining Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Permanently stores modifications to the data made in the current transaction, without ending the current transaction.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Call CommitRetaining to permanently store modifications, like a INSERT's / UPDATE's / DELETE's, made in current transaction to the database without finishing transaction.

FireDAC supports nested transactions, so the current transaction is the one started with most recent StartTransaction call. If the database does not support nested transactions, like most of DBMS's, then FireDAC will emulate nested transactions using savepoints. CommitRetaining is usefull only for main transaction, not for nested ones.

The CommitRetaining call is the shortcut to Transaction.CommitRetaining, if Transaction property is assigned. Otherwise CommitRetaining will operate on default connection transaction.

Before calling CommitRetaining, an application may check the status of the InTransaction property. If an application calls CommitRetaining and there is no current transaction, an exception is raised.

CommitRetaining will use native functionality on IB/FB. On other DBMS's the method will be equal to calls of Commit, then of StartTransaction.

Syntax
procedure CommitRetaining;
See Also

Managing Transactions, StartTransaction, InTransaction, Rollback, Commit

Example
procedure TForm1.DoThatButtonClick(Sender: TObject);
begin
  ADConnection1.StartTransaction;
  try
    if CustomerQuery.Locate('ID', [100]) then begin
      CustomerQuery.Edit;
      CustomerQuery.FieldByName('status').AsString := 'top';
      CustomerQuery.Post;
      ADConnection1.ExecSQL('delete from debt where CustID = 100');
      ADConnection1.CommitRetaining;
    end;
  except
    ADConnection1.RollbackRetaining;
    raise;
  end;
end;
What do you think about this topic? Send feedback!


TADCustomConnection.DecodeObjectName Method

TADCustomConnection.DecodeObjectName Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Splits DB object name into parts.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AFullName: String | A full DB object name to parse.
var ACatalogName: String | A catalog name specified in a object name.
var ASchemaName: String | A schema name specified in a object name.
var ABaseObjectName: String | A base object name specified in a object name, like a package name.
var AObjectName: String | A object name specified in a full object name.
Description

The DecodeObjectName method parses DB object name into parts, using the current DBMS rules.

Syntax
procedure DecodeObjectName(const AFullName: String; var ACatalogName: String; var ASchemaName: String; var ABaseObjectName: String; var AObjectName: String);
See Also

EncodeObjectName

Example

On Oracle:

var
  sCatalog, sSchema, sBaseObj, sObj: String;
...
  ADConnection1.DecodeObjectName('ADDemo."MyPack".Proc1', sCatalog, sSchema, sBaseObj, sObj);
  // sCatalog -> ''
  // sSchema -> ADDEMO
  // sBaseObj -> MyPack
  // sObj -> PROC1
What do you think about this topic? Send feedback!


TADCustomConnection.EncodeObjectName Method

TADCustomConnection.EncodeObjectName Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Assembles DB object name from it parts.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ACatalogName: String | A catalog name part.
const ASchemaName: String | A schema name part.
const ABaseObjectName: String | A base object name part, like a package name.
const AObjectName: String | A object name.
Returns

A full object name, assembled from specified name parts.

Description

The EncodeObjectName method assembles DB object name from it parts, using the current DBMS rules.

Syntax
function EncodeObjectName(const ACatalogName: String; const ASchemaName: String; const ABaseObjectName: String; const AObjectName: String): String;
See Also

DecodeObjectName

Example

On Oracle:

ShowMessage(ADConnection1.EncodeObjectName('', 'ADDEMO', 'MyPack', 'PROC1')); // -> ADDEMO."MyPack".PROC1
What do you think about this topic? Send feedback!


TADCustomConnection.ExecSQL Method (String)

TADCustomConnection.ExecSQL Method (String)
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Executes a SQL command without parameters.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command to execute.
Returns

The number of affected rows.

Description

The ExecSQL method executes a SQL command without parameters. All returned cursors will be discarded.

Syntax
function ExecSQL(const ASQL: String): LongInt; overload;
See Also

Executing Command, TADQuery

Example
ADConnection1.ExecSQL('truncate table tab1');
What do you think about this topic? Send feedback!


TADCustomConnection.ExecSQL Method (String, array of Variant)

TADCustomConnection.ExecSQL Method (String, array of Variant)
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Executes SQL command with parameters.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command to execute.
const AParams: array of Variant | An open array of parameter values.
Returns

The number of affected rows.

Description

The ExecSQL method executes a SQL command with parameters. All returned cursors will be discarded.

Syntax
function ExecSQL(const ASQL: String; const AParams: array of Variant): LongInt; overload;
See Also

Executing Command, TADQuery

Example
ADConnection1.ExecSQL('delete from mytab where id > :p1', [1000]);
What do you think about this topic? Send feedback!


TADCustomConnection.ExecSQL Method (String, array of Variant, array of TFieldType)

TADCustomConnection.ExecSQL Method (String, array of Variant, array of TFieldType)
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Executes a SQL command with parameters.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command to execute.
const AParams: array of Variant | An open array of parameter values.
const ATypes: array of TFieldType | An open array of parameter data types.
Returns

The number of affected rows.

Description

The ExecSQL method executes a SQL command with parameters. All returned cursors will be discarded.

The method allows to explicitly specify parameter types. If type of some parameter is not needed to be specified, then corresponding item in ATypes must be ftUnknown.

Syntax
function ExecSQL(const ASQL: String; const AParams: array of Variant; const ATypes: array of TFieldType): LongInt; overload;
See Also

Executing Command, TADQuery

Example
ADConnection1.ExecSQL('update mytab where id = :p1 set blobfld = :blb',
  [1000, StringOfChar('x', 100000)], [ftInteger, ftBLOB]);
What do you think about this topic? Send feedback!


TADCustomConnection.ExecSQLScalar Method (String)

TADCustomConnection.ExecSQLScalar Method (String)
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Executes a SQL command without parameters and fetches a single value.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command to execute.
Returns

The value of first column in first row of first result set.

Description

The ExecSQLScalar method executes a SQL command without parameters. The method returns a value of first column in first row of first result set. All other cursors will be discarded.

Syntax
function ExecSQLScalar(const ASQL: String): Variant; overload;
See Also

Executing Command, TADQuery

Example
var
  sVersion: String;
...
  sVersion := ADConnection1.ExecSQLScalar('select @@version');
What do you think about this topic? Send feedback!


TADCustomConnection.ExecSQLScalar Method (String, array of Variant)

TADCustomConnection.ExecSQLScalar Method (String, array of Variant)
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Executes a SQL command with parameters and fetches a single value.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command to execute.
const AParams: array of Variant | An open array of parameter values.
Returns

The value of first column in first row of first result set.

Description

The ExecSQLScalar method executes a SQL command with parameters. The method returns a value of first column in first row of first result set. All other cursors will be discarded.

Syntax
function ExecSQLScalar(const ASQL: String; const AParams: array of Variant): Variant; overload;
See Also

Executing Command, TADQuery

Example
var
  sName: String;
...
  sName := ADConnection1.ExecSQLScalar('select name from {id Employees} where id = :id', [100]);
What do you think about this topic? Send feedback!


TADCustomConnection.ExecSQLScalar Method (String, array of Variant, array of TFieldType)

TADCustomConnection.ExecSQLScalar Method (String, array of Variant, array of TFieldType)
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Executes a SQL command with parameters and fetches a single value.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command to execute.
const AParams: array of Variant | An open array of parameter values.
const ATypes: array of TFieldType | An open array of parameter data typesd.
Returns

The value of first column in first row of first result set.

Description

The ExecSQLScalar method executes a SQL command with parameters. The method returns a value of first column in first row of first result set. All other cursors will be discarded.

The method allows to explicitly specify parameter types. If type of some parameter is not needed to be specified, then corresponding item in ATypes must be ftUnknown.

Syntax
function ExecSQLScalar(const ASQL: String; const AParams: array of Variant; const ATypes: array of TFieldType): Variant; overload;
See Also

Executing Command, TADQuery

Example
var
  sName: String;
...
  sName := ADConnection1.ExecSQLScalar('select name from {id Employees} where id = :id', [100], [ftLargeInt]);
What do you think about this topic? Send feedback!


TADCustomConnection.GetCatalogNames Method

TADCustomConnection.GetCatalogNames Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of catalogs in a DB.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const APattern: string | LIKE-pattern.
AList: TStrings | A list receiving catalog names.
Description

Call GetCatalogNames to retrieve a list of catalogs in a DB.

APattern is the LIKE-pattern filtering catalog names.

AList is a TStrings descendant that receives the catalog names. Any existing strings are deleted from the list before GetCatalogNames adds the names of all the catalogs in a DB.

Syntax
procedure GetCatalogNames(const APattern: string; AList: TStrings);
See Also

Querying Metadata, TADMetaInfoQuery

Example
ADConnection1.GetCatalogNames('', ListBox1.Items);
What do you think about this topic? Send feedback!


TADCustomConnection.GetFieldNames Method

TADCustomConnection.GetFieldNames Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Populates a string list with the names of fields in a table.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const ATableName: string | A table name.
const APattern: string | A LIKE-pattern.
AList: TStrings | A list receiving field names.
Description

Call GetFieldNames to retrieve a list of fields in a table.

ACatalogName, ASchemaName, ATableName names the table whose field names you want added to the list.

APattern is the LIKE-pattern filtering field names.

AList is a TStrings descendant that receives the field names. Any existing strings are deleted from the list before GetFieldNames adds the names of all the fields in ATableName.

The field names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case.

Syntax
procedure GetFieldNames(const ACatalogName: string; const ASchemaName: string; const ATableName: string; const APattern: string; AList: TStrings);
See Also

TADMetaInfoQuery, Querying Metadata

Example 1
ADConnection1.GetFieldNames('', '', 'MYTAB', '', ListBox1.Items);
Example 2

See FireDAC\Samples\Comp Layer\TADConnection\GetFieldNames sample.

What do you think about this topic? Send feedback!


TADCustomConnection.GetGeneratorNames Method

TADCustomConnection.GetGeneratorNames Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of generators / sequences / <how else> in a database.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const APattern: string | A LIKE-pattern.
AList: TStrings | A list receiving generator names.
AScopes: TADPhysObjectScopes = [osMy] | Generator scopes to returns.
Description

Call GetGeneratorNames to retrieve a list of generators / sequences / <how else> in a database.

ACatalogName and ASchemaName restrict generator names to the catalog and schema.

APattern is the LIKE-pattern filtering generator names.

AList is a TStrings descendant that receives the generator names. Any existing strings are deleted from the list before GetFieldNames adds the names of generators.

AScopes restricts generator names to the specified scopes.

The generator names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case. Specify the MetaDefSchema and/or MetaDefCatalog parameters in connection definition, to avoid these schema and/or catalog names in generator names.

Syntax
procedure GetGeneratorNames(const ACatalogName: string; const ASchemaName: string; const APattern: string; AList: TStrings; AScopes: TADPhysObjectScopes = [osMy]; AFullName: Boolean = True);
See Also

TADMetaInfoQuery, Querying Metadata

Example
ADConnection1.GetGeneratorNames('', '', 'MY%', ListBox1.Items, [osMy, osSystem]);
What do you think about this topic? Send feedback!


TADCustomConnection.GetInfoReport Method

TADCustomConnection.GetInfoReport Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with a detailed report about a connection state.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
AList: TStrings | A string list, where a report is put.
AItems: TADInfoReportItems = [riConnDef .. riKeepConnected] | A report section and mode flags.
Description

Use the GetInfoReport method to get the detailed report about the connection status. The report consists from the optional sections, controlled by the AItems parameter:

Flag | Section header | Description
riConnDef | Connection definition parameters | The complete list of a connection definition parameters.
riFireDAC | FireDAC info | The detailed information about the FireDAC build,
 |  | including version number, tool version, defines,
 |  | Unicode mode.
riClientLog | Client info | The DBMS client loading log. When loading fails, then includes the failure error message.
riClient | -- // -- | The detailed information about a DBMS client, when FireDAC successfully loaded the client. Otherwise - failure error message.
riSessionHints | Session info | The possible incompatibilities between FireDAC, DBMS client and DBMS server, when connection is active or riTryConnect parameter is True and connection successfully established.
riSession | -- // -- | The detailed information about a DBMS session, when connection is active or riTryConnect parameter is True and connection successfully established. Otherwise - "not connected" or failure error message.

The connection handling mode may be specified by the AItems parameter:

Flag | Description
riTryConnect | When connection is inactive, then FireDAC will try to establish a connection.
riKeepConnected | When connection was inactive and FireDAC established it, then FireDAC on GetInfoReport exiting will keep it active. Otherwise the connection will be closed.

The report is put into AList string list. Application may use this method:

  • to test a connection to a DBMS;
  • to report DBMS environment;
  • to report failures.

See DBMS Environment Reports for detailed info about this method and provided information.

Syntax
function GetInfoReport(AList: TStrings; AItems: TADInfoReportItems = [riConnDef .. riKeepConnected]): TADInfoReportStatus;
See Also

DBMS Environment Reports, Connected

Example
ADConnection1.GetInfoReport(mmInfo.Lines);
What do you think about this topic? Send feedback!


TADCustomConnection.GetKeyFieldNames Method

TADCustomConnection.GetKeyFieldNames Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Populates a string list with the names of key fields in a table.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const ATableName: string | A table name.
const APattern: string | A LIKE-pattern.
AList: TStrings | A list receiving primary key field names.
Description

Call GetKeyFieldNames to retrieve a list of primary key fields in a table.

ACatalogName, ASchemaName, ATableName names the table whose primary field names you want added to the list.

APattern is the LIKE-pattern filtering field names.

AList is a TStrings descendant that receives the primary key field names. Any existing strings are deleted from the list before GetKeyFieldNames adds the names of the primary key fields in ATableName.

The field names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case.

Syntax
procedure GetKeyFieldNames(const ACatalogName: string; const ASchemaName: string; const ATableName: string; const APattern: string; AList: TStrings);
See Also

TADMetaInfoQuery, Querying Metadata

Example 1
ADConnection1.GetKeyFieldNames('NORTHWIND', 'DBO', 'MYTAB', '', ListBox1.Items);
Example 2

See FireDAC\Samples\Comp Layer\TADConnection\GetFieldNames sample.

What do you think about this topic? Send feedback!


TADCustomConnection.GetLastAutoGenValue Method

TADCustomConnection.GetLastAutoGenValue Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Returns last auto generated value.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AName: String | The name of generator or sequence or empty string.
Returns

The last auto generated value

Description

The GetLastAutoGenValue method returns last auto-generated value. The meaning and result depends on DBMS:

DBMS | Description
Oracle | AName is the name of a sequence. The method will return CurrValue, if it exists in the session.
Interbase / Firebird | AName is the name of a generator. The method will return GEN_ID(0).
MS SQL Server, MySQL, etc | The last auto generated value in the session.
Syntax
function GetLastAutoGenValue(const AName: String): Variant;
See Also

RDBMSKind

Example
ShowMessage(VarToStr(ADConnection1.GetLastAutoGenValue('MyGen')));
What do you think about this topic? Send feedback!


TADCustomConnection.GetPackageNames Method

TADCustomConnection.GetPackageNames Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of the packages in a DB.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const APattern: string | A LIKE-pattern.
AList: TStrings | A list receiving package names.
AScopes: TADPhysObjectScopes = [osMy] | Package scopes to return.
Description

Call GetPackageNames to retrieve a list of packages in a DB.

ACatalogName, ASchemaName restrict package names to the catalog and schema.

APattern is the LIKE-pattern filtering package names.

AList is a TStrings descendant that receives the package names. Any existing strings are deleted from the list before GetPackageNames adds the names of all the packages in a DB.

AScopes restricts package names to the specified scopes.

The generator names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case. Specify the MetaDefSchema and/or MetaDefCatalog parameters in connection definition, to avoid these schema and/or catalog names in package names.

Syntax
procedure GetPackageNames(const ACatalogName: string; const ASchemaName: string; const APattern: string; AList: TStrings; AScopes: TADPhysObjectScopes = [osMy]; AFullName: Boolean = True);
See Also

TADMetaInfoQuery, Querying Metadata

Example
ADConnection1.GetPackageNames('', 'SYS', 'DBMS%', ListBox1.Items, [osMy, osSystem]);
What do you think about this topic? Send feedback!


TADCustomConnection.GetSchemaNames Method

TADCustomConnection.GetSchemaNames Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of schemas in a DB.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ACatalogName: string | A catalog name.
const APattern: string | LIKE-pattern.
AList: TStrings | A list receiving catalog names.
Description

Call GetSchemaNames to retrieve a list of schemas in a DB.

ACatalogName restricts schema names to the specified catalog. If it is empty, then all schemas will be returned.

APattern is the LIKE-pattern filtering schema names.

AList is a TStrings descendant that receives the schema names. Any existing strings are deleted from the list before GetSchemaNames adds the names of all the schemas in a DB.

Syntax
procedure GetSchemaNames(const ACatalogName: string; const APattern: string; AList: TStrings);
See Also

TADMetaInfoQuery, Querying Metadata

Example
ADConnection1.GetSchemaNames('', '', ListBox1.Items);
What do you think about this topic? Send feedback!


TADCustomConnection.GetStoredProcNames Method

TADCustomConnection.GetStoredProcNames Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of stored procedures in a DB.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const APackage: string | A package name.
const APattern: string | A LIKE-pattern.
AList: TStrings | A list receiving procedure names.
AScopes: TADPhysObjectScopes = [osMy] | Procedure scopes to return.
Description

Call GetStoredProcNames to retrieve a list of stored procedures and functions in a DB.

ACatalogName, ASchemaName restrict procedure names to the catalog and schema.

APackage restricts procedure names to a package.

APattern is the LIKE-pattern filtering procedure names.

AList is a TStrings descendant that receives the procedure names. Any existing strings are deleted from the list before GetStoredProcNames adds the names of all the procedures in a DB.

AScopes restricts stored procedure names to the specified scopes. Applies only to non-packaged procedures.

The stored procedure names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case. Specify the MetaDefSchema and/or MetaDefCatalog parameters in connection definition, to avoid these schema and/or catalog names in procedure names.

Syntax
procedure GetStoredProcNames(const ACatalogName: string; const ASchemaName: string; const APackage: string; const APattern: string; AList: TStrings; AScopes: TADPhysObjectScopes = [osMy]; AFullName: Boolean = True);
See Also

TADMetaInfoQuery, Querying Metadata

Example
ADConnection1.GetStoredProcNames('', '', '', '', ListBox1.Items, [osMy, osSystem]);
What do you think about this topic? Send feedback!


TADCustomConnection.GetTableNames Method

TADCustomConnection.GetTableNames Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Populates a string list with the names of tables in a DB.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const APattern: string | A LIKE-pattern.
AList: TStrings | A list receiving table names.
AScopes: TADPhysObjectScopes = [osMy] | Table scopes to return.
AKinds: TADPhysTableKinds = [tkSynonym, tkTable, tkView] | Object kinds to return.
Description

Call GetTableNames to retrieve a list of tables in a DB.

ACatalogName, ASchemaName restrict table names to the catalog and schema.

APattern is the LIKE-pattern filtering table names.

AList is a TStrings descendant that receives the table names. Any existing strings are deleted from the list before GetTableNames adds the names of all the tables in a DB.

AScopes restricts table names to the specified scopes.

AKinds restricts tables to the specified object kinds.

The table names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case. Specify the MetaDefSchema and/or MetaDefCatalog parameters in connection definition, to avoid these schema and/or catalog names in table names.

Syntax
procedure GetTableNames(const ACatalogName: string; const ASchemaName: string; const APattern: string; AList: TStrings; AScopes: TADPhysObjectScopes = [osMy]; AKinds: TADPhysTableKinds = [tkSynonym, tkTable, tkView]; AFullName: Boolean = True);
See Also

TADMetaInfoQuery, Querying Metadata

Example 1
ADConnection1.GetTableNames('NORTHWIND', 'DBO', 'ADQA%', '', ListBox1.Items,
  [osMy, osSystem, osOther], [tkTable, tkView]);
Example 2

See FireDAC\Samples\Comp Layer\TADConnection\GetFieldNames sample.

What do you think about this topic? Send feedback!


TADCustomConnection.Offline Method

TADCustomConnection.Offline Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Sets connection to offline mode.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

The Offline method disconnects datasets associated with this connection from DBMS, but does not close them. Then closes the connection to the DBMS by implicitly setting Connected to False.

After the call the dataset continue to work as an in-memory dataset and you can perform with the dataset any client operation, which does not require a DBMS, like a browsing. When an application in offline mode will try to perform any operation, requiring to communicate with the DBMS, then following will happen:

  • When ResourceOptions.AutoConnect is True, then the Online method will be called, trying to establish a connection to the DBMS;
  • When ResourceOptions.AutoConnect is False, then an exception will be raised.

To bring connection and associated datasets to the online state, call the Online method.

Calling Offline method is the same as setting Offlined to True.

Syntax
procedure Offline;
See Also

Offlining Connection, Online, Offlined, Connected, TADDataSet.Offline

Example
ADConnection1.Offline;
lblState.Caption := '<not connected>';
What do you think about this topic? Send feedback!


TADCustomConnection.Online Method

TADCustomConnection.Online Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Sets connection to online mode.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

The Online method opens the connection to the DBMS by implicitly setting the Connected to True and changing the state to online.

To bring connection and associated datasets to the offline state, call the Offline method.

Calling Online method is the same as setting Offlined to False.

Syntax
procedure Online;
See Also

Offlining Connection, Offline, Offlined, Connected

Example
ADConnection1.Online;
lblState.Caption := '<connected>';
What do you think about this topic? Send feedback!


TADCustomConnection.Open Method (String)

TADCustomConnection.Open Method (String)
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Open connection to the database, using specified connection string.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionString: String | A ';' separated list of the <name>=<value> parameter pairs.
Description

Call Open method to open connection to a DBMS, using specified connection string. The method is shortcut to filling of Params property and setting Connected to True.

AConnectionString string value may be one of two forms:

  • it is a ';' separated list of the <name>=<value> connection definition parameter pairs. If connection string contains User_Name and/or Password parameters and AUserName and/or APassword arguments are specified, then they will override corresponding parameters in connection string.
  • it is a connection definition name.
Syntax
procedure Open(const AConnectionString: String); overload;
See Also

Params, ConnectionDefName, DriverName, Connected, Open(String, String), Open(String, String, String)

Example
ADConnection1.Open('DriverID=Ora;Database=ORA_920_APP;User_Name=addemo;Password=a');
What do you think about this topic? Send feedback!


TADCustomConnection.Open Method (String, String)

TADCustomConnection.Open Method (String, String)
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Open connection to the database, using specified user name and password.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AUserName: String | User name.
const APassword: String | Password.
Description

Call Open method to open connection to a DBMS, using specified user name and password.

Syntax
procedure Open(const AUserName: String; const APassword: String); overload;
See Also

Params, ConnectionDefName, DriverName, Connected, Open(String), Open(String, String, String)

Example
ADConnection1.Open('addemo', 'a');
What do you think about this topic? Send feedback!


TADCustomConnection.Open Method (String, String, String)

TADCustomConnection.Open Method (String, String, String)
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Open connection to the database, using specified connection parameters, user name and password.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionString: String | A ';' separated list of the <name>=<value> parameter pairs.
const AUserName: String | Optional user name.
const APassword: String | Optional password.
Description

Call Open method to open connection to a DBMS, using specified connection string and optional user name and password. The method is shortcut to filling of Params property and setting Connected to True.

AConnectionString string value may be one of two forms:

  • it is a ';' separated list of the <name>=<value> connection definition parameter pairs. If connection string contains User_Name and/or Password parameters and AUserName and/or APassword arguments are specified, then they will override corresponding parameters in connection string.
  • it is a connection definition name.
Syntax
procedure Open(const AConnectionString: String; const AUserName: String; const APassword: String); overload;
See Also

Params, ConnectionDefName, DriverName, Connected, Open(String), Open(String, String)

Example
 ADConnection1.Open('DriverID=Ora;Database=ORA_920_APP', 'addemo', 'a');
What do you think about this topic? Send feedback!


TADCustomConnection.Ping Method

TADCustomConnection.Ping Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Pings the DBMS server.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Returns

True, if the connection to the DBMS is working.

Description

The Ping method checks whether a connection to a DBMS server is alive. When the connection is dead and ResourceOptions.AutoReconnect is True, then an automatic reconnection is attempted. When a connection is inactive, the Ping method will try to open a connection.

This function can be used by the clients that remain idle for a long while or work in non stable environment (eg bad network), to check whether the server has closed the connection or is unaccessible and reconnect if necessary. Or the server is accessible to open a connection.

Syntax
function Ping: Boolean;
See Also

TADTopResourceOptions.AutoReconnect, Offline, Online, Connected

Example
procedure TMyDataModule.DoPing(ASender: TObject);
begin
  if not ADConnection1.Ping then
    ShowMessage('Connection is losted !');
end;
.......
FTimer := TTimer.Create;
FTimer.OnTimer := DoPing;
FTimer.Interval := 30000; // each 30 secs
FTimer.Enabled := True;
What do you think about this topic? Send feedback!


TADCustomConnection.RefreshMetadataCache Method

TADCustomConnection.RefreshMetadataCache Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Invalidates meta data cache.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AObjName: String = '' | An optional object name for which metadata must be discarded. If not specified, then all cached metadata.
Description

The RefreshMetadataCache method discards cached metadata, like a stored procedure definitions and table primary keys.

If AObjName is specified, then will be discarded cached metadata:

  • for all tables with AObjName name;
  • for all package with AObjName name;
  • for all stored procedures with AObjName name.

If AObjName is empty string (default value), then all connection cached metadata will be discarded.

Call this method, if the DB metadata has been changed, so the cached metadata is invalid. The metadata is cached by datasets, if fiMeta is included into FetchOptions.Cache.

Syntax
procedure RefreshMetadataCache(const AObjName: String = '');
See Also

TADFetchOptions.Cache, Working with Metadata

Example
ADConnection1.ExecSQL('alter table mytab drop primary key');
ADConnection1.RefreshMetadataCache;
What do you think about this topic? Send feedback!


TADCustomConnection.ReleaseClients Method

TADCustomConnection.ReleaseClients Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Performs resource releasing operation on all associated datasets and commands.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
AMode: TADReleaseClientMode = rmDisconnect | An operation to perform.
Description

Use ReleaseClients method to perform one of few DBMS resources releasing operation on all datasets and commands, associated with this connection object. An operation is defined by AMode:

Mode | Description
rmFetchAll | Performs FetchAll, if dataset is active and not all records are fetched. If dataset is unidirectional, then it will be closed. All active commands will be closed.
rmClose | Close all datasets and commands.
rmOffline | Bring all datasets to offline mode, when all records are fetched. All commands will be closed and unprepared.
rmDisconnect | All datasets and commands will be closed and unprepared.
Syntax
procedure ReleaseClients(AMode: TADReleaseClientMode = rmDisconnect);
See Also

Offline, Online, Close, Open

Example
// Fetch all records from active cursors, then commit current transaction.
// On MS SQL Server, for example, active cursors are invalidated after finishing of a transaction.
ADConnection1.ReleaseClients(rmFetchAll);
ADConnection1.Commit;
What do you think about this topic? Send feedback!


TADCustomConnection.Rollback Method

TADCustomConnection.Rollback Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Cancels all modifications to the data made in the current transaction and optionally ends transaction.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

Call Rollback to cancel all modifications, like a INSERT's / UPDATE's / DELETE's, made in current transaction to the database.

FireDAC supports nested transactions, so the current transaction is the one started with most recent StartTransaction call. If the database does not support nested transactions, like most of DBMS's, then FireDAC will emulate nested transactions using savepoints.

Before calling Rollback, an application may check the status of the InTransaction property. If an application calls Rollback and there is no current transaction, an exception is raised.

A Rollback call on Interbase / Firebird will close and unprepare all datasets and commands, associated with this transaction object. On some other DBMS's a call will invalidate all active result sets. For example, on MS SQL Server 2005. To force FetchAll on active datasets use ReleaseClients method.

The Rollback call is the shortcut to Transaction.Rollback, if Transaction property is assigned. Otherwise Rollback will operate on default connection transaction.

Syntax
procedure Rollback;
See Also

Managing Transactions, StartTransaction, InTransaction, Commit, RollbackRetaining, ReleaseClients

Example 1
procedure TForm1.DoThatButtonClick(Sender: TObject);
begin
  ADConnection1.StartTransaction;
  try
    if CustomerQuery.Locate('ID', [100]) then begin
      CustomerQuery.Edit;
      CustomerQuery.FieldByName('status').AsString := 'top';
      CustomerQuery.Post;
      ADConnection1.ExecSQL('delete from debt where CustID = 100');
      ADConnection1.Commit;
    end;
  except
    ADConnection1.Rollback;
    raise;
  end;
end;
Example 2

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.

What do you think about this topic? Send feedback!


TADCustomConnection.RollbackRetaining Method

TADCustomConnection.RollbackRetaining Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Cancels all modifications to the data made in the current transaction, without ending the current transaction.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Call RollbackRetaining to cancel all modifications, like a INSERT's / UPDATE's / DELETE's, made in current transaction to the database.

FireDAC supports nested transactions, so the current transaction is the one started with most recent StartTransaction call. If the database does not support nested transactions, like most of DBMS's, then FireDAC will emulate nested transactions using savepoints.

The RollbackRetaining call is the shortcut to Transaction.RollbackRetaining, if Transaction property is assigned. Otherwise RollbackRetaining will operate on default connection transaction.

Before calling RollbackRetaining, an application may check the status of the InTransaction property. If an application calls RollbackRetaining and there is no current transaction, an exception is raised.

RollbackRetaining will use native functionality on IB/FB. On other DBMS's the method will be equal to calls of Rollback, then of StartTransaction.

Syntax
procedure RollbackRetaining;
See Also

Managing Transactions, StartTransaction, InTransaction, Commit, Rollback

Example
procedure TForm1.DoThatButtonClick(Sender: TObject);
begin
  ADConnection1.StartTransaction;
  try
    if CustomerQuery.Locate('ID', [100]) then begin
      CustomerQuery.Edit;
      CustomerQuery.FieldByName('status').AsString := 'top';
      CustomerQuery.Post;
      ADConnection1.ExecSQL('delete from debt where CustID = 100');
      ADConnection1.CommitRetaining;
    end;
  except
    ADConnection1.RollbackRetaining;
    raise;
  end;
end;
What do you think about this topic? Send feedback!


TADCustomConnection.StartTransaction Method

TADCustomConnection.StartTransaction Method
TADCustomConnection Class TADCustomConnection Members uADCompClient Namespace Example public See Also Send Feedback

Starts new transaction at database.

Group

public

Links
TADCustomConnection Class, TADCustomConnection Members, uADCompClient Namespace, Example, public, See Also
Description

Call StartTransaction to start a new transaction at the DBMS.

The FireDAC supports nested transactions. If DBMS does not support nested transactions, then FireDAC will emulate them using savepoints. If transaction is already active, then FireDAC will put savepoint, otherwise will start new transaction. Use TxOptions.EnableNested to enable / disable nested transactions.

Before calling StartTransaction, an application may adjust settings of the TxOptions property as desired. Adjusting options after transaction is started does not affect current transaction.

All data modifications, like a INSERT's / UPDATE's / DELETE's, made after a call of StartTransaction, may be either confirmed by calling Commit, either undone by calling Rollback.

Some DBMS's will fail to start transaction, if there are active result sets. For example, MS SQL Server 2005.

The StartTransaction call is the shortcut to Transaction.StartTransaction, if Transaction property is assigned. Otherwise StartTransaction will operate on default connection transaction.

Syntax
procedure StartTransaction;
See Also

Managing Transactions, InTransaction, Commit, Rollback, TxOptions

Example

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.

What do you think about this topic? Send feedback!


TADCustomEventAlerter Class

TADCustomEventAlerter Class
public TADCustomEventAlerter Members Example 1 Example 2 Classes See Also Send Feedback

The class is responsible for handling the database event notifications.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomEventAlerter
File

uADCompClient

Links
public, TADCustomEventAlerter Members, Example 1, Example 2, Classes, See Also
Description

Use the TADCustomEventAlerter class to handle the database event notifications. The kind and general behavior of the events is DBMS specific. But TADCustomEventAlerter provides unified way for handling them.

To start receive the event alerts, fill in Names property with required event names. Set Options.Kind to the event alerter kind or leave it empty to use the default alerter. Specify OnAlert event handler, which will be fired when an event is occurred. And set Active to True or call Register method. To stop receive the event alerts, set Active to False or call Unregister.

For details about what FireDAC drivers are supporting event alerters and how to use them see the Database Alerts chapter.

This class hides some of the properties, allowing to control the properties visibility by the descendant classes. End users should use TADEventAlerter.

Syntax
TADCustomEventAlerter = class(TADComponent, IADPhysEventHandler);
See Also

Database Alerts, TADEventAlerter, TADEventAlerterOptions

Example 1
ADEventAlerter1.Names.Text := 'Customers';
ADEventAlerter1.Options.Kind := 'DBMS_ALERT';
ADEventAlerter1.Options.Synchronize := True;
ADEventAlerter1.Options.Timeout := 10000;
ADEventAlerter1.OnAlter := DoAlert;
ADEventAlerter1.OnTimeout := DoTimeout;
ADEventAlerter1.Active := True;
........

procedure TForm1.DoAlert(ASender: TADCustomEventAlerter;
  const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh;
end;

procedure TForm1.DoTimeout(ASender: TObject);
begin
  qryCustomers.Refresh;
end;
Example 2

See the demo at: FireDAC\Samples\Comp Layer\TADEventAlerter\Main

What do you think about this topic? Send feedback!


TADCustomEventAlerter Members

TADCustomEventAlerter Members
Events TADCustomEventAlerter Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomEventAlerter.

Events
Event | Description
OnAlert | The event fires, when a DBMS event is fired.
OnTimeout | The event fires, when a DBMS event is timed out.
Class

TADCustomEventAlerter Class

Methods
Method | Description
Register | Registers the events with a DBMS.
Signal | Fires a DBMS event.
Unregister | Unregisters the events with a DBMS.
Properties
Property | Description
Active | Controls the event registration state of the event alerter.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
EventAlerterIntf | Returns IADPhysEventAlerter interface.
Names | Specifies the event names handled by this alerter.
Options | The set of even alerter options.
Links
Events, TADCustomEventAlerter Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
Events TADCustomEventAlerter Class Legend Methods Properties Send Feedback

The public members of the TADCustomEventAlerter class are listed here.

Events
Event | Description
OnAlert | The event fires, when a DBMS event is fired.
OnTimeout | The event fires, when a DBMS event is timed out.
Class

TADCustomEventAlerter Class

Methods
Method | Description
Register | Registers the events with a DBMS.
Signal | Fires a DBMS event.
Unregister | Unregisters the events with a DBMS.
Properties
Property | Description
Active | Controls the event registration state of the event alerter.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
EventAlerterIntf | Returns IADPhysEventAlerter interface.
Names | Specifies the event names handled by this alerter.
Options | The set of even alerter options.
Links
Events, TADCustomEventAlerter Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomEventAlerter.Active Property

TADCustomEventAlerter.Active Property
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace public See Also Send Feedback

Controls the event registration state of the event alerter.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, public, See Also
Description

Use Active property to set or check when an event alerter has registered the Names events at a DBMS and waiting for events.

Set the Active property to True to register the events at a DBMS and start processing of incoming events. If an FireDAC DBMS driver supports few event alerters, then the event alerter kind must be explicitly assigned to the Options.Kind.

Set the property to False to stop processing of the events.

Syntax
property Active: Boolean;
See Also

Database Alerts, Names, Register, Unregister

What do you think about this topic? Send feedback!


TADCustomEventAlerter.Connection Property

TADCustomEventAlerter.Connection Property
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace public See Also Send Feedback

Specifies the connection component that actually forms the connection to the DBMS.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, public, See Also
Description

Set Connection to the connection component that establishes a connection to the DBMS. If to change Connection property value, while an even alerter is active, then it will unregister his events.

Syntax
property Connection: TADCustomConnection;
See Also

Names, Register

What do you think about this topic? Send feedback!


TADCustomEventAlerter.EventAlerterIntf Property

TADCustomEventAlerter.EventAlerterIntf Property
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace public See Also Send Feedback

Returns IADPhysEventAlerter interface.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, public, See Also
Description

The EventAlerterIntf property returns the reference to the IADPhysEventAlerter interface. It is not nil, if the connection is active and alerter has registered his events. Otherwise it is nil. It is not recommended to mix usage of TADCustomEventAlerter API and TADCustomEventAlerter.EventAlerterIntf API.

Syntax
property EventAlerterIntf: IADPhysEventAlerter;
See Also

IADPhysEventAlerter

What do you think about this topic? Send feedback!


TADCustomEventAlerter.Names Property

TADCustomEventAlerter.Names Property
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace Example public See Also Send Feedback

Specifies the event names handled by this alerter.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, Example, public, See Also
Description

Use the Names property to specify the event names.

The event alerter will be notified only about the listed events. Note, that the Oracle DBMS_PIPE event alerter supports only a single event name. The event names may be case-sensitive or case-insensitive, depending on a DBMS.

Syntax
property Names: TStrings;
See Also

Database Alerts, Register, Active

Example
with ADEventAlerter1 do begin
  Unregister;
  Names.Clear;
  Names.Add('Customers');
  Names.Add('Orders');
  Register;
end;
What do you think about this topic? Send feedback!


TADCustomEventAlerter.OnAlert Event

TADCustomEventAlerter.OnAlert Event
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace Example public See Also Send Feedback

The event fires, when a DBMS event is fired.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, Example, public, See Also
Description

Use the OnAlert event handler to specify an event handler, which will be fired when one of the specified in the Names DBMS events is fired. To start receive event notifications, the events must be registered using the Register method or the Active property. The event handler may be fired in the own event alerter thread (False) or in the main application thread (True), depending on the Options.Synchronize option.

The event handler receives three arguments:

  • ASender is the event alerter reference;
  • AEventName specifies the name of the event;
  • AArgument specifies the additional arguments to the event. The arguments are fully DBMS and application dependent. There must be a Null or Unassigned value, if no arguments are specified. The scalar variant value, when only single argument is specified. Or an variant array of values.
Syntax
property OnAlert: TADEventAlerterEvent;
See Also

Database Alerts, OnTimeout, Names

Example
procedure TForm1.ADEventAlerter1Alert(ASender: TADCustomEventAlerter;
    const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh
  else if CompareText(AEventName, 'Orders') = 0 then
    qryOrders.Refresh;
end;
What do you think about this topic? Send feedback!


TADCustomEventAlerter.OnTimeout Event

TADCustomEventAlerter.OnTimeout Event
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace public See Also Send Feedback

The event fires, when a DBMS event is timed out.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, public, See Also
Description

Use the OnTimeout event handler to specify an event handler, which will be fired after the specified by the Options.Timeout time and no one event is fired. The specified timeout is in 1/1000 of sec.The event handler may be fired in the own event alerter thread (False) or in the main application thread (True), depending on the Options.Synchronize option.

Syntax
property OnTimeout: TNotifyEvent;
See Also

Database Alerts, OnAlert, Options

What do you think about this topic? Send feedback!


TADCustomEventAlerter.Options Property

TADCustomEventAlerter.Options Property
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace public See Also Send Feedback

The set of even alerter options.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, public, See Also
Description

Use the Options property to specify the different aspects of even handling.

Syntax
property Options: TADEventAlerterOptions;
See Also

Database Alerts, TADEventAlerterOptions

What do you think about this topic? Send feedback!


TADCustomEventAlerter.Register Method

TADCustomEventAlerter.Register Method
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace public See Also Send Feedback

Registers the events with a DBMS.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, public, See Also
Description

Use the Register method to register the events at a DBMS and start processing of incoming events. If an FireDAC DBMS driver supports few event alerters, then the event alerter kind must be explicitly assigned to the Options.Kind. If the event alerter is already registered at a DBMS, then no actions will be taken. Alternatively, you can set the Active property to True.

Syntax
procedure Register;
See Also

Database Alerts, Active, Name, Unregister

What do you think about this topic? Send feedback!


TADCustomEventAlerter.Signal Method

TADCustomEventAlerter.Signal Method
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace Example public See Also Send Feedback

Fires a DBMS event.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AEvent: String | The event name to fire.
const AArgument: Variant | The optional arguments for the event. Use Unassigned or Null if no arguments needed. Use Variant array if more than one argument need to be specified.
Description

Use the Signal method to fire a DBMS event. To fire an event, the event alerter must be registered with a DBMS.

Syntax
procedure Signal(const AEvent: String; const AArgument: Variant);
See Also

Database Alerts, Register

Example
ADEventAlerter1.Names.Text := 'Customers';
ADEventAlerter1.Register;
ADEventAlerter1.Signal('Customers', 123);
What do you think about this topic? Send feedback!


TADCustomEventAlerter.Unregister Method

TADCustomEventAlerter.Unregister Method
TADCustomEventAlerter Class TADCustomEventAlerter Members uADCompClient Namespace public See Also Send Feedback

Unregisters the events with a DBMS.

Group

public

Links
TADCustomEventAlerter Class, TADCustomEventAlerter Members, uADCompClient Namespace, public, See Also
Description

Use the Register method to unregister the events at a DBMS and stop processing of incoming events. If the event alerter is already unregistered at a DBMS, then no actions will be taken. Alternatively, you can set the Active property to False.

Syntax
procedure Unregister;
See Also

Database Alerts, Active, Name, Register

What do you think about this topic? Send feedback!


TADCustomLocalSQL Class

TADCustomLocalSQL Class
public TADCustomLocalSQL Members Example Classes See Also Send Feedback

The base class for the Local SQL engine.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomLocalSQL
File

uADCompClient

Links
public, TADCustomLocalSQL Members, Example, Classes, See Also
Description

The TADCustomLocalSQL class is a base class for Local SQL engine. The programmer must not use it directly. The engine itself is implemented by TADLocalSQL class.

The Connection property points to a connection object which will provide ability to execute the Local SQL commands. To activate engine set Active to True.

FireDAC datasets may be registered with the engine by setting their TADAdaptedDataSet.LocalSQL properties. FireDAC and Non-FireDAC datasets may be registered with the engine using TADCustomLocalSQL.DataSets property.

Syntax
TADCustomLocalSQL = class(TADComponent, IADPhysSQLHandler);
See Also

Local SQL, TADLocalSQL

Example
ADConnection1.DriverName := 'SQLite';

with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADOQuery1;
  Name := 'Orders';
end;
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADOQuery2;
  Name := 'Order Details';
end;
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADMemTable1;
  Name := 'Customers';
end;
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADMemTable2;
  Name := 'Vendors';
end;
ADLocalSQL1.Connection := ADConnection1;
ADLocalSQL1.Active := True;

ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select from Orders o left join "Order Details" od on o.OrderID = od.OrderID');
What do you think about this topic? Send feedback!


TADCustomLocalSQL Members

TADCustomLocalSQL Members
Events TADCustomLocalSQL Class Legend Properties Send Feedback

The following tables list the members exposed by TADCustomLocalSQL.

Events
Event | Description
OnGetDataSet | The event firing when Local SQL engine looks for a dataset object.
OnReadDataSet | The event firing when Local SQL is going to read a dataset object.
Class

TADCustomLocalSQL Class

Properties
Property | Description
Active | Activates Local SQL engine.
Connection | Specifies the FireDAC connection component to use.
DataSets | Collection of the registered datasets.
Links
Events, TADCustomLocalSQL Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
Events TADCustomLocalSQL Class Legend Properties Send Feedback

The public members of the TADCustomLocalSQL class are listed here.

Events
Event | Description
OnGetDataSet | The event firing when Local SQL engine looks for a dataset object.
OnReadDataSet | The event firing when Local SQL is going to read a dataset object.
Class

TADCustomLocalSQL Class

Properties
Property | Description
Active | Activates Local SQL engine.
Connection | Specifies the FireDAC connection component to use.
DataSets | Collection of the registered datasets.
Links
Events, TADCustomLocalSQL Class, Legend, Properties
What do you think about this topic? Send feedback!


TADCustomLocalSQL.Active Property

TADCustomLocalSQL.Active Property
TADCustomLocalSQL Class TADCustomLocalSQL Members uADCompClient Namespace public See Also Send Feedback

Activates Local SQL engine.

Group

public

Links
TADCustomLocalSQL Class, TADCustomLocalSQL Members, uADCompClient Namespace, public, See Also
Description

Set Active property to True to activate Local SQL engine and add registered datasets to Local SQL namespace. Set Active to False to remove datasets from Local SQL namespace and deactivate Local SQL engine. Local SQL queries may be performed only when Active is True and connection is active too.

When application needs to perform massive Local SQL configuration tasks, like to add a set of datasets, remove set of datasets, etc, then it is recommended first set Active to False. And when a task is finished set Active to True.

Active may be set to False only when there is no active / prepared SQL commands using this Local SQL.

Syntax
property Active: Boolean;
See Also

Local SQL, Connection

What do you think about this topic? Send feedback!


TADCustomLocalSQL.Connection Property

TADCustomLocalSQL.Connection Property
TADCustomLocalSQL Class TADCustomLocalSQL Members uADCompClient Namespace public See Also Send Feedback

Specifies the FireDAC connection component to use.

Group

public

Links
TADCustomLocalSQL Class, TADCustomLocalSQL Members, uADCompClient Namespace, public, See Also
Description

Use Connection to specify an FireDAC connection connected to a SQLite database. This connection will be used to publish registered datasets and execute Local SQL commands.

Syntax
property Connection: TADCustomConnection;
See Also

Local SQL, Active

What do you think about this topic? Send feedback!


TADCustomLocalSQL.DataSets Property

TADCustomLocalSQL.DataSets Property
TADCustomLocalSQL Class TADCustomLocalSQL Members uADCompClient Namespace Example public See Also Send Feedback

Collection of the registered datasets.

Group

public

Links
TADCustomLocalSQL Class, TADCustomLocalSQL Members, uADCompClient Namespace, Example, public, See Also
Description

Use DataSets collection property to manage the datasets registered with this Local SQL engine.

FireDAC datasets may be added to the collection implicitly by setting TADAdaptedDataSet.LocalSQL property. Non-FireDAC and FireDAC datasets may be added explicitly by adding new items to DataSets collection. To remove a dataset from the list of registered datasets, remove corresponding item from the DataSets collection. The datasets may be added or removed as at design time, as at run time.

All datasets in collection must have unique names. When item Name property is specified, then it is used as a dataset name. If not specified, then TDataSet.Name value will be used.

Syntax
property DataSets: TADLocalSQLDataSets;
See Also

Local SQL, TADAdaptedDataSet.LocalSQL, TADLocalSQLDataSets, TADLocalSQLDataSet

Example
ADLocalSQL1.DataSets.Add.DataSet := ADOQuery1;
ADLocalSQL1.DataSets.Add.DataSet := ADOQuery2;
ADQuery1.LocalSQL := ADLocalSQL1;
ADQuery2.LocalSQL := ADLocalSQL1;
What do you think about this topic? Send feedback!


TADCustomLocalSQL.OnGetDataSet Event

TADCustomLocalSQL.OnGetDataSet Event
TADCustomLocalSQL Class TADCustomLocalSQL Members uADCompClient Namespace public See Also Send Feedback

The event firing when Local SQL engine looks for a dataset object.

Group

public

Links
TADCustomLocalSQL Class, TADCustomLocalSQL Members, uADCompClient Namespace, public, See Also
Description

Use OnGetDataSet event handler to submit a dataset object by its name.

This event may be used to provide a dataset dynamically without registering it first with the Local SQL engine. The value of AName argument and ADataSet.Name may be different. After returning a dataset, it will be registered in DataSets collection under AName argument value.

The event handler must return ADataSet, AAdapter or both arguments assigned. For FireDAC datasets the ADataSet may be assigned only. For non-FireDAC datasets is recommended to assign both arguments.

Syntax
property OnGetDataSet: TADGetDatasetEvent;
See Also

Local SQL, DataSets, OnReadDataSet

What do you think about this topic? Send feedback!


TADCustomLocalSQL.OnReadDataSet Event

TADCustomLocalSQL.OnReadDataSet Event
TADCustomLocalSQL Class TADCustomLocalSQL Members uADCompClient Namespace public See Also Send Feedback

The event firing when Local SQL is going to read a dataset object.

Group

public

Links
TADCustomLocalSQL Class, TADCustomLocalSQL Members, uADCompClient Namespace, public, See Also
Description

Use OnReadDataSet event handler to setup a dataset object before it will be read.

This event may be used to set parameter or macro values. Or even to change the SQL command text. If a dataset is inactive, then Local SQL will activate it right after the event handler call.

Syntax
property OnReadDataSet: TADReadDatasetEvent;
See Also

Local SQL, OnGetDataSet

What do you think about this topic? Send feedback!


TADCustomManager Class

TADCustomManager Class
public TADCustomManager Members Classes See Also Send Feedback

The class is responsible to connection definitions and connections management.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomManager
File

uADCompClient

Links
public, TADCustomManager Members, Classes, See Also
Description

Use TADCustomManager to manage connection definitions and connection objects.

Consider accessing the singleton instance of TADManager via ADManager function instead of its explicit creating.

This class hides some of properties, allowing to control visibility of properties by descendant classes. End users should use TADManager.

Syntax
TADCustomManager = class(TADComponent, IUnknown, IADStanOptions, IADStanObject);
See Also

TADManager, ADManager, IADPhysManager

What do you think about this topic? Send feedback!


TADCustomManager Members

TADCustomManager Members
Events TADCustomManager Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomManager.

Events
Event | Description
AfterLoadConnectionDefFile | Fires after connection definitions file is loaded.
AfterShutdown | Fires after manager is finished.
AfterStartup | Fires after manager is started.
BeforeLoadConnectionDefFile | Fires before connection definitions file is loaded.
BeforeShutdown | Fires before manager will be finished.
BeforeStartup | Fires before manager will be started.
Class

TADCustomManager Class

Methods
Method | Description
AddConnectionDef | Adds private connection definition.
Close | Terminates FireDAC manager.
CloseConnectionDef | Closes all connections for a specified connection definition name.
DeleteConnectionDef | Deletes connection definition.
DropConnections | Closes all unused connections.
FindConnection | Find the TADCustomConnection instance with ConnectionName equal to AConnectionName.
GetBaseDriverID | Returns ID of a base driver for the specified driver ID.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetConnectionDefNames | Fills the list by existing connection definition names.
GetConnectionDefParams | Fills the list by connection definition parameters.
GetConnectionNames | Fills the list by connection names.
GetDriverNames | Fills the list by registered driver ID's.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetRDBMSKind | Returns a DBMS kind for the specified driver ID.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
IsConnectionDef | Check if name is connection definition name.
LoadConnectionDefFile | Loads connection definitions file.
ModifyConnectionDef | Modifies parameters of an existing connection definition.
Open | Activates FireDAC manager.
RefreshConnectionDefFile | Refreshes connection definition list.
RefreshMetadataCache | Invalidates meta data cache for all connections.
SaveConnectionDefFile | Saves connection definitions into a file.
Properties
Property | Description
Active | Gets or sets FireDAC manager active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
ActualConnectionDefFileName | Returns expanded connection definition file name.
ActualDriverDefFileName | Returns expanded driver definition file name.
AutoCreated | Is manager object auto created.
CanRefreshConnectionDefFile | Checks if connection definition list may be refreshed.
ConnectionCount | The number of connection objects.
ConnectionDefFileAutoLoad | Controls how connection definitions file must be loaded.
ConnectionDefFileLoaded | Checks is loaded the connection definitions file.
ConnectionDefFileName | Gets / sets the name of a connection definitions file.
ConnectionDefs | The list of connection definitions.
Connections | The application connection objects.
DriverDefFileAutoLoad | Controls how driver definitions file must be loaded.
DriverDefFileName | Gets / sets the name of a driver definitions file.
DriverDefs | The list of driver definitions.
FetchOptions | The "root" fetch options.
FormatOptions | The "root" data format options.
ResourceOptions | The "root" resources control options.
SilentMode | Gets or sets FireDAC global "silent" flag.
State | Returns the current state of FireDAC manager.
UpdateOptions | The "root" data updating options.
WaitCursor | Gets or sets FireDAC wait cursor shape.
Links
Events, TADCustomManager Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
Events TADCustomManager Class Legend Methods Properties Send Feedback

The public members of the TADCustomManager class are listed here.

Events
Event | Description
AfterLoadConnectionDefFile | Fires after connection definitions file is loaded.
AfterShutdown | Fires after manager is finished.
AfterStartup | Fires after manager is started.
BeforeLoadConnectionDefFile | Fires before connection definitions file is loaded.
BeforeShutdown | Fires before manager will be finished.
BeforeStartup | Fires before manager will be started.
Class

TADCustomManager Class

Methods
Method | Description
AddConnectionDef | Adds private connection definition.
Close | Terminates FireDAC manager.
CloseConnectionDef | Closes all connections for a specified connection definition name.
DeleteConnectionDef | Deletes connection definition.
DropConnections | Closes all unused connections.
FindConnection | Find the TADCustomConnection instance with ConnectionName equal to AConnectionName.
GetBaseDriverID | Returns ID of a base driver for the specified driver ID.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetConnectionDefNames | Fills the list by existing connection definition names.
GetConnectionDefParams | Fills the list by connection definition parameters.
GetConnectionNames | Fills the list by connection names.
GetDriverNames | Fills the list by registered driver ID's.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetRDBMSKind | Returns a DBMS kind for the specified driver ID.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
IsConnectionDef | Check if name is connection definition name.
LoadConnectionDefFile | Loads connection definitions file.
ModifyConnectionDef | Modifies parameters of an existing connection definition.
Open | Activates FireDAC manager.
RefreshConnectionDefFile | Refreshes connection definition list.
RefreshMetadataCache | Invalidates meta data cache for all connections.
SaveConnectionDefFile | Saves connection definitions into a file.
Properties
Property | Description
Active | Gets or sets FireDAC manager active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
ActualConnectionDefFileName | Returns expanded connection definition file name.
ActualDriverDefFileName | Returns expanded driver definition file name.
AutoCreated | Is manager object auto created.
CanRefreshConnectionDefFile | Checks if connection definition list may be refreshed.
ConnectionCount | The number of connection objects.
ConnectionDefFileAutoLoad | Controls how connection definitions file must be loaded.
ConnectionDefFileLoaded | Checks is loaded the connection definitions file.
ConnectionDefFileName | Gets / sets the name of a connection definitions file.
ConnectionDefs | The list of connection definitions.
Connections | The application connection objects.
DriverDefFileAutoLoad | Controls how driver definitions file must be loaded.
DriverDefFileName | Gets / sets the name of a driver definitions file.
DriverDefs | The list of driver definitions.
FetchOptions | The "root" fetch options.
FormatOptions | The "root" data format options.
ResourceOptions | The "root" resources control options.
SilentMode | Gets or sets FireDAC global "silent" flag.
State | Returns the current state of FireDAC manager.
UpdateOptions | The "root" data updating options.
WaitCursor | Gets or sets FireDAC wait cursor shape.
Links
Events, TADCustomManager Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomManager.Active Property

TADCustomManager.Active Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Gets or sets FireDAC manager active status.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

Set Active to True to activate FireDAC manager. After that the State = dmsActive. At activating, ADPhysManager loads driver definition file. When required set DriverDefFileAutoLoad and DriverDefFileName before activating manager. TADCustomConnection automatically activates manager before a first connection.

Set Active to False to terminate FireDAC manager. After that the State = dmsInactive. At terminating, manager:

  • calls TADCustomConnection.Close for all connection objects in application;
  • ADPhysManager waits until all connections interfaces (IADPhysConnection) will be released;
  • unloads DBMS client DLL's and releases internal driver structures.

Note, to change any driver settings, manager may be active or inactive, but there must be no connections through this driver.

We strongly recommend to not close FireDAC manager from within OnLosted, OnRestored, and OnRecover events of TADConnection component, as that can lead to unexpected problems.

A multi-threading application should activate FireDAC manager before threads, which are connecting to a DB, will start.

Syntax
property Active: Boolean;
See Also

DriverDefFileAutoLoad, DriverDefFileName, Open, Close

What do you think about this topic? Send feedback!


TADCustomManager.ActiveStoredUsage Property

TADCustomManager.ActiveStoredUsage Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public Send Feedback

Controls how to use Active property value saved to DFM.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
What do you think about this topic? Send feedback!


TADCustomManager.ActualConnectionDefFileName Property

TADCustomManager.ActualConnectionDefFileName Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Returns expanded connection definition file name.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

If a connection definition file path is a relative one or contains template markers, then it will be expanded into full path. Use ActualConnectionDefFileName to get the expanded value.

To assign connection definition file path use ConnectionDefFileName property.

Syntax
property ActualConnectionDefFileName: String;
See Also

ConnectionDefFileName

What do you think about this topic? Send feedback!


TADCustomManager.ActualDriverDefFileName Property

TADCustomManager.ActualDriverDefFileName Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Returns expanded driver definition file name.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

If a driver definition file path is a relative one or contains template markers, then it will be expanded into full path. Use ActualDriverDefFileName to get the expanded value.

To assign driver definition file path use DriverDefFileName property.

Syntax
property ActualDriverDefFileName: String;
See Also

DriverDefFileName

What do you think about this topic? Send feedback!


TADCustomManager.AfterLoadConnectionDefFile Event

TADCustomManager.AfterLoadConnectionDefFile Event
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Fires after connection definitions file is loaded.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The AfterLoadConnectionDefFile event is fired after the connection definitions file is loaded.

Syntax
property AfterLoadConnectionDefFile: TNotifyEvent;
See Also

BeforeLoadConnectionDefFile

What do you think about this topic? Send feedback!


TADCustomManager.AfterShutdown Event

TADCustomManager.AfterShutdown Event
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Fires after manager is finished.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The AfterShutdown event is fired after FireDAC manager is terminated.

Syntax
property AfterShutdown: TNotifyEvent;
See Also

Active, Close, BeforeShutdown

What do you think about this topic? Send feedback!


TADCustomManager.AfterStartup Event

TADCustomManager.AfterStartup Event
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Fires after manager is started.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The AfterStartup event is fired after FireDAC manager is started.

Syntax
property AfterStartup: TNotifyEvent;
See Also

Active, Open, BeforeStartup

What do you think about this topic? Send feedback!


TADCustomManager.AutoCreated Property

TADCustomManager.AutoCreated Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public Send Feedback

Is manager object auto created.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public
Description

Returns True, if manager object is created internally by FireDAC.

Syntax
property AutoCreated: Boolean;
What do you think about this topic? Send feedback!


TADCustomManager.BeforeLoadConnectionDefFile Event

TADCustomManager.BeforeLoadConnectionDefFile Event
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Fires before connection definitions file is loaded.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The BeforeLoadConnectionDefFile event is fired before the connection definitions file is loaded.

Syntax
property BeforeLoadConnectionDefFile: TNotifyEvent;
See Also

AfterLoadConnectionDefFile

What do you think about this topic? Send feedback!


TADCustomManager.BeforeShutdown Event

TADCustomManager.BeforeShutdown Event
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Fires before manager will be finished.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The BeforeShutdown event is fired before FireDAC manager will be terminated.

Note, multi-threaded application may close connections opened in the background threads in a BeforeShutdown event handler to avoid possible dead lock.

Syntax
property BeforeShutdown: TNotifyEvent;
See Also

Multi Threading, Active, Close, AfterShutdown

What do you think about this topic? Send feedback!


TADCustomManager.BeforeStartup Event

TADCustomManager.BeforeStartup Event
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Fires before manager will be started.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The BeforeStartup event is fired before FireDAC manager will be started.

Note, application cannot open a connection in a BeforeStartup event handler, as that will lead to the endless recursion.

Syntax
property BeforeStartup: TNotifyEvent;
See Also

Active, Open, AfterStartup

What do you think about this topic? Send feedback!


TADCustomManager.CanRefreshConnectionDefFile Property

TADCustomManager.CanRefreshConnectionDefFile Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Checks if connection definition list may be refreshed.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Description

The CanRefreshConnectionDefFile property returns True, if not one active connection is associated with any of connection definitions in the ConnectionDefs list. In this case ConnectionDefs may be erased or refreshed.

Syntax
property CanRefreshConnectionDefFile: Boolean;
See Also

ConnectionDefs

Example
// reload connection definition list
if ADManager.CanRefreshConnectionDefFile then begin
  ADManager.ConnectionDefs.Clear;
  ADManager.ConnectionDefs.Load;
end;
What do you think about this topic? Send feedback!


TADCustomManager.ConnectionCount Property

TADCustomManager.ConnectionCount Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

The number of connection objects.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Description

The ConnectionCount property returns the number of existing TADCustomConnection objects in the application.

Syntax
property ConnectionCount: Integer;
See Also

TADCustomConnection, Connections

Example
// perform some task for all application connection objects
for i := 0 to ADManager.ConnectionCount - 1 do
  ADManager.Connections[i].Ping;
What do you think about this topic? Send feedback!


TADCustomManager.ConnectionDefFileAutoLoad Property

TADCustomManager.ConnectionDefFileAutoLoad Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Controls how connection definitions file must be loaded.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The ConnectionDefFileAutoLoad property controls, should be a connection definition file loaded automatically or explicitly by programmer. If True, then FireDAC will load file at first "touch" to the content of the ConnectionDefs list.

If False, then programmer should call ConnectionDefs.Load method before first "touch" to the ConnectionDefs list, including:

  • opening a connection referencing to a connection definition by its name (see TADCustomConnection.ConnectionDefName);
  • iterating through existing connection definitions (see TADCustomManager.ConnectionDefs);
  • adding new connection definition, deleting existing connection definition or looking for existing connection definition (see TADCustomManager.ConnectionDefs);

Otherwise an exception will be raised.

Syntax
property ConnectionDefFileAutoLoad: Boolean;
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileLoaded, ConnectionDefFileName, LoadConnectionDefFile

What do you think about this topic? Send feedback!


TADCustomManager.ConnectionDefFileLoaded Property

TADCustomManager.ConnectionDefFileLoaded Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Checks is loaded the connection definitions file.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The ConnectionDefFileLoaded property returns True, if connection definitions file is loaded and it content is accessible through the ConnectionDefs list.

Syntax
property ConnectionDefFileLoaded: Boolean;
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileautoLoad, ConnectionDefFileName

What do you think about this topic? Send feedback!


TADCustomManager.ConnectionDefFileName Property

TADCustomManager.ConnectionDefFileName Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Gets / sets the name of a connection definitions file.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

The ConnectionDefFileName property allows to get or set the name of a connection definition file.

The application can set the name before connection definitions file will be loaded. For example in BeforeLoadConnectionDefFile event handler.

If a path is a relative one or contains template markers, then it will be expanded into full path. Use ActualConnectionDefFileName to get the expanded value.

Syntax
property ConnectionDefFileName: String;
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileAutoLoad, ConnectionDefFileLoaded, ActualConnectionDefFileName

Example 1
ADManager.ConnectionDefFileName := ExtractFilePath(Application.ExeName) + 'myconndef.ini';
ADManager.ConnectionDefFileAutoLoad := True;
oConn := TADConnection.Create(nil);
oConn.ConnectionDefName := 'myconn';
oConn.Connected := True;
Example 2
procedure TMyDataModule.DoBeforeLoad(ASender: TNotifyEvent);
begin
  ADManager.ConnectionDefFileName := FSettings.MyConnectionDefFile;
end;
...
ADManager.BeforeLoadConnectionDefFile := DoBeforeLoad;
What do you think about this topic? Send feedback!


TADCustomManager.ConnectionDefs Property

TADCustomManager.ConnectionDefs Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example 1 Example 2 Example 3 public See Also Send Feedback

The list of connection definitions.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example 1, Example 2, Example 3, public, See Also
Description

The ConnectionDefs property returns the list of connection definitions loaded from connection definitions file, if it exists. The list may be manipulated directly, including adding, changing or deleting of connection definitions.

Syntax
property ConnectionDefs: IADStanConnectionDefs;
See Also

Defining Connection, ConnectionDefFileName, ConnectionDefFileAutoLoad, ConnectionDefFileLoaded

Example 1
var
  oDef: IADStanConnectionDef;
...
// find the connection definition, change it properties and save it to file
oDef := ADManager.ConnectionDefs.ConnectionDefByName('MyDef');
oDef.Server := '127.0.0.1';
oDef.Apply;
Example 2
var
  oDef: IADStanConnectionDef;
...
// add new connection definition and save it to file
oDef := ADManager.ConnectionDefs.AddConnectionDef;
oDef.Name := 'MyDef';
oDef.Server := '127.0.0.1';
oDef.UserName := 'dba';
// use new connection definition
ADConnection1.ConnectionDefName := 'MyDef';
Example 3

See FireDAC\Samples\Comp Layer\TADConnection\ConnectionDefs sample for details of how to work with ConnectionDefs.

What do you think about this topic? Send feedback!


TADCustomManager.Connections Property

TADCustomManager.Connections Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

The application connection objects.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Description

The Connections property gives access by index to the list of application connection objects.

Syntax
property Connections [Index: Integer]: TADCustomConnection;
See Also

TADCustomConnection, ConnectionCount

Example
// perform some task for all application connection objects
for i := 0 to ADManager.ConnectionCount - 1 do
  ADManager.Connections[i].Ping;
What do you think about this topic? Send feedback!


TADCustomManager.DriverDefFileAutoLoad Property

TADCustomManager.DriverDefFileAutoLoad Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Controls how driver definitions file must be loaded.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The DriverDefFileAutoLoad property controls, should the driver definition file be loaded automatically or explicitly by programmer. When True, then FireDAC will load file at manager activation. When False, then programmer should call ADPhysManager.DriverDefs.Load method before manager activation. Otherwise an exception will be raised.

Syntax
property DriverDefFileAutoLoad: Boolean;
See Also

Configuring Drivers, DriverDefFileName

What do you think about this topic? Send feedback!


TADCustomManager.DriverDefFileName Property

TADCustomManager.DriverDefFileName Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Gets / sets the name of a driver definitions file.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The DriverDefFileName property allows to get or set the name of a driver definition file. The application can set the name before manager activation.

The application can set the name before driver definitions file will be loaded.

If a path is a relative one or contains template markers, then it will be expanded into full path. Use ActualDriverDefFileName to get the expanded value.

Syntax
property DriverDefFileName: String;
See Also

Configuring Drivers, DriverDefFileAutoLoad, ActualDriverDefFileName

What do you think about this topic? Send feedback!


TADCustomManager.DriverDefs Property

TADCustomManager.DriverDefs Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

The list of driver definitions.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Description

The DriverDefs property returns the list of driver definitions loaded from driver definitions file, if it exists. The list may be manipulated directly, including adding, changing or deleting of driver definitions.

Syntax
property DriverDefs: IADStanDefinitions;
See Also

Configuring Drivers, DriverDefFileName, DriverDefFileAutoLoad

Example
var
  oDef: IADStanDefinition;
...
// add new virtual driver definition
oDef := ADManager.DriverDefs.Add;
oDef.Name := 'Firebird250';
oDef.AsStirngs['VendorLib'] := 'c:\Firebird250\Bin\fbclient.dll';

ADConnection1.Params.Clear;
ADConnection1.Params.Add('DriverID=Firebird250');
ADConnection1.Params.Add('Server=127.0.0.1');
....
ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADCustomManager.FetchOptions Property

TADCustomManager.FetchOptions Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

The "root" fetch options.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The FetchOptions property returns the reference to the "root" instance of the fetch options. These options control how the data will be fetched and cached in the memory.

The option values will be inherited by all TADCustomConnection's and, consequently, by all TADCustomCommand's and all datasets in application.

See Setting Options for review of how to work with options.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, FormatOptions, UpdateOptions, ResourceOptions

What do you think about this topic? Send feedback!


TADCustomManager.FormatOptions Property

TADCustomManager.FormatOptions Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

The "root" data format options.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The FormatOptions property returns the reference to the "root" instance of the data format options. These options control how the DBMS data types will be mapped into dataset data types.

The option values will be inherited by all TADCustomConnection's and, consequently, by all TADCustomCommand's and all datasets in application.

See Setting Options for review of how to work with options.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, FetchOptions, UpdateOptions, ResourceOptions

What do you think about this topic? Send feedback!


TADCustomManager.ResourceOptions Property

TADCustomManager.ResourceOptions Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

The "root" resources control options.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The ResourceOptions property returns the reference to the "root" instance of the resources control options. These options control how FireDAC should use DBMS and workstation resources.

The option values will be inherited by all TADCustomConnection's and, consequently, by all TADCustomCommand's and all datasets in application.

See Setting Options for review of how to work with options.

Syntax
property ResourceOptions: TADTopResourceOptions;
See Also

Setting Options, FetchOptions, UpdateOptions, FormatOptions

What do you think about this topic? Send feedback!


TADCustomManager.SilentMode Property

TADCustomManager.SilentMode Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Gets or sets FireDAC global "silent" flag.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

Set SilentMode to True to disable wait cursors and dialogs. This flag is application wide. Its value overrides all TADResourceOptions.SilentMode values.

Syntax
property SilentMode: Boolean;
See Also

TADResourceOptions.SilentMode, WaitCursor

What do you think about this topic? Send feedback!


TADCustomManager.State Property

TADCustomManager.State Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Returns the current state of FireDAC manager.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The State property returns the current state of FireDAC manager.

Syntax
property State: TADPhysManagerState;
See Also

Active

What do you think about this topic? Send feedback!


TADCustomManager.UpdateOptions Property

TADCustomManager.UpdateOptions Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

The "root" data updating options.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The UpdateOptions property returns the reference to the "root" instance of the data updating options. These options control how FireDAC should post data changes back to a DB.

The option values will be inherited by all TADCustomConnection's and, consequently, by all TADCustomTableAdapter's and all datasets in application.

See Setting Options for review of how to work with options.

Syntax
property UpdateOptions: TADUpdateOptions;
See Also

Setting Options, FetchOptions, ResourceOptions, FormatOptions

What do you think about this topic? Send feedback!


TADCustomManager.WaitCursor Property

TADCustomManager.WaitCursor Property
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Gets or sets FireDAC wait cursor shape.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The WaitCursor property gets or sets the wait cursor shape.

Syntax
property WaitCursor: TADGUIxScreenCursor;
See Also

SilentMode

What do you think about this topic? Send feedback!


TADCustomManager.AddConnectionDef Method

TADCustomManager.AddConnectionDef Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Adds private connection definition.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AName: string | A connection definition name.
const ADriver: string | A driver ID.
AList: TStrings | A list of parameter name=value pairs.
APersistent: Boolean = False | A persistence flag. By default is False.
Description

The AddConnectionDef method adds new private or persistent connection definition to the ConnectionDefs list.

The connection definition will get name AName, DriverID ADriver and parameters AList. The name must be unique across other connection definitions in the ConnectionDefs list, otherwise exception will be raised.

Set APersistent to True, to mark connection definition as persistent, otherwise it will be private one. After the call a persistent connection definition is not stored to a file. Call SaveConnectionDefFile to save this and other changes to a file. Not stored connection definitions will be discarded after FireDAC manager or application will be terminated.

After connection definition is added, it may be referenced by TADCustomConnection.ConnectionDefName.

Syntax
procedure AddConnectionDef(const AName: string; const ADriver: string; AList: TStrings; APersistent: Boolean = False);
See Also

Defining Connection, ConnectionDefs, SaveConnectionDefFile, DeleteConnectionDef, ModifyConnectionDef, IADStanConnectionDefs.AddConnectionDef, TADCustomConnection.ConnectionDefName

Example
var
  oList: TStringList;
......
  oList := TStringList.Create;
  oList.Add('Server=127.0.0.1');
  oList.Add('Database=addemo');
  ADManager.AddConnectionDef('myconn', 'MySQL', oList);
......
  ADConnection1.ConnectionDefName := 'myconn';
  ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADCustomManager.Close Method

TADCustomManager.Close Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Terminates FireDAC manager.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The Close method terminates manager, by setting Active to False.

Syntax
procedure Close;
See Also

Open, Active, CloseConnectionDef

What do you think about this topic? Send feedback!


TADCustomManager.CloseConnectionDef Method

TADCustomManager.CloseConnectionDef Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Closes all connections for a specified connection definition name.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const AName: string | A connection definition name.
Description

Use CloseConnectionDef method to close all connections opened using specified connection definition and to close all pooled connection for this connection definition. After CloseConnectionDef call the application may modify the connection definition parameters.

CloseConnectionDef forcibly closes all opened connections and waits until all of them will be closed. If a connection is kept by other thread and cannot be closed (eg Abort in BeforeDisconnect), then CloseConnectionDef will hang up.

If none connections were made for the connection definition or even connection definition does not exist, then no actions will be taken.

Syntax
procedure CloseConnectionDef(const AName: string);
See Also

Close

What do you think about this topic? Send feedback!


TADCustomManager.DeleteConnectionDef Method

TADCustomManager.DeleteConnectionDef Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Deletes connection definition.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AName: string | A connection definition name.
Description

The DeleteConnectionDef method deletes connection definition by its name from the ConnectionDefs list. If specified name is not found, then exception will be raised.

After the call a persistent connection definition is not deleted from a file. Call SaveConnectionDefFile to delete it and save other changes to a file.

Syntax
procedure DeleteConnectionDef(const AName: string);
See Also

Defining Connection, ConnectionDefs, SaveConnectionDefFile, AddConnectionDef, IADStanDefinition.Delete

Example
  ADManager.DeleteConnectionDef('myconn');
What do you think about this topic? Send feedback!


TADCustomManager.DropConnections Method

TADCustomManager.DropConnections Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Closes all unused connections.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

Call DropConnection method to close all unused connections and delete temporary ones. The connection is not used if it RefCount is equal to 0.

Syntax
procedure DropConnections;
See Also

TADCustomConnection.RefCount, TADCustomConnection.Temporary, Connections, ConnectionCount

What do you think about this topic? Send feedback!


TADCustomManager.FindConnection Method

TADCustomManager.FindConnection Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Find the TADCustomConnection instance with ConnectionName equal to AConnectionName.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const AConnectionName: string | The connection name
Returns

An TADCustomConnection instance, if found. Nil - otherwise.

Description

The FindConnection method finds the TADCustomConnection instance with ConnectionName equal to AConnectionName.

Syntax
function FindConnection(const AConnectionName: string): TADCustomConnection;
See Also

GetConnectionNames, TADCustomConnection.ConnectionName, TADCustomCommand.ConnectionName, TADRdbmsDataSet.ConnectionName

What do you think about this topic? Send feedback!


TADCustomManager.GetBaseDriverID Method

TADCustomManager.GetBaseDriverID Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public Send Feedback

Returns ID of a base driver for the specified driver ID.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public
Parameters
Parameters | Description
const ADriverID: String | A driver ID.
Description

Use GetBaseDriverID to get a base driver ID for the specified driver ID. Where the specified driver ID may be base or virtual driver ID's.

Syntax
function GetBaseDriverID(const ADriverID: String): String;
Example
var
  sBaseID: String;
......
  sBaseID := ADManager.GetBaseDriverID('MSSQLExpress');
  if SameText(sBaseID, S_AD_MSSQLId) then
    ShowMessage('It is a MSSQL base driver');
What do you think about this topic? Send feedback!


TADCustomManager.GetCatalogNames Method

TADCustomManager.GetCatalogNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of catalogs in a DB.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionName: string | A connection name.
const APattern: string | A LIKE pattern.
AList: TStrings | A list to fill.
Description

Call GetCatalogNames to retrieve a list of catalogs in a DB.

AConnectionName is the connection name to use.

APattern is the LIKE-pattern filtering catalog names.

AList is a TStrings descendant that receives the catalog names. Any existing strings are deleted from the list before GetCatalogNames adds the names of all the catalogs in a DB.

Syntax
procedure GetCatalogNames(const AConnectionName: string; const APattern: string; AList: TStrings);
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetCatalogNames

Example
ADManager.GetCatalogNames('myconn', '', ListBox1.Items);
What do you think about this topic? Send feedback!


TADCustomManager.GetConnectionDefNames Method

TADCustomManager.GetConnectionDefNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Fills the list by existing connection definition names.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
AList: TStrings | A list to fill.
Description

The GetConnectionDefNames method fills an AList list by the names of connection definitions in the ConnectionDefs list. A list will be sorted alphabetically.

Syntax
procedure GetConnectionDefNames(AList: TStrings);
See Also

IADStanDefinition.Name

Example 1
ADManager.GetConnectionDefNames(ListBox1.Items);
Example 2

See FireDAC\Samples\Comp Layer\TADConnection\ConnectionDefs sample.

What do you think about this topic? Send feedback!


TADCustomManager.GetConnectionDefParams Method

TADCustomManager.GetConnectionDefParams Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Fills the list by connection definition parameters.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AName: string | A connection definition name.
AList: TStrings | A list to fill.
Description

The GetConnectionDefParams method fills an AList list by the name=value pairs of AName connection definition in the ConnectionDefs list.

Syntax
procedure GetConnectionDefParams(const AName: string; AList: TStrings);
See Also

IADStanDefinition.Params

Example
ADManager.GetConnectionDefParams('myconn', ListBox1.Items);
What do you think about this topic? Send feedback!


TADCustomManager.GetConnectionNames Method

TADCustomManager.GetConnectionNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Fills the list by connection names.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
AList: TStrings | A list to fill.
Description

The GetConnectionNames method fills an AList list by the connection names. A list will be sorted alphabetically.

Syntax
procedure GetConnectionNames(AList: TStrings);
See Also

FindConnection, TADCustomConnection.ConnectionName, TADCustomCommand.ConnectionName, TADRdbmsDataSet.ConnectionName

What do you think about this topic? Send feedback!


TADCustomManager.GetDriverNames Method

TADCustomManager.GetDriverNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Fills the list by registered driver ID's.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
AList: TStrings | A list to fill.
AValidate: Boolean = False | Check that some driver and a DBMS CLI library are really accessible. Default is False.
ABaseOnly: Boolean = False | Include only FireDAC base driver ID's. Default is False.
Description

The GetDriverNames method fills an AList list by the registered driver ID's. A list will be sorted alphabetically.

Syntax
procedure GetDriverNames(AList: TStrings; AValidate: Boolean = False; ABaseOnly: Boolean = False);
See Also

Querying Metadata, IADStanConnectionDef.DriverID

Example
ADManager.GetDriverNames(ListBox1.Items);
What do you think about this topic? Send feedback!


TADCustomManager.GetFieldNames Method

TADCustomManager.GetFieldNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of fields in a table.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionName: string | A connection name.
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const ATableName: string | A table name.
const APattern: string | A LIKE patten.
AList: TStrings | A list to fill.
Description

Call GetFieldNames to retrieve a list of fields in a table.

AConnectionName is the connection name to use.

ACatalogName, ASchemaName, ATableName names the table whose field names you want added to the list.

APattern is the LIKE-pattern filtering field names.

AList is a TStrings descendant that receives the field names. Any existing strings are deleted from the list before GetFieldNames adds the names of all the fields in ATableName.

The field names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case.

Syntax
procedure GetFieldNames(const AConnectionName: string; const ACatalogName: string; const ASchemaName: string; const ATableName: string; const APattern: string; AList: TStrings);
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetFieldNames

Example
ADManager.GetFieldNames('myconn', '', '', 'MYTAB', '', ListBox1.Items);
What do you think about this topic? Send feedback!


TADCustomManager.GetGeneratorNames Method

TADCustomManager.GetGeneratorNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of generators / sequences / <how else> in a database.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionName: string | A connection name.
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const APattern: string | A LIKE pattern.
AList: TStrings | A list to fill.
AScopes: TADPhysObjectScopes = [osMy] | A object scopes.
Description

Call GetGeneratorNames to retrieve a list of generators / sequences / <how else> in a database.

AConnectionName is the connection name to use.

ACatalogName and ASchemaName restrict generator names to the catalog and schema.

APattern is the LIKE-pattern filtering generator names.

AList is a TStrings descendant that receives the generator names. Any existing strings are deleted from the list before GetFieldNames adds the names of generators.

AScopes restricts generator names to the specified scopes.

The generator names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case. Specify the MetaDefSchema and/or MetaDefCatalog parameters in connection definition, to avoid these schema and/or catalog names in generator names.

Syntax
procedure GetGeneratorNames(const AConnectionName: string; const ACatalogName: string; const ASchemaName: string; const APattern: string; AList: TStrings; AScopes: TADPhysObjectScopes = [osMy]; AFullName: Boolean = True);
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetGeneratorNames

Example
ADManager.GetGeneratorNames('myconn', '', '', 'MY%', ListBox1.Items, [osMy, osSystem]);
What do you think about this topic? Send feedback!


TADCustomManager.GetKeyFieldNames Method

TADCustomManager.GetKeyFieldNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of key fields in a table.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionName: string | A connection name.
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const ATableName: string | A table name.
const APattern: string | A LIKE pattern.
AList: TStrings | A list to fill.
Description

Call GetKeyFieldNames to retrieve a list of primary key fields in a table.

AConnectionName is the connection name to use.

ACatalogName, ASchemaName, ATableName names the table whose primary field names you want added to the list.

APattern is the LIKE-pattern filtering field names.

AList is a TStrings descendant that receives the primary key field names. Any existing strings are deleted from the list before GetKeyFieldNames adds the names of the primary key fields in ATableName.

The field names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case.

Syntax
procedure GetKeyFieldNames(const AConnectionName: string; const ACatalogName: string; const ASchemaName: string; const ATableName: string; const APattern: string; AList: TStrings);
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetKeyFieldNames

Example
ADManager.GetKeyFieldNames('myconn', 'NORTHWIND', 'DBO', 'MYTAB', '', ListBox1.Items);
What do you think about this topic? Send feedback!


TADCustomManager.GetPackageNames Method

TADCustomManager.GetPackageNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of the packages in a DB.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionName: string | A connection name.
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const APattern: string | A LIKE pattern.
AList: TStrings | A list to fill.
AScopes: TADPhysObjectScopes = [osMy] | A object scopes.
Description

Call GetPackageNames to retrieve a list of packages in a DB.

AConnectionName is the connection name to use.

ACatalogName, ASchemaName restrict package names to the catalog and schema.

APattern is the LIKE-pattern filtering package names.

AList is a TStrings descendant that receives the package names. Any existing strings are deleted from the list before GetPackageNames adds the names of all the packages in a DB.

AScopes restricts package names to the specified scopes.

The generator names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case. Specify the MetaDefSchema and/or MetaDefCatalog parameters in connection definition, to avoid these schema and/or catalog names in package names.

Syntax
procedure GetPackageNames(const AConnectionName: string; const ACatalogName: string; const ASchemaName: string; const APattern: string; AList: TStrings; AScopes: TADPhysObjectScopes = [osMy]; AFullName: Boolean = True);
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetPackageNames

Example
ADManager.GetPackageNames('myconn', '', 'SYS', 'DBMS%', ListBox1.Items, [osMy, osSystem]);
What do you think about this topic? Send feedback!


TADCustomManager.GetRDBMSKind Method

TADCustomManager.GetRDBMSKind Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Returns a DBMS kind for the specified driver ID.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const ADriverID: String | The driver ID.
Description

Use the GetRDBMSKind method to get a DBMS kind for the specified driver ID. The driver ID may be an id of base or virtual driver. If the driver ID is unknown, then mkUnknown is returned.

Syntax
function GetRDBMSKind(const ADriverID: String): TADRDBMSKind;
See Also

GetBaseDriverID

What do you think about this topic? Send feedback!


TADCustomManager.GetSchemaNames Method

TADCustomManager.GetSchemaNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of schemas in a DB.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionName: string | A connection name.
const ACatalogName: string | A catalog name.
const APattern: string | A LIKE pattern.
AList: TStrings | A list to fill.
Description

Call GetSchemaNames to retrieve a list of schemas in a DB.

AConnectionName is the connection name to use.

ACatalogName restricts schema names to the specified catalog. If it is empty, then all schemas will be returned.

APattern is the LIKE-pattern filtering schema names.

AList is a TStrings descendant that receives the schema names. Any existing strings are deleted from the list before GetSchemaNames adds the names of all the schemas in a DB.

Syntax
procedure GetSchemaNames(const AConnectionName: string; const ACatalogName: string; const APattern: string; AList: TStrings);
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetSchemaNames

Example
ADManager.GetSchemaNames('myconn', '', '', ListBox1.Items);
What do you think about this topic? Send feedback!


TADCustomManager.GetStoredProcNames Method

TADCustomManager.GetStoredProcNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of stored procedures in a DB.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionName: string | A connection name.
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const APackage: string | A package name.
const APattern: string | A LIKE pattern.
AList: TStrings | A list to fill.
AScopes: TADPhysObjectScopes = [osMy] | A object scopes.
Description

Call GetStoredProcNames to retrieve a list of stored procedures and functions in a DB.

AConnectionName is the connection name to use.

ACatalogName, ASchemaName restrict procedure names to the catalog and schema.

APackage restricts procedure names to the package.

APattern is the LIKE-pattern filtering procedure names.

AList is a TStrings descendant that receives the procedure names. Any existing strings are deleted from the list before GetStoredProcNames adds the names of all the procedures in a DB.

AScopes restricts stored procedure names to the specified scopes. Applies only to non-packaged procedures.

The stored procedure names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case. Specify the MetaDefSchema and/or MetaDefCatalog parameters in connection definition, to avoid these schema and/or catalog names in procedure names.

Syntax
procedure GetStoredProcNames(const AConnectionName: string; const ACatalogName: string; const ASchemaName: string; const APackage: string; const APattern: string; AList: TStrings; AScopes: TADPhysObjectScopes = [osMy]; AFullName: Boolean = True);
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetStoredProcNames

Example
ADManager.GetStoredProcNames('myconn', '', '', '', '', ListBox1.Items, [osMy, osSystem]);
What do you think about this topic? Send feedback!


TADCustomManager.GetTableNames Method

TADCustomManager.GetTableNames Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Populates a string list with the names of tables in a DB.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AConnectionName: string | A connection name.
const ACatalogName: string | A catalog name.
const ASchemaName: string | A schema name.
const APattern: string | A LIKE pattern.
AList: TStrings | A list to fill.
AScopes: TADPhysObjectScopes = [osMy] | A object scopes.
Description

Call GetTableNames to retrieve a list of tables in a DB.

AConnectionName is the connection name to use.

ACatalogName, ASchemaName restrict table names to the catalog and schema.

APattern is the LIKE-pattern filtering table names.

AList is a TStrings descendant that receives the table names. Any existing strings are deleted from the list before GetTableNames adds the names of all the tables in a DB.

AScopes restricts table names to the specified scopes.

AKinds restricts tables to the specified object kinds.

The table names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case. Specify the MetaDefSchema and/or MetaDefCatalog parameters in connection definition, to avoid these schema and/or catalog names in table names.

Syntax
procedure GetTableNames(const AConnectionName: string; const ACatalogName: string; const ASchemaName: string; const APattern: string; AList: TStrings; AScopes: TADPhysObjectScopes = [osMy]; AFullName: Boolean = True);
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetTableNames

Example
ADManager.GetTableNames('myconn', 'NORTHWIND', 'DBO', 'ADQA%', '', ListBox1.Items,
  [osMy, osSystem, osOther], [tkTable, tkView]);
What do you think about this topic? Send feedback!


TADCustomManager.IsConnectionDef Method

TADCustomManager.IsConnectionDef Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public Send Feedback

Check if name is connection definition name.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public
Parameters
Parameters | Description
const AName: String | A name to check.
Returns

True, if the AName is connection definition name. False - otherwise.

Description

The IsConnectionDef method checks if AName value is the name of existing connection definition in ConnectionDefs list.

Syntax
function IsConnectionDef(const AName: String): Boolean;
What do you think about this topic? Send feedback!


TADCustomManager.LoadConnectionDefFile Method

TADCustomManager.LoadConnectionDefFile Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Loads connection definitions file.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The LoadConnectionDefFile method explicitly loads a connection definition file, specified by ConnectionDefFileName. Use this method, if you set ConnectionDefFileAutoLoad to False.

Syntax
procedure LoadConnectionDefFile;
See Also

ConnectionDefs, ConnectionDefFileAutoLoad, ConnectionDefFileLoaded, ConnectionDefFileName

What do you think about this topic? Send feedback!


TADCustomManager.ModifyConnectionDef Method

TADCustomManager.ModifyConnectionDef Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Modifies parameters of an existing connection definition.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AName: string | A connection definition name to modify.
AList: TStrings | A list of name=value pairs.
Description

The ModifyConnectionDef method modifies parameters of an existing connection definition in the ConnectionDefs list using AList parameter values.

After the call a persistent connection definition is not stored to a file. Call SaveConnectionDefFile to save this and other changes to a file. Not stored connection definition changes will be discarded after FireDAC manager or application will be terminated.

If connection definition with AName name is not found, then exception will be raised.

Syntax
procedure ModifyConnectionDef(const AName: string; AList: TStrings);
See Also

Defining Connection, ConnectionDefs, SaveConnectionDefFile, DeleteConnectionDef, AddConnectionDef

Example
var
  oList: TStringList;
......
  oList := TStringList.Create;
  oList.Add('Server=myhoster');
  ADManager.ModifyConnectionDef('myconn', oList);
  ADManager.SaveConnectionDefFile;
What do you think about this topic? Send feedback!


TADCustomManager.Open Method

TADCustomManager.Open Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Activates FireDAC manager.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The Open method activates manager, by setting Active to True.

Syntax
procedure Open;
See Also

Close, Active

What do you think about this topic? Send feedback!


TADCustomManager.RefreshConnectionDefFile Method

TADCustomManager.RefreshConnectionDefFile Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Refreshes connection definition list.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Description

The RefreshConnectionDefFile method discards all changes in the ConnectionDefs list and loads connection definition file. The list may be refreshed, if there is no active connections using connection definitions from the list.

Syntax
procedure RefreshConnectionDefFile;
See Also

CanRefreshConnectionDefFile, ConnectionDefs

Example
if ADManager.CanRefreshConnectionDefFile then
  ADManager.RefreshConnectionDefFile;
What do you think about this topic? Send feedback!


TADCustomManager.RefreshMetadataCache Method

TADCustomManager.RefreshMetadataCache Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace public See Also Send Feedback

Invalidates meta data cache for all connections.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, public, See Also
Description

The RefreshMetadataCache method discards all cached metadata, like a stored procedure definitions and table primary keys for all TADCustomConnection instances. Call this method, if the DB metadata has been changed, so the cached metadata is invalid. The metadata is cached by datasets, if fiMeta is included into FetchOptions.Cache.

Syntax
procedure RefreshMetadataCache;
See Also

Querying Metadata, TADFetchOptions.Cache, TADCustomConnection.RefreshMetadataCache

What do you think about this topic? Send feedback!


TADCustomManager.SaveConnectionDefFile Method

TADCustomManager.SaveConnectionDefFile Method
TADCustomManager Class TADCustomManager Members uADCompClient Namespace Example public See Also Send Feedback

Saves connection definitions into a file.

Group

public

Links
TADCustomManager Class, TADCustomManager Members, uADCompClient Namespace, Example, public, See Also
Description

The SaveConnectionDefFile method saves all changes in the ConnectionDefs list to the file specified by ConnectionDefFileName.

Syntax
procedure SaveConnectionDefFile;
See Also

ConnectionDefs, DeleteConnectionDef, AddConnectionDef, ModifyConnectionDef

Example
  ADManager.DeleteConnectionDef('myconn');
  ADManager.SaveConnectionDefFile;
What do you think about this topic? Send feedback!


TADCustomMemTable Class

TADCustomMemTable Class
public TADCustomMemTable Members Example Classes See Also Send Feedback

The class implementing in-memory dataset.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomMemTableuADCompClient_TADCustomMemTableuADCompClient_TADCustomMemTable
File

uADCompClient

Links
public, TADCustomMemTable Members, Example, Classes, See Also
Description

Use TADCustomMemTable to manage data in the client memory and optionally exchange the data with a DBMS.

In general, TADCustomMemTable is an in-memory dataset. It may be populated directly by the code at run time without connection to a database. For example:

  ADMemTable1.FieldDefs.Add('id', ftInteger);
  ADMemTable1.FieldDefs.Add('name', ftString, 20);
  ADMemTable1.Open;
  ADMemTable1.AppendRecord([1, 'MySQL']);
  ADMemTable1.AppendRecord([2, 'SQLite']);

And TADCustomMemTable may be populated from a database using TADTableAdapter and TADCommand components. That may be considered as an advanced technique, because TADQuery may be used for most DB data exchange operations.

This class hides some of properties, allowing to control visibility of properties by descendant classes. End users should use TADMemTable.

Syntax
TADCustomMemTable = class(TADAdaptedDataSet);
See Also

TADMemTable, TADDatSTable, TADCustomTableAdapter

Example

See FireDAC\Samples\Comp Layer\TADMemTable\Main sample for details of how to setup TADMemTable.

See FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail sample for details of how to work with master-detail relation.

What do you think about this topic? Send feedback!


TADCustomMemTable Members

TADCustomMemTable Members
Events TADCustomMemTable Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomMemTable.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADCustomMemTable Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
AppendData | Appends data to this dataset from other dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
ConstraintsDisabled | Shortcut for ConstraintsEnabled.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetOptionalParam | Returns an optional custom parameter, associated with a dataset.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MergeChangeLog | Shortcut for CommitUpdates.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetOptionalParam | Sets an optional custom parameter, associated with a dataset.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | Add a short summary here...
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
CommandText | Shortcut for Adapter.SelectCommand.CommandText.Text.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
DisableStringTrim | Shortcut for FormatOptions.StrsTrim.
FetchOnDemand | Shortcut for FormatOptions.Mode.
FetchOptions | The set of options to control rows fetching.
FileName | Shortcut for ResourceOptions.PersistentFileName.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
IsClone | Returns True, if this dataset is a cloned dataset.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
LogChanges | Shortcut for CachedUpdates.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
PacketRecords | Shortcut for FetchOptions.RowsetSize.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
ProviderEOF | Shortcut for SourceEOF.
ReadOnly | Shortcut for UpdateOptions.ReadOnly.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
StatusFilter | Shortcut for FilterChanges.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.
XMLData | Represents dataset content as an XML.
Links
Events, TADCustomMemTable Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADCustomMemTable Class Legend Methods Properties Send Feedback

The public members of the TADCustomMemTable class are listed here.

Class

TADCustomMemTable Class

Methods
Method | Description
AppendData | Appends data to this dataset from other dataset.
ConstraintsDisabled | Shortcut for ConstraintsEnabled.
GetOptionalParam | Returns an optional custom parameter, associated with a dataset.
MergeChangeLog | Shortcut for CommitUpdates.
SetOptionalParam | Sets an optional custom parameter, associated with a dataset.
Properties
Property | Description
Adapter | Add a short summary here...
CommandText | Shortcut for Adapter.SelectCommand.CommandText.Text.
DisableStringTrim | Shortcut for FormatOptions.StrsTrim.
FetchOnDemand | Shortcut for FormatOptions.Mode.
FileName | Shortcut for ResourceOptions.PersistentFileName.
IsClone | Returns True, if this dataset is a cloned dataset.
LogChanges | Shortcut for CachedUpdates.
PacketRecords | Shortcut for FetchOptions.RowsetSize.
ProviderEOF | Shortcut for SourceEOF.
ReadOnly | Shortcut for UpdateOptions.ReadOnly.
StatusFilter | Shortcut for FilterChanges.
XMLData | Represents dataset content as an XML.
Links
TADCustomMemTable Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomMemTable.Adapter Property

TADCustomMemTable.Adapter Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace Example public See Also Send Feedback

Add a short summary here...

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, Example, public, See Also
Description

Add a description here...

Syntax
property Adapter: TADCustomTableAdapter;
See Also

List here...

Example
What do you think about this topic? Send feedback!


TADCustomMemTable.CommandText Property

TADCustomMemTable.CommandText Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for Adapter.SelectCommand.CommandText.Text.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The CommandText is a shortcut for the Adapter.SelectCommand.CommandText.Text property. And allows to set / get a command text more quickly.

The property is for the TClientDataSet compatibility.

Syntax
property CommandText: WideString;
See Also

Adapter, TADCustomCommand.CommandText

What do you think about this topic? Send feedback!


TADCustomMemTable.DisableStringTrim Property

TADCustomMemTable.DisableStringTrim Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for FormatOptions.StrsTrim.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The DisableStringTrim is a shortcut for the "not FormatOptions.StrsTrim". And allows to set / get a CHAR fields trimming mode.

The property is for the TClientDataSet compatibility.

Syntax
property DisableStringTrim: Boolean;
See Also

FormatOptions, TADFormatOptions.StrsTrim

What do you think about this topic? Send feedback!


TADCustomMemTable.FetchOnDemand Property

TADCustomMemTable.FetchOnDemand Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for FormatOptions.Mode.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The FetchOnDemand is a shortcut for the FetchOptions.Mode = fmAll / fmOnDemand. And allows to set / get resultset fetching mode.

The property is for the TClientDataSet compatibility.

Syntax
property FetchOnDemand: Boolean;
See Also

FetchOptions, TADFetchOptions.Mode

What do you think about this topic? Send feedback!


TADCustomMemTable.FileName Property

TADCustomMemTable.FileName Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for ResourceOptions.PersistentFileName.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The FileName is a shortcut for the ResourceOptions.PersistentFileName property. And allows to set / get persistent file name to store dataset content.

The property is for the TClientDataSet compatibility.

Syntax
property FileName: string;
See Also

ResourceOptions, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADCustomMemTable.IsClone Property

TADCustomMemTable.IsClone Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Returns True, if this dataset is a cloned dataset.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

Read the IsClone property to check is this dataset a cloned one. Alternatively the application may read the CloneSource property. If it is not nil, then it is referencing to the original dataset.

The property is for the TClientDataSet compatibility.

Syntax
property IsClone: Boolean;
See Also

CloneSource, TADDataSet.CloneCursor

What do you think about this topic? Send feedback!


TADCustomMemTable.LogChanges Property

TADCustomMemTable.LogChanges Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for CachedUpdates.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The LogChanges is a shortcut for the CachedUpdates property. And allows to set / get the dataset updates caching mode.

The property is for the TClientDataSet compatibility.

Syntax
property LogChanges: Boolean;
See Also

CachedUpdates

What do you think about this topic? Send feedback!


TADCustomMemTable.PacketRecords Property

TADCustomMemTable.PacketRecords Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for FetchOptions.RowsetSize.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The PacketRecords is a shortcut for the FetchOptions.RowsetSize property. And allows to set / get the dataset rowset size.

The property is for the TClientDataSet compatibility.

Syntax
property PacketRecords: Integer;
See Also

FetchOptions, TADFetchOptions.RowsetSize

What do you think about this topic? Send feedback!


TADCustomMemTable.ProviderEOF Property

TADCustomMemTable.ProviderEOF Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for SourceEOF.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The ProviderEOF is a shortcut for the TADDataSet.SourceEOF property. And allows to set / get the sign that all rows are fetched from a DB.

The property is for the TClientDataSet compatibility.

Syntax
property ProviderEOF: Boolean;
See Also

TADDataSet.SourceEOF

What do you think about this topic? Send feedback!


TADCustomMemTable.ReadOnly Property

TADCustomMemTable.ReadOnly Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for UpdateOptions.ReadOnly.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The ReadOnly is a shortcut for the UpdateOptions.ReadOnly property. And allows to control the dataset read-write or read-only mode.

The property is for the TClientDataSet compatibility.

Syntax
property ReadOnly: Boolean;
See Also

UpdateOptions, TADUpdateOptions.ReadOnly

What do you think about this topic? Send feedback!


TADCustomMemTable.StatusFilter Property

TADCustomMemTable.StatusFilter Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for FilterChanges.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The StatusFilter is a shortcut for the FilterChanges property. And allows to set / get the dataset changes filter.

The property is for the TClientDataSet compatibility.

Syntax
property StatusFilter: TADUpdateRecordTypes;
See Also

FilterChanges

What do you think about this topic? Send feedback!


TADCustomMemTable.XMLData Property

TADCustomMemTable.XMLData Property
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace Example public See Also Send Feedback

Represents dataset content as an XML.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, Example, public, See Also
Description

The property XMLData allows to exchange data between dataset and external systems. The property is a shortcut for LoadFromStream / SaveToStream methods.

The data is represented as an Unicode string, containing XML encoded data. Read property to get the data. Set property to populate dataset structure and fill in by rows. After setting the property the dataset will remain open.

The property is for the TClientDataSet compatibility.

Syntax
property XMLData: string;
See Also

LoadFromStream, SaveToStream

Example
var
  s: WideString;
....
  s := ADMemTable1.XMLData;
....
  ADMemTable2.XMLData := s;
What do you think about this topic? Send feedback!


TADCustomMemTable.AppendData Method

TADCustomMemTable.AppendData Method
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace Example public See Also Send Feedback

Appends data to this dataset from other dataset.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AData: IADDataSetReference | The FireDAC dataset reference.
AHitEOF: Boolean = True | Set to True to set SourceEOF to True.
Description

Use the AppendData method to append the rows from one FireDAC dataset to this dataset. The property is a shortcut for Data property and CopyDataSet method.

When this dataset is inactive, then it will inherit structure from AData, activated and rows will be appended. When this dataset is active, then rows will be imported and only compatible fields will be filled.

The property is for the TClientDataSet compatibility

Syntax
procedure AppendData(const AData: IADDataSetReference; AHitEOF: Boolean = True);
See Also

Data, CopyDataSet

Example
ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select * from [Orders]');
ADMemTable1.AppendData(ADQuery1);

ADQuery2.Connection := ADConnection2;
ADQuery2.Open('select * from "Orders"');
ADMemTable1.AppendData(ADQuery2);
What do you think about this topic? Send feedback!


TADCustomMemTable.ConstraintsDisabled Method

TADCustomMemTable.ConstraintsDisabled Method
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for ConstraintsEnabled.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The ConstraintsDisabled is a shortcut for the "not ConstraintsEnabled".

The property is for the TClientDataSet compatibility.

Syntax
function ConstraintsDisabled: Boolean;
See Also

ConstraintsEnabled

What do you think about this topic? Send feedback!


TADCustomMemTable.GetOptionalParam Method

TADCustomMemTable.GetOptionalParam Method
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace Example public See Also Send Feedback

Returns an optional custom parameter, associated with a dataset.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AParamName: string | The parameter name.
Description

Use GetOptionalParam method to get a custom parameter value, associated with dataset.

The parameter value may be set using SetOptionalParam. The optional parameters are part of internal dataset storage and are saved / loaded with dataset at SaveToStream / LoadFromStream calls. FireDAC does not interpret these parameters in any way.

The method is for the TClientDataSet compatibility.

Syntax
function GetOptionalParam(const AParamName: string): Variant;
See Also

SetOptionalParam

Example
var
  dt: Variant;
...
dt := ADMemTable1.GetOptionalParam('last_modified_date');
if VarIsNull(dt) then
  ShowMessage('No modifications were done')
else
  ShowMessage('Last modification was done at ' + DateToStr(dt));
What do you think about this topic? Send feedback!


TADCustomMemTable.MergeChangeLog Method

TADCustomMemTable.MergeChangeLog Method
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Shortcut for CommitUpdates.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Description

The MergeChangeLog is a shortcut for the CommitUpdates method.

The property is for the TClientDataSet compatibility.

Syntax
procedure MergeChangeLog;
See Also

CommitUpdates

What do you think about this topic? Send feedback!


TADCustomMemTable.SetOptionalParam Method

TADCustomMemTable.SetOptionalParam Method
TADCustomMemTable Class TADCustomMemTable Members uADCompClient Namespace public See Also Send Feedback

Sets an optional custom parameter, associated with a dataset.

Group

public

Links
TADCustomMemTable Class, TADCustomMemTable Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const AParamName: string | The parameter name.
const AValue: Variant | The paramet value.
AIncludeInDelta: Boolean = False | Has no meaning in FireDAC.
Description

Use SetOptionalParam method to set a custom parameter value, associated with dataset.

The parameter value may be retrieved using GetOptionalParam. The optional parameters are part of internal dataset storage and are saved / loaded with dataset at SaveToStream / LoadFromStream calls. FireDAC does not interpret these parameters in any way.

The method is for the TClientDataSet compatibility.

Syntax
procedure SetOptionalParam(const AParamName: string; const AValue: Variant; AIncludeInDelta: Boolean = False); virtual;
See Also

GetOptionalParam

What do you think about this topic? Send feedback!


TADCustomQuery Class

TADCustomQuery Class
public TADCustomQuery Members Classes See Also Send Feedback

The class implementing dataset, capable to execute SQL queries.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomQueryuADCompClient_TADCustomQueryuADCompClient_TADCustomQueryuADCompClient_TADCustomQuery
File

uADCompClient

Links
public, TADCustomQuery Members, Classes, See Also
Description

Use TADCustomQuery to execute SQL queries, browse the result sets and edit the result set records.

This class hides some of properties, allowing to control visibility of properties by descendant classes. End users should use TADQuery.

For options description, please, look at uADStanOption unit description.

Syntax
TADCustomQuery = class(TADRdbmsDataSet);
See Also

Executing Command, Update Command Generation, TADQuery, TADCustomCommand, uADStanOption

What do you think about this topic? Send feedback!


TADCustomQuery Members

TADCustomQuery Members
Events TADCustomQuery Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomQuery.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADCustomQuery Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecSQL | Executes the SQL statement for the query.
ExecSQL | Executes the specified SQL statement for the query.
ExecSQL | Executes the specified SQL statement and parameter values for the query.
ExecSQL | Executes the specified SQL statement and assigns parameter values for the query.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DataSource | Specifies the data source object from which associated dataset to get matching field values to the details dataset parameters.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the query SQL text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
SQL | Contains the text of the SQL statement to execute for the query.
Table | The reference to DatS table object, actually representing the internal data storage.
Text | Points to the actual text of the SQL query passed to the DBMS CLI.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.
Links
Events, TADCustomQuery Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADCustomQuery Class Legend Methods Properties Send Feedback

The public members of the TADCustomQuery class are listed here.

Class

TADCustomQuery Class

Methods
Method | Description
ExecSQL | Executes the SQL statement for the query.
ExecSQL | Executes the specified SQL statement for the query.
ExecSQL | Executes the specified SQL statement and parameter values for the query.
ExecSQL | Executes the specified SQL statement and assigns parameter values for the query.
Properties
Property | Description
DataSource | Specifies the data source object from which associated dataset to get matching field values to the details dataset parameters.
ParamCount | Returns the current number of parameters in the query SQL text.
SQL | Contains the text of the SQL statement to execute for the query.
Text | Points to the actual text of the SQL query passed to the DBMS CLI.
Links
TADCustomQuery Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomQuery.DataSource Property

TADCustomQuery.DataSource Property
TADCustomQuery Class TADCustomQuery Members uADCompClient Namespace Example public See Also Send Feedback

Specifies the data source object from which associated dataset to get matching field values to the details dataset parameters.

Group

public

Links
TADCustomQuery Class, TADCustomQuery Members, uADCompClient Namespace, Example, public, See Also
Description

Use the DataSource property to automatically fill parameters in a query with fields values from another dataset. Parameters that have the same name as fields in the other dataset are filled with the field values. Parameters with names that are not the same as fields in the other dataset do not automatically get values, and must be programmatically set.

When the master dataset current position is changed or is changed the data in the current record of the master dataset, then this dataset (detail dataset) will reopen query using new master dataset field values. If that is not desired behavior or you must quickly walk through master dataset, then use DisableControls / EnableControls on master dataset.

Syntax
property DataSource: TDataSource;
See Also

SQL, Params, ParamByName, TDataSet.BeforeOpen

Example
MasterQuery.Open('select * from {id Orders}');
MasterSource.DataSet := MasterQuery;
DetailQuery.DataSource := MasterSource;
DetailQuery.Open('select * from {id Order Details} where OrderID = :OrderID');
// here :OrderID parameter of DetailQuery will get the current value of OrderID
// field from MasterQuery
What do you think about this topic? Send feedback!


TADCustomQuery.ParamCount Property

TADCustomQuery.ParamCount Property
TADCustomQuery Class TADCustomQuery Members uADCompClient Namespace public See Also Send Feedback

Returns the current number of parameters in the query SQL text.

Group

public

Links
TADCustomQuery Class, TADCustomQuery Members, uADCompClient Namespace, public, See Also
Description

The ParamCount property value is the shortcut for Params.Count property.

If the ResourceOptions.ParamCreate property is True, ParamCount always corresponds to the number of actual parameters in the SQL statement for the query.

Syntax
property ParamCount: Word;
See Also

Params, SQL, TADResourceOptions.ParamCreate

What do you think about this topic? Send feedback!


TADCustomQuery.SQL Property

TADCustomQuery.SQL Property
TADCustomQuery Class TADCustomQuery Members uADCompClient Namespace Example public See Also Send Feedback

Contains the text of the SQL statement to execute for the query.

Group

public

Links
TADCustomQuery Class, TADCustomQuery Members, uADCompClient Namespace, Example, public, See Also
Description

Use SQL property to specify the SQL command that a query will Execute / ExecSQL / Open.

At design time the SQL property can be edited by invoking FireDAC Query Editor dialog. For that double click on TADCustomQuery component. The dialog offers syntax hilighting editor, query builder, ability to test query and other.

The SQL property may contain one SQL command or "batch" SQL command, consisting from few SQL command or server side programming language block of code. To execute full featured SQL script use the TADScript component.

The SQL statement in the SQL property may contain also:

  • parameter markers, following standard SQL-92 syntax conventions. Parameters are created automatically and stored in the Params property, if ResourceOptions.ParamCreate is True. If ParamBindModeis pbByName, then for all occurrences of the same marker will be created single item in Params. If pbByNumber, then - one item per each marker.
  • substitution variable markers. Macros are created automatically and stored in the Macros property, if ResourceOptions.MacroCreate is True.
  • escape sequences. They allow writing DBMS independent SQL commands.
  • conditional substitutions. They allow expand SQL command conditionally, depending on application defined attributes

For details see Preprocessing Command Text.

To improove performance on adding big SQL queries to the property using TStringList methods, surround this code into SQL.BeginUpdate / SQL.EndUpdate.

After filling this property value the Param collection will be filled automatically, if ResourceOptions.ParamCreate is True.

Syntax
property SQL: TStrings;
See Also

Executing Command, Preprocessing Command Text, TADRdbmsDataSet.Prepare, TDataSet.Open, ExecSQL, TADResourceOptions.ParamCreate, TADResourceOptions.MacroCreate, TADRdbmsDataSet.ParamBindMode

Example
ADQuery1.SQL.BeginUpdate;
try
  ADQuery1.SQL.Add('SELECT ...');
  ADQuery1.SQL.Add('...');
  ADQuery1.SQL.Add('...');
  ADQuery1.SQL.Add('WHERE ID = :ID');
finally
  ADQuery1.SQL.EndUpdate;
end;
ADQuery1.ParamByName('ID').AsInteger := 100;
ADQuery1.Open;
What do you think about this topic? Send feedback!


TADCustomQuery.Text Property

TADCustomQuery.Text Property
TADCustomQuery Class TADCustomQuery Members uADCompClient Namespace public See Also Send Feedback

Points to the actual text of the SQL query passed to the DBMS CLI.

Group

public

Links
TADCustomQuery Class, TADCustomQuery Members, uADCompClient Namespace, public, See Also
Description

Text is a read-only property that can be examined to determine the actual contents of SQL statement passed to the DBMS. For parameterized queries, Text contains the SQL statement with parameters replaced by the parameter substitution symbol (? or else) in place of actual parameter values, substituted macro values and processed escape sequences.

In general there should be no need to examine the Text property. To access or change the SQL statement for the query, use the SQL property. To examine or modify parameters, use the Params property.

To check what FireDAC sends to the DBMS, consider to use FireDAC monitoring.

Syntax
property Text: String;
See Also

SQL, Params

What do you think about this topic? Send feedback!


TADCustomQuery.ExecSQL Method ()

TADCustomQuery.ExecSQL Method ()
TADCustomQuery Class TADCustomQuery Members uADCompClient Namespace Example 1 Example 2 Example 3 public See Also Send Feedback

Executes the SQL statement for the query.

Group

public

Links
TADCustomQuery Class, TADCustomQuery Members, uADCompClient Namespace, Example 1, Example 2, Example 3, public, See Also
Description

Call ExecSQL to execute the SQL statement currently assigned to the SQL property.

Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE). For SELECT statements and others, returning cursors, call Open instead of ExecSQL. If FireDAC has recognized a command as returning a cursor, then "[FireDAC][Phys]-310. Cannot execute command returning results set." will be raised on ExecSQL. This may be incorrect, for example on batch commands, like a:

SELECT f1 INTO @v1 FROM myTab1 WHERE ...;
INSERT INTO myTab2 VALUES (@v1 + 1, ...)

In this case you should explicitly change command kind:

ADQuery1.Command.CommandKind := skInsert;
ADQuery1.ExecSQL;

For Array DML call Execute instead of ExecSQL.

ExecSQL prepares the statement in SQL property for execution if it has not already been prepared. To speed performance, an application should ordinarily call Prepare before calling ExecSQL for the first time.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum command execution time. After that time command execution will be canceled and exception raised.

To cancel command execution use TADAdaptedDataSet.AbortJob.

Before command execution the BeforeExecute event is fired. If server will return command execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After command execution is finished, AfterExecute event is fired.

Syntax
procedure ExecSQL; overload;
See Also

Executing Command, TADRdbmsDataSet.Prepare, TDataSet.Open, SQL, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError, TADDataSet.Execute

Example 1
// standard parameterized SQL execution
ADQuery1.SQL.Text := 'insert into mytab values (:id, :name)';
ADQuery1.Params[0].AsInteger := 100;
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.ExecSQL;
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\Async demo for asynchronous execution mode.

Example 3
// avoid [FireDAC][Phys]-310
ADQuery1.SQL.Clear;
ADQuery1.SQL.Add('SELECT f1 INTO @v1 FROM myTab1 WHERE ...;');
ADQuery1.SQL.Add('INSERT INTO myTab2 VALUES (@v1 + 1, ...)');
ADQuery1.Command.CommandKind := skInsert;
ADQuery1.ExecSQL;
What do you think about this topic? Send feedback!


TADCustomQuery.ExecSQL Method (String)

TADCustomQuery.ExecSQL Method (String)
TADCustomQuery Class TADCustomQuery Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified SQL statement for the query.

Group

public

Links
TADCustomQuery Class, TADCustomQuery Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command text.
Returns

The number of updated rows, if any.

Description

Call ExecSQL to execute the SQL statement specified in ASQL or is currently assigned to the SQL property, if ASQL is empty. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE), does not have parameters (such as CREATE TABLE). For SELECT statements and others, returning cursors, call Open instead of ExecSQL. For Array DML call Execute instead of ExecSQL.

ExecSQL prepares the statement in ASQL, then executes it. If an application needs to call the same SQL command many times, then an application may ordinarily set SQL property, call Prepare before calling ExecSQL for the first time, then use any ExecSQL version without specifing ASQL.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum command execution time. After that time command execution will be canceled and exception raised.

To cancel command execution use TADAdaptedDataSet.AbortJob.

Before command execution the BeforeExecute event is fired. If server will return command execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After command execution is finished, AfterExecute event is fired.

Syntax
function ExecSQL(const ASQL: String): LongInt; overload;
See Also

Executing Command, TADRdbmsDataSet.Prepare, TDataSet.Open, SQL, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError, TADDataSet.Execute

Example
ADQuery1.ExecSQL('create table ...');
What do you think about this topic? Send feedback!


TADCustomQuery.ExecSQL Method (String, array of Variant)

TADCustomQuery.ExecSQL Method (String, array of Variant)
TADCustomQuery Class TADCustomQuery Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Executes the specified SQL statement and parameter values for the query.

Group

public

Links
TADCustomQuery Class, TADCustomQuery Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command text.
const AParams: array of Variant | An open array of parameter values.
Returns

The number of updated rows, if any.

Description

Call ExecSQL to execute the SQL statement specified in ASQL or is currently assigned to the SQL property, if ASQL is empty. Use ExecSQL to execute queries that do not return a cursor to data and have parameters (such as INSERT, UPDATE, DELETE). For SELECT statements and others, returning cursors, call Open instead of ExecSQL. For Array DML call Execute instead of ExecSQL.

ExecSQL prepares the statement in ASQL, then executes it. If an application needs to call the same SQL command many times, then an application may ordinarily set SQL property, call Prepare before calling ExecSQL for the first time, then use any ExecSQL version without specifing ASQL.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum command execution time. After that time command execution will be canceled and exception raised.

To cancel command execution use TADAdaptedDataSet.AbortJob.

Before command execution the BeforeExecute event is fired. If server will return command execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After command execution is finished, AfterExecute event is fired.

Syntax
function ExecSQL(const ASQL: String; const AParams: array of Variant): LongInt; overload;
See Also

Executing Command, TADRdbmsDataSet.Prepare, TDataSet.Open, SQL, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError, TADDataSet.Execute

Example 1
ADQuery1.ExecSQL('insert into mytab (f1, f2) values (:f1, :f2)', [100, 'qweqwe']);
Example 2
ADQuery1.SQL.Text := 'insert into mytab (f1, f2) values (:f1, :f2)';
ADQuery1.Params[0].DataType := ftInteger;
ADQuery1.Params[1].DataType := ftWideString;
ADQuery1.ExecSQL('', [100, 'qweqwe']);
ADQuery1.ExecSQL('', [101, 'asdasd']);
ADQuery1.ExecSQL('', [102, 'zxczxc']);
What do you think about this topic? Send feedback!


TADCustomQuery.ExecSQL Method (String, array of Variant, array of TFieldType)

TADCustomQuery.ExecSQL Method (String, array of Variant, array of TFieldType)
TADCustomQuery Class TADCustomQuery Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified SQL statement and assigns parameter values for the query.

Group

public

Links
TADCustomQuery Class, TADCustomQuery Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command text.
const AParams: array of Variant | An open array of parameter values.
const ATypes: array of TFieldType | An open array of parameter data types.
Returns

The number of updated rows, if any.

Description

Call ExecSQL to execute the SQL statement specified in ASQL or is currently assigned to the SQL property, if ASQL is empty. Use ExecSQL to execute queries that do not return a cursor to data, have parameters (such as INSERT, UPDATE, DELETE) and will be executed only once. For SELECT statements and others, returning cursors, call Open instead of ExecSQL. For Array DML call Execute instead of ExecSQL.

This method allows to specify exact parameter data types. If you need to leave parameter data type unchanged, then put ftUnknown into array item corresponding to the parameter.

ExecSQL prepares the statement in ASQL, then executes it. If an application needs to call the same SQL command many times, then an application may ordinarily set SQL property, call Prepare before calling ExecSQL for the first time, then use ExecSQL version without specifing ASQL and parameter types.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum command execution time. After that time command execution will be canceled and exception raised.

To cancel command execution use TADAdaptedDataSet.AbortJob.

Before command execution the BeforeExecute event is fired. If server will return command execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After command execution is finished, AfterExecute event is fired.

Syntax
function ExecSQL(const ASQL: String; const AParams: array of Variant; const ATypes: array of TFieldType): LongInt; overload;
See Also

Executing Command, TADRdbmsDataSet.Prepare, TDataSet.Open, SQL, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError, TADDataSet.Execute

Example
ADQuery1.ExecSQL('insert into mytab (f1, f2) values (:f1, :f2)',
  [100, 'qweqwe'], [ftInteger, ftWideString]);
What do you think about this topic? Send feedback!


TADCustomSchemaAdapter Class

TADCustomSchemaAdapter Class
public TADCustomSchemaAdapter Members Example Classes See Also Send Feedback

The class implementing Centralized Cached Updates support.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomSchemaAdapter
File

uADCompClient

Links
public, TADCustomSchemaAdapter Members, Example, Classes, See Also
Description

Use TADCustomSchemaAdapter to manage Centralized Cached Updates.

This class hides some of properties, allowing to control visibility of properties by descendant classes. End users should use TADSchemaAdapter.

Syntax
TADCustomSchemaAdapter = class(TADComponent, IUnknown, IADStanErrorHandler, IADDAptUpdateHandler);
See Also

Caching Updates, Master-Detail Relationship, TADSchemaAdapter

Example

See demos:

- FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\Centralized

- FireDAC\Samples\Comp Layer\TADSchemaAdapter\MemTable

What do you think about this topic? Send feedback!


TADCustomSchemaAdapter Members

TADCustomSchemaAdapter Members
TADCustomSchemaAdapter Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomSchemaAdapter.

Class

TADCustomSchemaAdapter Class

Methods
Method | Description
ApplyUpdates | Applies changes for all records in the centralized change journal to the database.
Reconcile | Clears successfully updated records from the centralized cache of changes.
Properties
Property | Description
Count | Returns the number of associated table adapters.
TableAdapters | Returns references to the associated table adapters.
Links
TADCustomSchemaAdapter Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADCustomSchemaAdapter Class Legend Methods Properties Send Feedback

The public members of the TADCustomSchemaAdapter class are listed here.

Class

TADCustomSchemaAdapter Class

Methods
Method | Description
ApplyUpdates | Applies changes for all records in the centralized change journal to the database.
Reconcile | Clears successfully updated records from the centralized cache of changes.
Properties
Property | Description
Count | Returns the number of associated table adapters.
TableAdapters | Returns references to the associated table adapters.
Links
TADCustomSchemaAdapter Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomSchemaAdapter.Count Property

TADCustomSchemaAdapter.Count Property
TADCustomSchemaAdapter Class TADCustomSchemaAdapter Members uADCompClient Namespace public See Also Send Feedback

Returns the number of associated table adapters.

Group

public

Links
TADCustomSchemaAdapter Class, TADCustomSchemaAdapter Members, uADCompClient Namespace, public, See Also
Description

Use Count property to get the number of TADCustomTableAdapter's associated with this schema adapter.

Syntax
property Count: Integer;
See Also

TableAdapters

What do you think about this topic? Send feedback!


TADCustomSchemaAdapter.TableAdapters Property

TADCustomSchemaAdapter.TableAdapters Property
TADCustomSchemaAdapter Class TADCustomSchemaAdapter Members uADCompClient Namespace public See Also Send Feedback

Returns references to the associated table adapters.

Group

public

Links
TADCustomSchemaAdapter Class, TADCustomSchemaAdapter Members, uADCompClient Namespace, public, See Also
Description

Use TableAdapters indexed property to get a reference to a associated table adapter by its index.

Syntax
property TableAdapters [AIndex: Integer]: TADCustomTableAdapter;
See Also

Count

What do you think about this topic? Send feedback!


TADCustomSchemaAdapter.ApplyUpdates Method

TADCustomSchemaAdapter.ApplyUpdates Method
TADCustomSchemaAdapter Class TADCustomSchemaAdapter Members uADCompClient Namespace public See Also Send Feedback

Applies changes for all records in the centralized change journal to the database.

Group

public

Links
TADCustomSchemaAdapter Class, TADCustomSchemaAdapter Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
AMaxErrors: Integer = -1 | A maximum number of allowed errors. Default value is -1.
Returns

The number of errors is encountered.

Description

Use ApplyUpdates to apply changes for all records in the centralized change journal to the database. The centralized change journal collects changes from:

  • FireDAC datasets with SchemaAdapter property set to this TADCustomSchemaAdapter instance;
  • table adapters with SchemaAdapter property set to this TADCustomSchemaAdapter instance.

The ApplyUpdates call performs the steps:

  1. Fires a BeforeApplyUpdate event.
  2. Calls the data adapters to generate / use SQL update commands for each row and post changes to the database.
  3. Fires an AfterApplyUpdate event.
  4. Calls the Reconcile method to reconcile any records that has errors in step 2.

Note, there is no CommitUpdates method, and it must be called in code for each associated dataset.

AMaxErrors indicates the maximum number of errors that the FireDAC should allow before prematurely stopping the update operation. Set AMaxErrors to –1 to indicate that there is no limit to the number of errors, or to 0 to indicate that no error is allowed.

ApplyUpdates returns the number of errors it encountered. Based on this return value and the setting of AMaxErrors, successfully applied records are removed from the centralized change log. If the update process is aborted before all updates are applied, any unapplied updates remain in the change log.

ApplyUpdates does not raise exception. Instead application should review erroneous records using Reconcile and OnReconcileRow event handler, or FilterChanges and RowError properties for each dataset. Read "Reviewing errors" at Caching Updates for more details.

Syntax
function ApplyUpdates(AMaxErrors: Integer = -1): Integer;
See Also

SchemaAdapter, Reconcile, Caching Updates

What do you think about this topic? Send feedback!


TADCustomSchemaAdapter.Reconcile Method

TADCustomSchemaAdapter.Reconcile Method
TADCustomSchemaAdapter Class TADCustomSchemaAdapter Members uADCompClient Namespace public See Also Send Feedback

Clears successfully updated records from the centralized cache of changes.

Group

public

Links
TADCustomSchemaAdapter Class, TADCustomSchemaAdapter Members, uADCompClient Namespace, public, See Also
Description

Reconcile is called by the ApplyUpdates method to update the change log so that it reflects the result of an update. Reconcile is called after the schema adapter has attempted to apply all updates in the centralized change log.

Results of updates applying are recorded in internal data storage, including error information for each record that could not be applied. Reconcile generates an OnReconcileRow event for every record that was not successfully applied. Finally, Reconcile adjusts the change log so that it includes only those records that were not successfully applied. Any changes made in the OnReconcileRow event are reflected in the new log state.

Reconcile returns a value that indicates whether reconciling is successful. If True, Reconcile succeeded without error. If False, one or more errors could not be reconciled.

Alternatively an application may review erroneous records using the datasets FilterChanges and RowError properties. Read "Reviewing errors" at Caching Updates for more details.

Syntax
function Reconcile: Boolean;
See Also

Caching Updates, ApplyUpdates

What do you think about this topic? Send feedback!


TADCustomStoredProc Class

TADCustomStoredProc Class
public TADCustomStoredProc Members Classes See Also Send Feedback

The class implementing dataset, capable to execute server side stored procedures.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomStoredProcuADCompClient_TADCustomStoredProcuADCompClient_TADCustomStoredProcuADCompClient_TADCustomStoredProc
File

uADCompClient

Links
public, TADCustomStoredProc Members, Classes, See Also
Description

Use TADCustomStoredProc to execute server side stored procedures, browse the result sets and edit the result set records.

This class hides some of properties, allowing to control visibility of properties by descendant classes. End users should use TADStoredProc.

Read "Executing Stored Procedure" for more details.

Syntax
TADCustomStoredProc = class(TADRdbmsDataSet);
See Also

Executing Stored Procedure, TADStoredProc, TADCustomQuery

What do you think about this topic? Send feedback!


TADCustomStoredProc Members

TADCustomStoredProc Members
Events TADCustomStoredProc Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomStoredProc.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADCustomStoredProc Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DescriptionsAvailable | Determines if parameter information is available from the stored procedure on the server.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecFunc | Executes a stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter values for the stored function arguments and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter data type and values for the stored proc arguments and returns its value.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure and assigns parameter values for the stored proc arguments.
ExecProc | Executes the specified stored procedure and assigns parameter data type and values for the stored proc arguments.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the stored procedure names to the specified catalog.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
Overload | Specifies which Oracle overloaded packaged stored procedure to execute.
PackageName | Limits the stored procedure names to the specified package name.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the number of parameters for the stored procedure.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the stored procedure names to the specified schema.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
StoredProcName | Identifies the name of the stored procedure on the server to call.
Table | The reference to DatS table object, actually representing the internal data storage.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.
Links
Events, TADCustomStoredProc Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADCustomStoredProc Class Legend Methods Properties Send Feedback

The public members of the TADCustomStoredProc class are listed here.

Class

TADCustomStoredProc Class

Methods
Method | Description
DescriptionsAvailable | Determines if parameter information is available from the stored procedure on the server.
ExecFunc | Executes a stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter values for the stored function arguments and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter data type and values for the stored proc arguments and returns its value.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure and assigns parameter values for the stored proc arguments.
ExecProc | Executes the specified stored procedure and assigns parameter data type and values for the stored proc arguments.
Properties
Property | Description
CatalogName | Limits the stored procedure names to the specified catalog.
Overload | Specifies which Oracle overloaded packaged stored procedure to execute.
PackageName | Limits the stored procedure names to the specified package name.
ParamCount | Returns the number of parameters for the stored procedure.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Limits the stored procedure names to the specified schema.
StoredProcName | Identifies the name of the stored procedure on the server to call.
Links
TADCustomStoredProc Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomStoredProc.CatalogName Property

TADCustomStoredProc.CatalogName Property
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace public See Also Send Feedback

Limits the stored procedure names to the specified catalog.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, public, See Also
Description

Specify the CatalogName property value to limit the set of stored procedures to the specified catalog.

Syntax
property CatalogName: String;
See Also

Object Names, SchemaName, PackageName, Overload, StoredProcName

What do you think about this topic? Send feedback!


TADCustomStoredProc.Overload Property

TADCustomStoredProc.Overload Property
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace public See Also Send Feedback

Specifies which Oracle overloaded packaged stored procedure to execute.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, public, See Also
Description

Use Overload to specify which overloaded stored procedure to execute on an Oracle server. An Oracle overloaded stored procedure is one that shares a name with one or more other stored procedures. Oracle distinguishes among overloaded stored procedures by assigning each procedure a unique numeric identifier. An application can specify this identifier using the Overload property.

By default, Overload is zero, which assumes there is no procedure overloading. For all servers except Oracle, this value will not have the effect. If an application attempts to access an Oracle overloaded procedure without setting Overload, the FireDAC accesses the lowest numbered, or first, overloaded procedure on the server.

If Overload is 1, the FireDAC executes the first overloaded procedure on the server. If Overload is 2, it executes the second, and so on.

While Oracle overloaded procedures share names, their parameter lists are unique. An application must ensure that it passes the correct parameter list to an overloaded procedure.

Syntax
property Overload: Word;
See Also

Executing Stored Procedure, Params, StoredProcName

What do you think about this topic? Send feedback!


TADCustomStoredProc.PackageName Property

TADCustomStoredProc.PackageName Property
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace public See Also Send Feedback

Limits the stored procedure names to the specified package name.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, public, See Also
Description

Specify the PackageName property value to limit the procedure name to the specified package.

Syntax
property PackageName: String;
See Also

Object Names, CatalogName, SchemaName, Overload, StoredProcName

What do you think about this topic? Send feedback!


TADCustomStoredProc.ParamCount Property

TADCustomStoredProc.ParamCount Property
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace public See Also Send Feedback

Returns the number of parameters for the stored procedure.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, public, See Also
Description

The ParamCount property is shortcut for the Params.Count property. If the fiMeta is in FetchOptions.Items, then ParamCount corresponds to the number of actual parameters of the stored procedure.

Syntax
property ParamCount: Word;
See Also

Params, SQL, TADResourceOptions.ParamCreate

What do you think about this topic? Send feedback!


TADCustomStoredProc.RowsAffected Property

TADCustomStoredProc.RowsAffected Property
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example public Send Feedback

Returns the number of rows operated upon by the latest query execution.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example, public
Description

Inspect RowsAffected to determine how many rows were inserted, updated, deleted or fetched by the last dataset operation. If no rows were processed, RowsAffected = 0. If numbers of processed rows is not accessible, RowsAffected = –1.

At MS SQL Server RowsAffected may be unexpectedly equal to -1, if stored procedure or table trigger omits SET NOCOUNT ON. Also, this may be a reason of "Command inserted / updated / deleted [0] records instead of [1] record" error at posting updates to database. Check MS BOL for more details about SET NOCOUNT ON.

Syntax
property RowsAffected: TADCounter;
Example
procedure TForm1.ADQuery1AfterExecute(ASender: TObject);
begin
  if ADQuery1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADQuery1.Command1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADQuery1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADQuery1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADQuery1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADQuery1.RowsAffected]);
    end;
end;
What do you think about this topic? Send feedback!


TADCustomStoredProc.SchemaName Property

TADCustomStoredProc.SchemaName Property
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace public See Also Send Feedback

Limits the stored procedure names to the specified schema.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, public, See Also
Description

Specify the SchemaName property value to limit the set of schemas to the specified schema.

Syntax
property SchemaName: String;
See Also

Object Names, CatalogName, PackageName, Overload, StoredProcName

What do you think about this topic? Send feedback!


TADCustomStoredProc.StoredProcName Property

TADCustomStoredProc.StoredProcName Property
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Identifies the name of the stored procedure on the server to call.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Description

Set StoredProcName to specify the name of the stored in database procedure to call. The full name of the stored procedure will be build from CatalogName, SchemaName, PackageName, Overload property values. Also a full name may be assigned to the StoredProcName (only for non-packaged procedures). If name is case sensitive or contains special characters, then it must be explicitly quoted.

If database does not have stored procedure with StoredProcName name, then when the application attempts to prepare the stored procedure, an exception will be raised.

Syntax
property StoredProcName: string;
See Also

Object Names, Executing Stored Procedure, CatalogName, SchemaName, PackageName, Overload

Example 1
ADStoredProc1.StoredProcName := 'Northwind.dbo.[my proc]';
// the same as following
ADStoredProc1.CatalogName := 'Northwind';
ADStoredProc1.SchemaName := 'dbo';
ADStoredProc1.StoredProcName := '[my proc]';
Example 2
ADStoredProc1.PackageName := 'sys.dbms_sql';
ADStoredProc1.StoredProcName := 'execute';
What do you think about this topic? Send feedback!


TADCustomStoredProc.DescriptionsAvailable Method

TADCustomStoredProc.DescriptionsAvailable Method
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace public See Also Send Feedback

Determines if parameter information is available from the stored procedure on the server.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, public, See Also
Returns

True, if info is available.

Description

Call DescriptionsAvailable to determine if a stored procedure on a server can return parameter information to the application. If DescriptionsAvailable returns True, parameter information is available from the server. If DescriptionsAvailable returns False, parameter information is not available.

Syntax
function DescriptionsAvailable: Boolean;
See Also

ExecProc, Params

What do you think about this topic? Send feedback!


TADCustomStoredProc.ExecFunc Method ()

TADCustomStoredProc.ExecFunc Method ()
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example public See Also Send Feedback

Executes a stored function in the DBMS session and returns its value.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example, public, See Also
Returns

The result of stored function.

Description

Call ExecFunc to execute a stored function in the DBMS session, using the currently assigned stored procedure name. Use ExecFunc to execute stored functions, that do not return a cursor to data.

Before calling ExecFunc, assign stored function additional name parts to the CatalogName, SchemaName, PackageName, Overload properties. As part of ExecFunc call, the SQL statement, calling stored procedure, is built.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum stored function execution time. After that time stored function execution will be canceled and exception raised.

To cancel stored function execution use TADAdaptedDataSet.AbortJob.

Before stored function execution the BeforeExecute event is fired. If server will return stored function execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After stored function execution is finished, AfterExecute event is fired.

ExecFunc returns the stored function value.

Syntax
function ExecFunc: Variant; overload;
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
var
  v: Variant;
...
ADStoredProc1.StoredProcName := 'myfunc';
v := ADStoredProc1.ExecFunc;
What do you think about this topic? Send feedback!


TADCustomStoredProc.ExecFunc Method (String)

TADCustomStoredProc.ExecFunc Method (String)
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified stored function in the DBMS session and returns its value.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AProcName: String | A stored function name.
Returns

The result of stored function.

Description

Call ExecFunc to execute a stored function in the DBMS session, specified in AProcName or is currently assigned to the StoredProcName property, if AProcName is empty. Use ExecFunc to execute stored functions, that do not return a cursor to data and does not have parameters.

Before calling ExecFunc, assign stored function additional name parts to the CatalogName, SchemaName, PackageName properties. As part of the ExecFunc call the SQL statement calling the stored procedure is built. AProcName may include overload number specified after ';'.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum stored function execution time. After that time stored function execution will be canceled and exception raised.

To cancel stored function execution use TADAdaptedDataSet.AbortJob.

Before stored function execution the BeforeExecute event is fired. If server will return stored function execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After stored function execution is finished, AfterExecute event is fired.

ExecFunc returns the stored function value.

Syntax
function ExecFunc(const AProcName: String): Variant; overload;
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
var
  v: Variant;
...
v := ADStoredProc1.ExecFunc('myfunc');
What do you think about this topic? Send feedback!


TADCustomStoredProc.ExecFunc Method (String, array of Variant)

TADCustomStoredProc.ExecFunc Method (String, array of Variant)
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Executes the specified stored function, assigns parameter values for the stored function arguments and returns its value.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
const AProcName: String | A stored function name.
const AParams: array of Variant | An open array of parameter values.
Returns

The result of stored function.

Description

Call ExecFunc to execute a stored function in the DBMS session, specified in AProcName or is currently assigned to the StoredProcName property, if AProcName is empty. Use ExecFunc to execute stored functions, that do not return a cursor to data.

Before calling ExecFunc, assing stored function additional name parts to the CatalogName, SchemaName, PackageName properties. As part of the ExecFunc call the SQL statement calling the stored procedure is built, parameters are binded, and AParams values are assigned to the input parameters. AProcName may include overload number specified after ';'.

After return from ExecFunc you can read output parameter values.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum stored function execution time. After that time stored function execution will be canceled and exception raised.

To cancel stored function execution use TADAdaptedDataSet.AbortJob.

Before stored function execution the BeforeExecute event is fired. If server will return stored function execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After stored function execution is finished, AfterExecute event is fired.

ExecFunc returns the stored function value.

Syntax
function ExecFunc(const AProcName: String; const AParams: array of Variant): Variant; overload;
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example 1
var
  v: Variant;
...
v := ADStoredProc1.ExecFunc('myfunc;2', [100, 'qweqwe']);
Example 2
var
  v: Variant;
...
ADStoredProc1.StoredProcName := 'myfunc';
ADStoredProc1.Overload := 2;
v := ADStoredProc1.ExecFunc('', [100, 'qweqwe']);
v := ADStoredProc1.ExecFunc('', [101, 'asdasd']);
v := ADStoredProc1.ExecFunc('', [102, 'zxczxc']);
What do you think about this topic? Send feedback!


TADCustomStoredProc.ExecFunc Method (String, array of Variant, array of TFieldType)

TADCustomStoredProc.ExecFunc Method (String, array of Variant, array of TFieldType)
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified stored function, assigns parameter data type and values for the stored proc arguments and returns its value.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AProcName: String | A stored function name.
const AParams: array of Variant | An open array of parameter values.
const ATypes: array of TFieldType | An open array of parameter data types.
Returns

The result of stored function.

Description

Call ExecFunc to execute a stored function in the DBMS session, specified in AProcName or is currently assigned to the StoredProcName property, if AProcName is empty. Use ExecFunc to execute stored functiona, that do not return a cursor to data.

Before calling ExecFunc, assing stored function additional name parts to the CatalogName, SchemaName, PackageName properties. As part of the ExecFunc call the SQL statement calling the stored procedure is built, the parameters data types are assigned and binded, and the AParams values are assigned to the input parameters. AProcName may include overload number specified after ';'.

After return from ExecFunc you can read output parameter values.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum stored function execution time. After that time stored function execution will be canceled and exception raised.

To cancel stored function execution use TADAdaptedDataSet.AbortJob.

Before stored function execution the BeforeExecute event is fired. If server will return stored function execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After stored function execution is finished, AfterExecute event is fired.

ExecFunc returns the stored function value.

Syntax
function ExecFunc(const AProcName: String; const AParams: array of Variant; const ATypes: array of TFieldType): Variant; overload;
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
var
  v: Variant;
...
v := ADStoredProc1.ExecFunc('myfunc', [100, 'qweqwe'], [ftInteger, ftWideString]);
What do you think about this topic? Send feedback!


TADCustomStoredProc.ExecProc Method ()

TADCustomStoredProc.ExecProc Method ()
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified stored procedure in the DBMS session.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example, public, See Also
Description

Call ExecProc to execute a stored procedure in the DBMS session, using the currently assigned stored procedure name. Use ExecProc to execute stored procedures, that do not return a cursor to data.

Before calling ExecProc, assing stored procedure name to the CatalogName, SchemaName, PackageName, StoredProcName, Overload properties. Then if fiMeta in FetchOptions.Items, then call Prepare method. After that Params property will be filled by parameters. Otherwise, if fiMeta is not in FetchOptions.Items, provide correct set of parameters in the Params property, then call Prepare method. After that SQL statement, calling stored procedure, is built and parameters are binded.

Then assign values to the input parameters and call ExecProc. After return from ExecProc you can read output parameter values.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum stored procedure execution time. After that time stored procedure execution will be canceled and exception raised.

To cancel stored procedure execution use TADAdaptedDataSet.AbortJob.

Before stored procedure execution the BeforeExecute event is fired. If server will return stored procedure execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After stored procedure execution is finished, AfterExecute event is fired.

Syntax
procedure ExecProc; overload;
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
ADStoredProc1.StoredProcName := 'myproc';
ADStoredProc1.Prepare;
ADStoredProc1.ParamByName('inval').Value := 100;
ADStoredProc1.ExecProc;
ShowMessage(ADStoredProc1.ParamByName('outval').AsString);
What do you think about this topic? Send feedback!


TADCustomStoredProc.ExecProc Method (String)

TADCustomStoredProc.ExecProc Method (String)
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified stored procedure in the DBMS session.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AProcName: String | A stored procedure name.
Returns

The number of updated rows, if any.

Description

Call ExecProc to execute a stored procedure in the DBMS session, specified in AProcName or is currently assigned to the StoredProcName property, if AProcName is empty. Use ExecProc to execute stored procedures, that do not return a cursor to data and does not have parameters.

Before calling ExecProc, assing stored procedure additional name parts to the CatalogName, SchemaName, PackageName properties. As part of the ExecProc call the SQL statement calling the stored procedure is built. AProcName may include overload number specified after ';'.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum stored procedure execution time. After that time stored procedure execution will be canceled and exception raised.

To cancel stored procedure execution use TADAdaptedDataSet.AbortJob.

Before stored procedure execution the BeforeExecute event is fired. If server will return stored procedure execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After stored procedure execution is finished, AfterExecute event is fired.

Syntax
function ExecProc(const AProcName: String): LongInt; overload;
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
ADStoredProc1.ExecProc('myproc');
What do you think about this topic? Send feedback!


TADCustomStoredProc.ExecProc Method (String, array of Variant)

TADCustomStoredProc.ExecProc Method (String, array of Variant)
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Executes the specified stored procedure and assigns parameter values for the stored proc arguments.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
const AProcName: String | A stored procedure name.
const AParams: array of Variant | An open array of parameter values.
Returns

The number of updated rows, if any.

Description

Call ExecProc to execute a stored procedure in the DBMS session, specified in AProcName or is currently assigned to the StoredProcName property, if AProcName is empty. Use ExecProc to execute stored procedures, that do not return a cursor to data.

Before calling ExecProc, assing stored procedure additional name parts to the CatalogName, SchemaName, PackageName properties. As part of the ExecProc call the SQL statement calling the stored procedure is built, the parameters are binded, and the AParams values are assigned to the input parameters. AProcName may include overload number specified after ';'.

After return from ExecProc you can read output parameter values.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum stored procedure execution time. After that time stored procedure execution will be canceled and exception raised.

To cancel stored procedure execution use TADAdaptedDataSet.AbortJob.

Before stored procedure execution the BeforeExecute event is fired. If server will return stored procedure execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After stored procedure execution is finished, AfterExecute event is fired.

Syntax
function ExecProc(const AProcName: String; const AParams: array of Variant): LongInt; overload;
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example 1
ADStoredProc1.ExecProc('myproc;2', [100, 'qweqwe']);
Example 2
ADStoredProc1.StoredProcName := 'myproc';
ADStoredProc1.Overload := 2;
ADStoredProc1.ExecProc('', [100, 'qweqwe']);
ADStoredProc1.ExecProc('', [101, 'asdasd']);
ADStoredProc1.ExecProc('', [102, 'zxczxc']);
What do you think about this topic? Send feedback!


TADCustomStoredProc.ExecProc Method (String, array of Variant, array of TFieldType)

TADCustomStoredProc.ExecProc Method (String, array of Variant, array of TFieldType)
TADCustomStoredProc Class TADCustomStoredProc Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified stored procedure and assigns parameter data type and values for the stored proc arguments.

Group

public

Links
TADCustomStoredProc Class, TADCustomStoredProc Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const AProcName: String | A stored procedure name.
const AParams: array of Variant | An open array of parameter values.
const ATypes: array of TFieldType | An open array of parameter data types.
Returns

The number of updated rows, if any.

Description

Call ExecProc to execute a stored procedure in the DBMS session, specified in AProcName or is currently assigned to the StoredProcName property, if AProcName is empty. Use ExecProc to execute stored procedures, that do not return a cursor to data.

Before calling ExecProc, assing stored procedure additional name parts to the CatalogName, SchemaName, PackageName properties. As part of the ExecProc call the SQL statement calling the stored procedure is built, the parameters data types are assigned and binded, and the AParams values are assigned to the input parameters. AProcName may include overload number specified after ';'.

After return from ExecProc you can read output parameter values.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum stored procedure execution time. After that time stored procedure execution will be canceled and exception raised.

To cancel stored procedure execution use TADAdaptedDataSet.AbortJob.

Before stored procedure execution the BeforeExecute event is fired. If server will return stored procedure execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After stored procedure execution is finished, AfterExecute event is fired.

Syntax
function ExecProc(const AProcName: String; const AParams: array of Variant; const ATypes: array of TFieldType): LongInt; overload;
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
ADStoredProc1.ExecProc('myproc', [100, 'qweqwe'], [ftInteger, ftWideString]);
What do you think about this topic? Send feedback!


TADCustomTransaction Class

TADCustomTransaction Class
public TADCustomTransaction Members Classes See Also Send Feedback

The class is responsible for connection transaction management.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomTransaction
File

uADCompClient

Links
public, TADCustomTransaction Members, Classes, See Also
Description

Use TADCustomTransaction to manage transactions in a connection to a DBMS.

The component, at first, is target to Interbase / Firebird client application developers. Because these DBMS's are supporting multiple active transactions per a connection. If a DBMS does not support this feature, then multiple TADCustomTransaction objects on the same connection will share control under the same single transaction. Also, the application may use TADCustomConnection transaction control methods.

This class hides some of properties, allowing to control visibility of properties by descendant classes. End users should use TADTransaction.

Syntax
TADCustomTransaction = class(TADComponent, IADPhysTransactionStateHandler);
See Also

Managing Transactions, Establishing Connection, TADTransaction, TADCustomConnection

What do you think about this topic? Send feedback!


TADCustomTransaction Members

TADCustomTransaction Members
Events TADCustomTransaction Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomTransaction.

Events
Event | Description
AfterCommit | Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
Class

TADCustomTransaction Class

Methods
Method | Description
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.
Properties
Property | Description
Active | Indicates whether a database transaction is in progress or not.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
DataSetCount | Returns the number of datasets associated with this transaction.
DataSets | Returns the dataset associated with this transaction by it index.
Options | The set of options controlling transactions behaviour.
TransactionIntf | Returns IADPhysTransaction interface.
Links
Events, TADCustomTransaction Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
Events TADCustomTransaction Class Legend Methods Properties Send Feedback

The public members of the TADCustomTransaction class are listed here.

Events
Event | Description
AfterCommit | Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
Class

TADCustomTransaction Class

Methods
Method | Description
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.
Properties
Property | Description
Active | Indicates whether a database transaction is in progress or not.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
DataSetCount | Returns the number of datasets associated with this transaction.
DataSets | Returns the dataset associated with this transaction by it index.
Options | The set of options controlling transactions behaviour.
TransactionIntf | Returns IADPhysTransaction interface.
Links
Events, TADCustomTransaction Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomTransaction.Active Property

TADCustomTransaction.Active Property
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Indicates whether a database transaction is in progress or not.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

Examine Active at run-time to determine if a database transaction is currently in progress. Active is True if a transaction is in progress, False otherwise.

The value of Active cannot be changed directly. Calling StartTransaction sets Active to True. Calling Commit or Rollback sets Active to False.

Syntax
property Active: Boolean;
See Also

StartTransaction, Commit, Rollback

What do you think about this topic? Send feedback!


TADCustomTransaction.AfterCommit Event

TADCustomTransaction.AfterCommit Event
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Syntax
property AfterCommit: TNotifyEvent;
See Also

BeforeCommit

What do you think about this topic? Send feedback!


TADCustomTransaction.AfterRollback Event

TADCustomTransaction.AfterRollback Event
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Fires after transaction is rolled back.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

The AfterRollback event fires after the Rollback method is executed and the transaction is rolled back. In case of a nested transaction in AfterRollback event handler the transaction is not yet rolled back in full, but nesting level is decremented.

Syntax
property AfterRollback: TNotifyEvent;
See Also

BeforeRollback

What do you think about this topic? Send feedback!


TADCustomTransaction.AfterStartTransaction Event

TADCustomTransaction.AfterStartTransaction Event
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Fires after transaction is started.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

The AfterStartTransaction event fires after the StartTransaction method is executed and the transaction is started. In case of a nested transaction in AfterStartTransaction event handler the transaction is not just started, but nesting level is incremented.

Syntax
property AfterStartTransaction: TNotifyEvent;
See Also

BeforeStartTransaction

What do you think about this topic? Send feedback!


TADCustomTransaction.BeforeCommit Event

TADCustomTransaction.BeforeCommit Event
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Fires before transaction will be committed.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

The BeforeCommit event fires before the Commit method will be executed and the transaction will be committed.

Syntax
property BeforeCommit: TNotifyEvent;
See Also

AfterCommit

What do you think about this topic? Send feedback!


TADCustomTransaction.BeforeRollback Event

TADCustomTransaction.BeforeRollback Event
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Fires before transaction will be rolled back.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

The BeforeRollback event fires before the Rollback method will be executed and the transaction will be rolled back.

Syntax
property BeforeRollback: TNotifyEvent;
See Also

AfterRollback

What do you think about this topic? Send feedback!


TADCustomTransaction.BeforeStartTransaction Event

TADCustomTransaction.BeforeStartTransaction Event
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Fires before transaction will be started.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

The BeforeStartTransaction event fires before the StartTransaction method will be executed and the transaction will be started.

Syntax
property BeforeStartTransaction: TNotifyEvent;
See Also

AfterStartTransaction

What do you think about this topic? Send feedback!


TADCustomTransaction.Connection Property

TADCustomTransaction.Connection Property
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Specifies the connection component that actually forms the connection to the DBMS.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

Set Connection to the connection component that establishes a connection to the DBMS. If to change Connection property value, while transaction is active, an exception will be raised.

Syntax
property Connection: TADCustomConnection;
See Also

Active

What do you think about this topic? Send feedback!


TADCustomTransaction.DataSetCount Property

TADCustomTransaction.DataSetCount Property
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Returns the number of datasets associated with this transaction.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

Returns the number of datasets whose TADRdbmsDataSet.Transaction property points to this transaction.

Syntax
property DataSetCount: Integer;
See Also

TADRdbmsDataSet.Transaction, DataSets

What do you think about this topic? Send feedback!


TADCustomTransaction.DataSets Property

TADCustomTransaction.DataSets Property
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Returns the dataset associated with this transaction by it index.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

Returns the dataset whose TADRdbmsDataSet.Transaction property points to this transaction by dataset index.

Syntax
property DataSets [AIndex: Integer]: TADDataSet;
See Also

DataSetCount

What do you think about this topic? Send feedback!


TADCustomTransaction.Options Property

TADCustomTransaction.Options Property
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace Example public See Also Send Feedback

The set of options controlling transactions behaviour.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, Example, public, See Also
Description

The Options property returns reference to object, consisting of the set of options, controlling transactions behavior. Changing options will not take immediate effect, it is deferred until first transaction control statement.

Syntax
property Options: TADTxOptions;
See Also

StartTransaction, Commit, Rollback

Example
ADTransaction1.Options.ReadOnly := True;
ADTransaction1.StartTransaction;
What do you think about this topic? Send feedback!


TADCustomTransaction.TransactionIntf Property

TADCustomTransaction.TransactionIntf Property
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Returns IADPhysTransaction interface.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

The TransactionIntf property returns the reference to the IADPhysTransaction interface. It is not nil, if the connection is active. Otherwise it is nil. It is not recommended to mix usage of TADCustomTransaction API and TADCustomTransaction.TransactionIntf API.

Syntax
property TransactionIntf: IADPhysTransaction;
See Also

IADPhysTransaction

What do you think about this topic? Send feedback!


TADCustomTransaction.Commit Method

TADCustomTransaction.Commit Method
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace Example public See Also Send Feedback

Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, Example, public, See Also
Description

Call Commit to permanently store modifications, like a INSERT's / UPDATE's / DELETE's, made in current transaction to the database.

FireDAC supports nested transactions, so the current transaction is the one started with most recent StartTransaction call. If the database does not support nested transactions, like most of DBMS's, then FireDAC will emulate nested transactions using savepoints.

Before calling Commit, an application may check the status of the Active property. If an application calls Commit and there is no current transaction, an exception is raised.

A Commit call on Interbase / Firebird will close and unprepare all datasets and commands, associated with this transaction object. On some other DBMS's a call will invalidate all active result sets. For example, on MS SQL Server 2005.

Syntax
procedure Commit;
See Also

Managing Transactions, StartTransaction, Active, Rollback, CommitRetaining

Example
procedure TForm1.ChangeButtonClick(Sender: TObject);
begin
  ADQuery1.Transaction := ADTransaction1;
  ADQuery1.SQL.Text := 'update employees set salary = salary * :k where id = :id';
  ADTransaction1.StartTransaction;
  try
    ADQuery1.ExecSQL('', [1.2, 100]);
    ADQuery1.ExecSQL('', [1.3, 200]);
    ADTransaction1.Commit;
  except
    ADTransaction1.Rollback;
    raise;
  end;
end;
What do you think about this topic? Send feedback!


TADCustomTransaction.CommitRetaining Method

TADCustomTransaction.CommitRetaining Method
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace Example public See Also Send Feedback

Permanently stores modifications to the data made in the current transaction, without ending the current transaction.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, Example, public, See Also
Description

Call CommitRetaining to permanently store modifications, like a INSERT's / UPDATE's / DELETE's, made in current transaction to the database without finishing transaction.

FireDAC supports nested transactions, so the current transaction is the one started with most recent StartTransaction call. If the database does not support nested transactions, like most of DBMS's, then FireDAC will emulate nested transactions using savepoints. CommitRetaining is usefull only for main transaction, not for nested ones.

Before calling CommitRetaining, an application may check the status of the Active property. If an application calls CommitRetaining and there is no current transaction, an exception is raised.

CommitRetaining will use native functionality on IB/FB. On other DBMS's the method will be equal to calls of Commit, then of StartTransaction.

Syntax
procedure CommitRetaining;
See Also

Managing Transactions, StartTransaction, Active, Rollback, Commit

Example
procedure TForm1.ChangeButtonClick(Sender: TObject);
begin
  ADQuery1.Transaction := ADTransaction1;
  ADQuery1.SQL.Text := 'select * from employees';

  ADQuery2.Transaction := ADTransaction1;
  ADQuery2.SQL.Text := 'update employees set salary = salary * :k where id = :id';

  ADTransaction1.StartTransaction;
  try
    ADQuery1.Open;
    while not ADQuery1.Eof do begin
      ADQuery2.ExecSQL('', [1.2, ADQuery1.FieldByName('id').AsInteger]);
      ADTransaction1.CommitRetaining;
      ADQuery1.Next;
    end;
    ADTransaction1.Commit;
  except
    ADTransaction1.Rollback;
    raise;
  end;
end;
What do you think about this topic? Send feedback!


TADCustomTransaction.Rollback Method

TADCustomTransaction.Rollback Method
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace Example public See Also Send Feedback

Cancels all modifications to the data made in the current transaction and optionally ends transaction.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, Example, public, See Also
Description

Call Rollback to cancel all modifications, like a INSERT's / UPDATE's / DELETE's, made in current transaction to the database.

FireDAC supports nested transactions, so the current transaction is the one started with most recent StartTransaction call. If the database does not support nested transactions, like most of DBMS's, then FireDAC will emulate nested transactions using savepoints.

Before calling Rollback, an application may check the status of the Active property. If an application calls Rollback and there is no current transaction, an exception is raised.

Rollback call on Interbase / Firebird will close and unprepare all datasets and commands, associated with this transaction object. On some other DBMS's a call will invalidate all active result sets. For example, on MS SQL Server 2005.

Syntax
procedure Rollback;
See Also

Managing Transactions, StartTransaction, Active, Commit, RollbackRetaining

Example
procedure TForm1.ChangeButtonClick(Sender: TObject);
begin
  ADQuery1.Transaction := ADTransaction1;
  ADQuery1.SQL.Text := 'update employees set salary = salary * :k where id = :id';
  ADTransaction1.StartTransaction;
  try
    ADQuery1.ExecSQL('', [1.2, 100]);
    ADQuery1.ExecSQL('', [1.3, 200]);
    ADTransaction1.Commit;
  except
    ADTransaction1.Rollback;
    raise;
  end;
end;
What do you think about this topic? Send feedback!


TADCustomTransaction.RollbackRetaining Method

TADCustomTransaction.RollbackRetaining Method
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace public See Also Send Feedback

Cancels all modifications to the data made in the current transaction, without ending the current transaction.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, public, See Also
Description

Call RollbackRetaining to cancel all modifications, like a INSERT's / UPDATE's / DELETE's, made in current transaction to the database.

FireDAC supports nested transactions, so the current transaction is the one started with most recent StartTransaction call. If the database does not support nested transactions, like most of DBMS's, then FireDAC will emulate nested transactions using savepoints.

Before calling RollbackRetaining, an application may check the status of the Active property. If an application calls RollbackRetaining and there is no current transaction, an exception is raised.

RollbackRetaining will use native functionality on IB/FB. On other DBMS's the method will be equal to calls of Rollback, then of StartTransaction.

Syntax
procedure RollbackRetaining;
See Also

Managing Transactions, StartTransaction, InTransaction, Commit, Rollback

What do you think about this topic? Send feedback!


TADCustomTransaction.StartTransaction Method

TADCustomTransaction.StartTransaction Method
TADCustomTransaction Class TADCustomTransaction Members uADCompClient Namespace Example public See Also Send Feedback

Starts new transaction at database.

Group

public

Links
TADCustomTransaction Class, TADCustomTransaction Members, uADCompClient Namespace, Example, public, See Also
Description

Call StartTransaction to start a new transaction at the DBMS.

The FireDAC supports nested transactions. If DBMS does not support nested transactions, then FireDAC will emulate them using savepoints. If transaction is already active, then FireDAC will put savepoint, otherwise will start new transaction. Use Options.EnableNested to enable / disable nested transactions.

Before calling StartTransaction, an application may adjust settings of the Options property as desired. Adjusting options after transaction is started does not affect current transaction.

All data modifications, like a INSERT's / UPDATE's / DELETE's, made after a call of StartTransaction, may be either confirmed by calling Commit, either undone by calling Rollback.

Some DBMS's will fail to start transaction, if there are active result sets. For example, MS SQL Server 2005.

Syntax
procedure StartTransaction;
See Also

Managing Transactions, Active, Commit, Rollback, Options

Example
procedure TForm1.ChangeButtonClick(Sender: TObject);
begin
  ADQuery1.Transaction := ADTransaction1;
  ADQuery1.SQL.Text := 'select * from employees';

  ADQuery2.Transaction := ADTransaction1;
  ADQuery2.SQL.Text := 'update employees set salary = salary * :k where id = :id';

  ADTransaction1.Options.Isolation := xiRepeatableRead;
  ADTransaction1.StartTransaction;
  try
    ADQuery1.Open;
    while not ADQuery1.Eof do begin
      ADQuery2.ExecSQL('', [1.2, ADQuery1.FieldByName('id').AsInteger]);
      ADTransaction1.CommitRetaining;
      ADQuery1.Next;
    end;
    ADTransaction1.Commit;
  except
    ADTransaction1.Rollback;
    raise;
  end;
end;
What do you think about this topic? Send feedback!


TADCustomUpdateObject Class

TADCustomUpdateObject Class
public TADCustomUpdateObject Members Classes See Also Send Feedback

The base class for update objects used to override updates posting.

Group

Classes

Class Hierarchy
  uADCompClient_TADCustomUpdateObject
File

uADCompClient

Links
public, TADCustomUpdateObject Members, Classes, See Also
Description

Use TADCustomUpdateObject as a base class when creating customized update objects that applies dataset updates the a database.

Syntax
TADCustomUpdateObject = class(TADComponent);
See Also

Overriding Posting Updates, TADUpdateSQL

What do you think about this topic? Send feedback!


TADCustomUpdateObject Members

TADCustomUpdateObject Members
TADCustomUpdateObject Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomUpdateObject.

Class

TADCustomUpdateObject Class

Methods
Method | Description
Apply | Applies record update request to DB for current record in DataSet.
Properties
Property | Description
DataSet | Identifies the dataset on which change log update object will operate.
Links
TADCustomUpdateObject Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADCustomUpdateObject Class Legend Methods Properties Send Feedback

The public members of the TADCustomUpdateObject class are listed here.

Class

TADCustomUpdateObject Class

Methods
Method | Description
Apply | Applies record update request to DB for current record in DataSet.
Properties
Property | Description
DataSet | Identifies the dataset on which change log update object will operate.
Links
TADCustomUpdateObject Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomUpdateObject.DataSet Property

TADCustomUpdateObject.DataSet Property
TADCustomUpdateObject Class TADCustomUpdateObject Members uADCompClient Namespace public See Also Send Feedback

Identifies the dataset on which change log update object will operate.

Group

public

Links
TADCustomUpdateObject Class, TADCustomUpdateObject Members, uADCompClient Namespace, public, See Also
Description

TADCustomUpdateObject uses the DataSet property for two purposes:

  • It fetches the original and updated field values from this dataset when performing parameter substitution.
  • If this dataset is a TADRdbmsDataSet descendant, it uses its Connection and ConnectionName properties to identify the connection that it uses when performing its update queries.

If you are using a single update object, then the DataSet property is set automatically when you set the source dataset's UpdateObject property. If you are using multiple update objects, you must set the DataSet property at runtime in an OnUpdateRecord event handler.

Syntax
property DataSet: TADAdaptedDataSet;
See Also

TADDataSet.OnUpdateRecord, TADRdbmsDataSet.Connection, TADRdbmsDataSet.ConnectionName

What do you think about this topic? Send feedback!


TADCustomUpdateObject.Apply Method

TADCustomUpdateObject.Apply Method
TADCustomUpdateObject Class TADCustomUpdateObject Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Applies record update request to DB for current record in DataSet.

Group

public

Links
TADCustomUpdateObject Class, TADCustomUpdateObject Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
ARequest: TADUpdateRequest | A record update request.
var AAction: TADErrorAction | A completion status.
AOptions: TADUpdateRowOptions | An additional request options.
Description

Call Apply to apply changes of current DataSet record to database.

Standard implementation - TADUpdateSQL - sets parameters for a SQL statement and executes it to update a record. ARequest indicates the update kind, so for TADUpdateSQL specifies which SQL statement to execute. If appropriate SQL statement is not specified, then FireDAC will generate default one, as it is doing when TADAdaptedDataSet.UpdateObject is not specified.

Apply is primarily intended for manually executing update statements from an OnUpdateRecord event handler. There event handler ARequest, AAction and AOptions argument values must be assigned to Apply method corresponding arguments.

ARequest can be one of the following values:

Value | Meaning | TADUpdateSQL SQL property
arInsert | Insert record to database. | InsertSQL
arUpdate | Update record in database. | ModifySQL
arDelete | Delete record from database. | DeleteSQL
arLock | Lock record in database. | LockSQL
arUnlock | Release record lock in database. | UnlockSQL
arFetchRow | Refetch record from database. | FetchRowSQL
arUpdateHBlobs | Update Oracle BLOB/CLOB values in database. | -
arFetchGenerators | Fetch generator values to put into record. | -

AAction returns Apply method completion status, specifying what action should take the calling code. Normally this status is used by FireDAC code. When Apply method is called from OnUpdateRecord event handler, then assign AAction event handler argument to the AAction Apply method argument. Otherwise use eaDefault as initial value.

AOptions specifies additional options. When Apply method is called from OnUpdateRecord event handler, then assign AOptions event handler argument to the AOptions Apply method argument. Otherwise use [] as a value.

Syntax
procedure Apply(ARequest: TADUpdateRequest; var AAction: TADErrorAction; AOptions: TADUpdateRowOptions); virtual; abstract;
See Also

Overriding Posting Updates, TADUpdateSQL, TADAdaptedDataSet.UpdateObject

Example 1
procedure TfrmCachedUpdates.qrProductsUpdateRecord(ASender: TDataSet;
  ARequest: TADUpdateRequest; var AAction: TADErrorAction;
  AOptions: TADUpdateRowOptions);
begin
  usProducts.ConnectionName := qrProducts.ConnectionName;
  usProducts.DataSet := qrProducts;
  usProducts.Apply(ARequest, AAction, AOptions);

  usCategories.ConnectionName := qrProducts.ConnectionName;
  usCategories.DataSet := qrProducts;
  usCategories.Apply(ARequest, AAction, AOptions);

  AAction := eaApplied;
end;
Example 2

See FireDAC\Samples\Comp Layer\TADUpdateSQL\Main demo application.

What do you think about this topic? Send feedback!


TADEventAlerter Class

TADEventAlerter Class
published TADEventAlerter Members Example 1 Example 2 Classes See Also Send Feedback

The class is responsible for handling the database event notifications.

Group

Classes

Class Hierarchy
  uADCompClient_TADEventAlerteruADCompClient_TADEventAlerter
File

uADCompClient

Links
published, TADEventAlerter Members, Example 1, Example 2, Classes, See Also
Description

Use the TADEventAlerter class to handle the database event notifications.

The kind and general behavior of the events is DBMS specific. But TADEventAlerter provides unified way for handling them.

Syntax
TADEventAlerter = class(TADCustomEventAlerter);
See Also

Database Alerts, TADCustomEventAlerter

Example 1
ADEventAlerter1.Options.Kind := 'DBMS_ALERT';
ADEventAlerter1.Names.Text := 'Customers';
ADEventAlerter1.Options.Synchronize := True;
ADEventAlerter1.Options.Timeout := 10000;
ADEventAlerter1.OnAlter := DoAlert;
ADEventAlerter1.OnTimeout := DoTimeout;
ADEventAlerter1.Active := True;
........

procedure TForm1.DoAlert(ASender: TADCustomEventAlerter;
  const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh;
end;

procedure TForm1.DoTimeout(ASender: TObject);
begin
  qryCustomers.Refresh;
end;
Example 2

See the demo at: FireDAC\Samples\Comp Layer\TADEventAlerter\Main

What do you think about this topic? Send feedback!


TADEventAlerter Members

TADEventAlerter Members
Events TADEventAlerter Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADEventAlerter.

Events
Event | Description
OnAlert | The event fires, when a DBMS event is fired.
OnTimeout | The event fires, when a DBMS event is timed out.
Class

TADEventAlerter Class

Methods
Method | Description
Register | Registers the events with a DBMS.
Signal | Fires a DBMS event.
Unregister | Unregisters the events with a DBMS.
Properties
Property | Description
Active | Controls the event registration state of the event alerter.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
EventAlerterIntf | Returns IADPhysEventAlerter interface.
Names | Specifies the event names handled by this alerter.
Options | The set of even alerter options.
Links
Events, TADEventAlerter Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
Events TADEventAlerter Class Legend Properties Send Feedback

The published members of the TADEventAlerter class are listed here.

Events
Event | Description
OnAlert | The event fires, when a DBMS event is fired.
OnTimeout | The event fires, when a DBMS event is timed out.
Class

TADEventAlerter Class

Properties
Property | Description
Active | Controls the event registration state of the event alerter.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
Names | Specifies the event names handled by this alerter.
Options | The set of even alerter options.
Links
Events, TADEventAlerter Class, Legend, Properties
What do you think about this topic? Send feedback!


TADEventAlerter.Active Property

TADEventAlerter.Active Property
TADEventAlerter Class TADEventAlerter Members uADCompClient Namespace published See Also Send Feedback

Controls the event registration state of the event alerter.

Group

published

Links
TADEventAlerter Class, TADEventAlerter Members, uADCompClient Namespace, published, See Also
Description

Use Active property to set or check when an event alerter has registered the Names events at a DBMS and waiting for events.

Set the Active property to True to register the events at a DBMS and start processing of incoming events. If an FireDAC DBMS driver supports few event alerters, then the event alerter kind must be explicitly assigned to the Options.Kind.

Set the property to False to stop processing of the events.

Syntax
property Active: Boolean;
See Also

Database Alerts, Names, Register, Unregister

What do you think about this topic? Send feedback!


TADEventAlerter.Connection Property

TADEventAlerter.Connection Property
TADEventAlerter Class TADEventAlerter Members uADCompClient Namespace published See Also Send Feedback

Specifies the connection component that actually forms the connection to the DBMS.

Group

published

Links
TADEventAlerter Class, TADEventAlerter Members, uADCompClient Namespace, published, See Also
Description

Set Connection to the connection component that establishes a connection to the DBMS. If to change Connection property value, while an even alerter is active, then it will unregister his events.

Syntax
property Connection: TADCustomConnection;
See Also

Names, Register

What do you think about this topic? Send feedback!


TADEventAlerter.Names Property

TADEventAlerter.Names Property
TADEventAlerter Class TADEventAlerter Members uADCompClient Namespace Example published See Also Send Feedback

Specifies the event names handled by this alerter.

Group

published

Links
TADEventAlerter Class, TADEventAlerter Members, uADCompClient Namespace, Example, published, See Also
Description

Use the Names property to specify the event names.

The event alerter will be notified only about the listed events. Note, that the Oracle DBMS_PIPE event alerter supports only a single event name. The event names may be case-sensitive or case-insensitive, depending on a DBMS.

Syntax
property Names: TStrings;
See Also

Database Alerts, Register, Active

Example
with ADEventAlerter1 do begin
  Unregister;
  Names.Clear;
  Names.Add('Customers');
  Names.Add('Orders');
  Register;
end;
What do you think about this topic? Send feedback!


TADEventAlerter.OnAlert Event

TADEventAlerter.OnAlert Event
TADEventAlerter Class TADEventAlerter Members uADCompClient Namespace Example published See Also Send Feedback

The event fires, when a DBMS event is fired.

Group

published

Links
TADEventAlerter Class, TADEventAlerter Members, uADCompClient Namespace, Example, published, See Also
Description

Use the OnAlert event handler to specify an event handler, which will be fired when one of the specified in the Names DBMS events is fired. To start receive event notifications, the events must be registered using the Register method or the Active property. The event handler may be fired in the own event alerter thread (False) or in the main application thread (True), depending on the Options.Synchronize option.

The event handler receives three arguments:

  • ASender is the event alerter reference;
  • AEventName specifies the name of the event;
  • AArgument specifies the additional arguments to the event. The arguments are fully DBMS and application dependent. There must be a Null or Unassigned value, if no arguments are specified. The scalar variant value, when only single argument is specified. Or an variant array of values.
Syntax
property OnAlert: TADEventAlerterEvent;
See Also

Database Alerts, OnTimeout, Names

Example
procedure TForm1.ADEventAlerter1Alert(ASender: TADCustomEventAlerter;
    const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh
  else if CompareText(AEventName, 'Orders') = 0 then
    qryOrders.Refresh;
end;
What do you think about this topic? Send feedback!


TADEventAlerter.OnTimeout Event

TADEventAlerter.OnTimeout Event
TADEventAlerter Class TADEventAlerter Members uADCompClient Namespace published See Also Send Feedback

The event fires, when a DBMS event is timed out.

Group

published

Links
TADEventAlerter Class, TADEventAlerter Members, uADCompClient Namespace, published, See Also
Description

Use the OnTimeout event handler to specify an event handler, which will be fired after the specified by the Options.Timeout time and no one event is fired. The specified timeout is in 1/1000 of sec.The event handler may be fired in the own event alerter thread (False) or in the main application thread (True), depending on the Options.Synchronize option.

Syntax
property OnTimeout: TNotifyEvent;
See Also

Database Alerts, OnAlert, Options

What do you think about this topic? Send feedback!


TADEventAlerter.Options Property

TADEventAlerter.Options Property
TADEventAlerter Class TADEventAlerter Members uADCompClient Namespace published See Also Send Feedback

The set of even alerter options.

Group

published

Links
TADEventAlerter Class, TADEventAlerter Members, uADCompClient Namespace, published, See Also
Description

Use the Options property to specify the different aspects of even handling.

Syntax
property Options: TADEventAlerterOptions;
See Also

Database Alerts, TADEventAlerterOptions

What do you think about this topic? Send feedback!


TADLocalSQLDataSet Class

TADLocalSQLDataSet Class
public published TADLocalSQLDataSet Members Classes See Also Send Feedback

TADLocalSQLDataSet represents a dataset registered with Local SQL engine.

Group

Classes

Class Hierarchy
  uADCompClient_TADLocalSQLDataSet
File

uADCompClient

Links
public, published, TADLocalSQLDataSet Members, Classes, See Also
Description

Use TADLocalSQLDataSet to create and maintain information about a dataset registered with Local SQL engine.

TADLocalSQLDataSet are collected into TADLocalSQLDataSets collection. The set of TADLocalSQLDataSet may be created explicitly as at design time, as at run time. Also implicitly by setting TADAdaptedDataSet.LocalSQL property value. Implicitly created items have Temporary property as True and they will not be stored in DFM.

DataSet property specifies the dataset to register. Name property specifies alternative name for the dataset.

Syntax
TADLocalSQLDataSet = class(TCollectionItem);
See Also

Local SQL, TADLocalSQLDataSets, TADCustomLocalSQL, TADAdaptedDataSet.LocalSQL

What do you think about this topic? Send feedback!


TADLocalSQLDataSet Members

TADLocalSQLDataSet Members
TADLocalSQLDataSet Class Legend Properties Send Feedback

The following tables list the members exposed by TADLocalSQLDataSet.

Class

TADLocalSQLDataSet Class

Properties
Property | Description
ActualName | Returns actual dataset name.
Adapter | Specifies a dataset reference for the Local SQL engine.
DataSet | Specifies a dataset reference for the Local SQL engine.
IsValid | Returns True, if dataset may be registered.
Name | Specifies alternative dataset name.
Temporary | Designates implicitly registered datasets.
Links
TADLocalSQLDataSet Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADLocalSQLDataSet Class Legend Properties Send Feedback

The public members of the TADLocalSQLDataSet class are listed here.

Class

TADLocalSQLDataSet Class

Properties
Property | Description
ActualName | Returns actual dataset name.
Adapter | Specifies a dataset reference for the Local SQL engine.
IsValid | Returns True, if dataset may be registered.
Links
TADLocalSQLDataSet Class, Legend, Properties
What do you think about this topic? Send feedback!


TADLocalSQLDataSet.ActualName Property

TADLocalSQLDataSet.ActualName Property
TADLocalSQLDataSet Class TADLocalSQLDataSet Members uADCompClient Namespace public See Also Send Feedback

Returns actual dataset name.

Group

public

Links
TADLocalSQLDataSet Class, TADLocalSQLDataSet Members, uADCompClient Namespace, public, See Also
Description

Use ActualName property to get a name, which will be used to register dataset.

It is Name value, when it is specified. Otherwise DataSet.Name, when DataSet is specified. Otherwise is empty string.

Syntax
property ActualName: String;
See Also

Name, DataSet

What do you think about this topic? Send feedback!


TADLocalSQLDataSet.Adapter Property

TADLocalSQLDataSet.Adapter Property
TADLocalSQLDataSet Class TADLocalSQLDataSet Members uADCompClient Namespace public See Also Send Feedback

Specifies a dataset reference for the Local SQL engine.

Group

public

Links
TADLocalSQLDataSet Class, TADLocalSQLDataSet Members, uADCompClient Namespace, public, See Also
Description

Use Adapter property to set a reference to a dataset adapter. A adapter is an COM interface providing additional dataset services to Local SQL engine.

FireDAC datasets are implementing this interface and do not require specify adapter. It is recommended to specify adapter for non-FireDAC datasets, although it is optional.

Syntax
property Adapter: IADPhysLocalQueryAdapter;
See Also

Local SQL, DataSet

What do you think about this topic? Send feedback!


TADLocalSQLDataSet.IsValid Property

TADLocalSQLDataSet.IsValid Property
TADLocalSQLDataSet Class TADLocalSQLDataSet Members uADCompClient Namespace public See Also Send Feedback

Returns True, if dataset may be registered.

Group

public

Links
TADLocalSQLDataSet Class, TADLocalSQLDataSet Members, uADCompClient Namespace, public, See Also
Description

Use IsValid property to check that the dataset may be registered. It is possible, when DataSet is not nil, ActualName is not empty.

Syntax
property IsValid: Boolean;
See Also

DataSet, ActualName

What do you think about this topic? Send feedback!


published

published
TADLocalSQLDataSet Class Legend Properties Send Feedback

The published members of the TADLocalSQLDataSet class are listed here.

Class

TADLocalSQLDataSet Class

Properties
Property | Description
DataSet | Specifies a dataset reference for the Local SQL engine.
Name | Specifies alternative dataset name.
Temporary | Designates implicitly registered datasets.
Links
TADLocalSQLDataSet Class, Legend, Properties
What do you think about this topic? Send feedback!


TADLocalSQLDataSet.DataSet Property

TADLocalSQLDataSet.DataSet Property
TADLocalSQLDataSet Class TADLocalSQLDataSet Members uADCompClient Namespace published See Also Send Feedback

Specifies a dataset reference for the Local SQL engine.

Group

published

Links
TADLocalSQLDataSet Class, TADLocalSQLDataSet Members, uADCompClient Namespace, published, See Also
Description

Use DataSet property to set a reference to a dataset and register it with the Local SQL engine.

The dataset may be any one TDataSet descendant. For non-FireDAC datasets is recommended also set Adapter property. If Name property value is specified, then it will be used a dataset name. Otherwise, TDataSet.Name will be used.

When dataset is specified and Local SQL engine is activated, then FireDAC will open the dataset, if it is closed. For in-memory datasets this means, that their structure must be defined before activating Local SQL engine or setting DataSet property.

Syntax
property DataSet: TDataSet;
See Also

Local SQL, Name, Adapter

What do you think about this topic? Send feedback!


TADLocalSQLDataSet.Name Property

TADLocalSQLDataSet.Name Property
TADLocalSQLDataSet Class TADLocalSQLDataSet Members uADCompClient Namespace published See Also Send Feedback

Specifies alternative dataset name.

Group

published

Links
TADLocalSQLDataSet Class, TADLocalSQLDataSet Members, uADCompClient Namespace, published, See Also
Description

Use Name property to specify alternative name for the registered dataset. When Name property is not specified, then DataSet.Name will be used. So, the property value is optional.

When a dataset was created at run-time, then DataSet.Name or Name properties must be specified. When one dataset is registered twice or more, then Name property must be specified to make dataset name unique.

The property value does not have limitations, like DataSet.Name. If the value is a valid SQLite DB identifier, then it may be referenced in Local SQL as is. Otherwise the name must be quoted.

Syntax
property Name: String;
See Also

Local SQL, DataSet

What do you think about this topic? Send feedback!


TADLocalSQLDataSet.Temporary Property

TADLocalSQLDataSet.Temporary Property
TADLocalSQLDataSet Class TADLocalSQLDataSet Members uADCompClient Namespace published Send Feedback

Designates implicitly registered datasets.

Group

published

Links
TADLocalSQLDataSet Class, TADLocalSQLDataSet Members, uADCompClient Namespace, published
Description

The Temporary property is set to True, when FireDAC dataset was registered using TADAdaptedDataSet.LocalSQL property or a dataset was submitted by TADCustomLocalSQL.OnGetDataSet event handler.

Items with Temporary = True are not saved in DFM file at design-time. Also TADLocalSQLDataSets.Remove method deletes corresponding items from a collection.

Syntax
property Temporary: Boolean;
What do you think about this topic? Send feedback!


TADLocalSQLDataSets Class

TADLocalSQLDataSets Class
public TADLocalSQLDataSets Members Classes See Also Send Feedback

TADLocalSQLDataSets is a collection of TADLocalSQLDataSet objects.

Group

Classes

Class Hierarchy
  uADCompClient_TADLocalSQLDataSets
File

uADCompClient

Links
public, TADLocalSQLDataSets Members, Classes, See Also
Description

TADLocalSQLDataSets is a list of all datasets, registered with a Local SQL engine. A single TADLocalSQLDataSet object represents a single registered dataset. The datasets are registered and available for querying when TADCustomLocalSQL.Active is True.

Syntax
TADLocalSQLDataSets = class(TCollection);
See Also

Local SQL, TADLocalSQLDataSet

What do you think about this topic? Send feedback!


TADLocalSQLDataSets Members

TADLocalSQLDataSets Members
TADLocalSQLDataSets Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADLocalSQLDataSets.

Class

TADLocalSQLDataSets Class

Methods
Method | Description
Add | Appends new TADLocalSQLDataSet object to a collection.
Add | Appends new TADLocalSQLDataSet object with specified arguments to a collection.
Remove | Removes dataset registration from the collection.
Properties
Property | Description
Items | Returns TADLocalSQLDataSet object by it index.
Links
TADLocalSQLDataSets Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADLocalSQLDataSets Class Legend Methods Properties Send Feedback

The public members of the TADLocalSQLDataSets class are listed here.

Class

TADLocalSQLDataSets Class

Methods
Method | Description
Add | Appends new TADLocalSQLDataSet object to a collection.
Add | Appends new TADLocalSQLDataSet object with specified arguments to a collection.
Remove | Removes dataset registration from the collection.
Properties
Property | Description
Items | Returns TADLocalSQLDataSet object by it index.
Links
TADLocalSQLDataSets Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADLocalSQLDataSets.Items Property

TADLocalSQLDataSets.Items Property
TADLocalSQLDataSets Class TADLocalSQLDataSets Members uADCompClient Namespace public See Also Send Feedback

Returns TADLocalSQLDataSet object by it index.

Group

public

Links
TADLocalSQLDataSets Class, TADLocalSQLDataSets Members, uADCompClient Namespace, public, See Also
Description

Use Items indexed property to get TADLocalSQLDataSet object by it index.

The property is default one, so you does not need to write ADLocalSQL1.DataSets.Items[i], just ADLocalSQL1.DataSets[i].

Syntax
property Items [AIndex: Integer]: TADLocalSQLDataSet;
See Also

TADLocalSQLDataSet, TCollection.Count

What do you think about this topic? Send feedback!


TADLocalSQLDataSets.Add Method ()

TADLocalSQLDataSets.Add Method ()
TADLocalSQLDataSets Class TADLocalSQLDataSets Members uADCompClient Namespace Example public See Also Send Feedback

Appends new TADLocalSQLDataSet object to a collection.

Group

public

Links
TADLocalSQLDataSets Class, TADLocalSQLDataSets Members, uADCompClient Namespace, Example, public, See Also
Description

Call Add method to add new empty TADLocalSQLDataSet object to a collection.

Syntax
function Add: TADLocalSQLDataSet; overload;
See Also

Items, TCollection.Count

Example
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADQuery1;
  Name := 'Orders';
end;
ADLocalSQL1.Active := True;
What do you think about this topic? Send feedback!


TADLocalSQLDataSets.Add Method (TDataSet, String, IADPhysLocalQueryAdapter)

TADLocalSQLDataSets.Add Method (TDataSet, String, IADPhysLocalQueryAdapter)
TADLocalSQLDataSets Class TADLocalSQLDataSets Members uADCompClient Namespace Example public See Also Send Feedback

Appends new TADLocalSQLDataSet object with specified arguments to a collection.

Group

public

Links
TADLocalSQLDataSets Class, TADLocalSQLDataSets Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ADataSet: TDataSet | A dataset to add. Mandatory.
const AName: String = '' | A dataset name. If not specified, then ADataSet.Name will be used. Optional.
const AAdapter: IADPhysLocalQueryAdapter = nil | A dataset adapter. Optional.
Description

Call Add method to add new TADLocalSQLDataSet object to a collection and set it corresponding properties to the specified arguments.

Syntax
function Add(ADataSet: TDataSet; const AName: String = ''; const AAdapter: IADPhysLocalQueryAdapter = nil): TADLocalSQLDataSet; overload;
See Also

Items, TCollection.Count

Example
ADLocalSQL1.DataSets.Add(ADQuery1, 'Orders');
ADLocalSQL1.Active := True;
What do you think about this topic? Send feedback!


TADLocalSQLDataSets.Remove Method

TADLocalSQLDataSets.Remove Method
TADLocalSQLDataSets Class TADLocalSQLDataSets Members uADCompClient Namespace public Send Feedback

Removes dataset registration from the collection.

Group

public

Links
TADLocalSQLDataSets Class, TADLocalSQLDataSets Members, uADCompClient Namespace, public
Parameters
Parameters | Description
ADataSet: TDataSet | A dataset to remove.
Description

Use Remove method to remove dataset registration from the collection.

Syntax
procedure Remove(ADataSet: TDataSet);
What do you think about this topic? Send feedback!


TADManager Class

TADManager Class
published TADManager Members Classes See Also Send Feedback

The class is responsible to connection definitions and connections management.

Group

Classes

Class Hierarchy
  uADCompClient_TADManageruADCompClient_TADManager
File

uADCompClient

Links
published, TADManager Members, Classes, See Also
Description

Use TADCustomManager to manage connection definitions and connection objects.

Consider accessing the singleton instance of TADManager via ADManager function instead of its explicit creating.

Syntax
TADManager = class(TADCustomManager);
See Also

Defining Connection, TADCustomManager, ADManager

What do you think about this topic? Send feedback!


TADManager Members

TADManager Members
Events TADManager Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADManager.

Events
Event | Description
AfterLoadConnectionDefFile | Fires after connection definitions file is loaded.
AfterShutdown | Fires after manager is finished.
AfterStartup | Fires after manager is started.
BeforeLoadConnectionDefFile | Fires before connection definitions file is loaded.
BeforeShutdown | Fires before manager will be finished.
BeforeStartup | Fires before manager will be started.
Class

TADManager Class

Methods
Method | Description
AddConnectionDef | Adds private connection definition.
Close | Terminates FireDAC manager.
CloseConnectionDef | Closes all connections for a specified connection definition name.
DeleteConnectionDef | Deletes connection definition.
DropConnections | Closes all unused connections.
FindConnection | Find the TADCustomConnection instance with ConnectionName equal to AConnectionName.
GetBaseDriverID | Returns ID of a base driver for the specified driver ID.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetConnectionDefNames | Fills the list by existing connection definition names.
GetConnectionDefParams | Fills the list by connection definition parameters.
GetConnectionNames | Fills the list by connection names.
GetDriverNames | Fills the list by registered driver ID's.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetRDBMSKind | Returns a DBMS kind for the specified driver ID.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
IsConnectionDef | Check if name is connection definition name.
LoadConnectionDefFile | Loads connection definitions file.
ModifyConnectionDef | Modifies parameters of an existing connection definition.
Open | Activates FireDAC manager.
RefreshConnectionDefFile | Refreshes connection definition list.
RefreshMetadataCache | Invalidates meta data cache for all connections.
SaveConnectionDefFile | Saves connection definitions into a file.
Properties
Property | Description
Active | Gets or sets FireDAC manager active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
ActualConnectionDefFileName | Returns expanded connection definition file name.
ActualDriverDefFileName | Returns expanded driver definition file name.
AutoCreated | Is manager object auto created.
CanRefreshConnectionDefFile | Checks if connection definition list may be refreshed.
ConnectionCount | The number of connection objects.
ConnectionDefFileAutoLoad | Controls how connection definitions file must be loaded.
ConnectionDefFileLoaded | Checks is loaded the connection definitions file.
ConnectionDefFileName | Gets / sets the name of a connection definitions file.
ConnectionDefs | The list of connection definitions.
Connections | The application connection objects.
DriverDefFileAutoLoad | Controls how driver definitions file must be loaded.
DriverDefFileName | Gets / sets the name of a driver definitions file.
DriverDefs | The list of driver definitions.
FetchOptions | The "root" fetch options.
FormatOptions | The "root" data format options.
ResourceOptions | The "root" resources control options.
SilentMode | Gets or sets FireDAC global "silent" flag.
State | Returns the current state of FireDAC manager.
UpdateOptions | The "root" data updating options.
WaitCursor | Gets or sets FireDAC wait cursor shape.
Links
Events, TADManager Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
Events TADManager Class Legend Properties Send Feedback

The published members of the TADManager class are listed here.

Events
Event | Description
AfterLoadConnectionDefFile | Fires after connection definitions file is loaded.
AfterShutdown | Fires after manager is finished.
AfterStartup | Fires after manager is started.
BeforeLoadConnectionDefFile | Fires before connection definitions file is loaded.
BeforeShutdown | Fires before manager will be finished.
BeforeStartup | Fires before manager will be started.
Class

TADManager Class

Properties
Property | Description
Active | Gets or sets FireDAC manager active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
ConnectionDefFileAutoLoad | Controls how connection definitions file must be loaded.
ConnectionDefFileName | Gets / sets the name of a connection definitions file.
DriverDefFileAutoLoad | Controls how driver definitions file must be loaded.
DriverDefFileName | Gets / sets the name of a driver definitions file.
FetchOptions | The "root" fetch options.
FormatOptions | The "root" data format options.
ResourceOptions | The "root" resources control options.
SilentMode | Gets or sets FireDAC global "silent" flag.
UpdateOptions | The "root" data updating options.
WaitCursor | Gets or sets FireDAC wait cursor shape.
Links
Events, TADManager Class, Legend, Properties
What do you think about this topic? Send feedback!


TADManager.Active Property

TADManager.Active Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Gets or sets FireDAC manager active status.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

Set Active to True to activate FireDAC manager. After that the State = dmsActive. At activating, ADPhysManager loads driver definition file. When required set DriverDefFileAutoLoad and DriverDefFileName before activating manager. TADCustomConnection automatically activates manager before a first connection.

Set Active to False to terminate FireDAC manager. After that the State = dmsInactive. At terminating, manager:

  • calls TADCustomConnection.Close for all connection objects in application;
  • ADPhysManager waits until all connections interfaces (IADPhysConnection) will be released;
  • unloads DBMS client DLL's and releases internal driver structures.

Note, to change any driver settings, manager may be active or inactive, but there must be no connections through this driver.

We strongly recommend to not close FireDAC manager from within OnLosted, OnRestored, and OnRecover events of TADConnection component, as that can lead to unexpected problems.

A multi-threading application should activate FireDAC manager before threads, which are connecting to a DB, will start.

Syntax
property Active: Boolean;
See Also

DriverDefFileAutoLoad, DriverDefFileName, Open, Close

What do you think about this topic? Send feedback!


TADManager.ActiveStoredUsage Property

TADManager.ActiveStoredUsage Property
TADManager Class TADManager Members uADCompClient Namespace published Send Feedback

Controls how to use Active property value saved to DFM.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
What do you think about this topic? Send feedback!


TADManager.AfterLoadConnectionDefFile Event

TADManager.AfterLoadConnectionDefFile Event
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Fires after connection definitions file is loaded.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The AfterLoadConnectionDefFile event is fired after the connection definitions file is loaded.

Syntax
property AfterLoadConnectionDefFile: TNotifyEvent;
See Also

BeforeLoadConnectionDefFile

What do you think about this topic? Send feedback!


TADManager.AfterShutdown Event

TADManager.AfterShutdown Event
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Fires after manager is finished.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The AfterShutdown event is fired after FireDAC manager is terminated.

Syntax
property AfterShutdown: TNotifyEvent;
See Also

Active, Close, BeforeShutdown

What do you think about this topic? Send feedback!


TADManager.AfterStartup Event

TADManager.AfterStartup Event
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Fires after manager is started.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The AfterStartup event is fired after FireDAC manager is started.

Syntax
property AfterStartup: TNotifyEvent;
See Also

Active, Open, BeforeStartup

What do you think about this topic? Send feedback!


TADManager.BeforeLoadConnectionDefFile Event

TADManager.BeforeLoadConnectionDefFile Event
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Fires before connection definitions file is loaded.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The BeforeLoadConnectionDefFile event is fired before the connection definitions file is loaded.

Syntax
property BeforeLoadConnectionDefFile: TNotifyEvent;
See Also

AfterLoadConnectionDefFile

What do you think about this topic? Send feedback!


TADManager.BeforeShutdown Event

TADManager.BeforeShutdown Event
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Fires before manager will be finished.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The BeforeShutdown event is fired before FireDAC manager will be terminated.

Note, multi-threaded application may close connections opened in the background threads in a BeforeShutdown event handler to avoid possible dead lock.

Syntax
property BeforeShutdown: TNotifyEvent;
See Also

Multi Threading, Active, Close, AfterShutdown

What do you think about this topic? Send feedback!


TADManager.BeforeStartup Event

TADManager.BeforeStartup Event
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Fires before manager will be started.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The BeforeStartup event is fired before FireDAC manager will be started.

Note, application cannot open a connection in a BeforeStartup event handler, as that will lead to the endless recursion.

Syntax
property BeforeStartup: TNotifyEvent;
See Also

Active, Open, AfterStartup

What do you think about this topic? Send feedback!


TADManager.ConnectionDefFileAutoLoad Property

TADManager.ConnectionDefFileAutoLoad Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Controls how connection definitions file must be loaded.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The ConnectionDefFileAutoLoad property controls, should be a connection definition file loaded automatically or explicitly by programmer. If True, then FireDAC will load file at first "touch" to the content of the ConnectionDefs list.

If False, then programmer should call ConnectionDefs.Load method before first "touch" to the ConnectionDefs list, including:

  • opening a connection referencing to a connection definition by its name (see TADCustomConnection.ConnectionDefName);
  • iterating through existing connection definitions (see TADCustomManager.ConnectionDefs);
  • adding new connection definition, deleting existing connection definition or looking for existing connection definition (see TADCustomManager.ConnectionDefs);

Otherwise an exception will be raised.

Syntax
property ConnectionDefFileAutoLoad: Boolean;
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileLoaded, ConnectionDefFileName, LoadConnectionDefFile

What do you think about this topic? Send feedback!


TADManager.ConnectionDefFileName Property

TADManager.ConnectionDefFileName Property
TADManager Class TADManager Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Gets / sets the name of a connection definitions file.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

The ConnectionDefFileName property allows to get or set the name of a connection definition file.

The application can set the name before connection definitions file will be loaded. For example in BeforeLoadConnectionDefFile event handler.

If a path is a relative one or contains template markers, then it will be expanded into full path. Use ActualConnectionDefFileName to get the expanded value.

Syntax
property ConnectionDefFileName: String;
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileAutoLoad, ConnectionDefFileLoaded, ActualConnectionDefFileName

Example 1
ADManager.ConnectionDefFileName := ExtractFilePath(Application.ExeName) + 'myconndef.ini';
ADManager.ConnectionDefFileAutoLoad := True;
oConn := TADConnection.Create(nil);
oConn.ConnectionDefName := 'myconn';
oConn.Connected := True;
Example 2
procedure TMyDataModule.DoBeforeLoad(ASender: TNotifyEvent);
begin
  ADManager.ConnectionDefFileName := FSettings.MyConnectionDefFile;
end;
...
ADManager.BeforeLoadConnectionDefFile := DoBeforeLoad;
What do you think about this topic? Send feedback!


TADManager.DriverDefFileAutoLoad Property

TADManager.DriverDefFileAutoLoad Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Controls how driver definitions file must be loaded.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The DriverDefFileAutoLoad property controls, should the driver definition file be loaded automatically or explicitly by programmer. When True, then FireDAC will load file at manager activation. When False, then programmer should call ADPhysManager.DriverDefs.Load method before manager activation. Otherwise an exception will be raised.

Syntax
property DriverDefFileAutoLoad: Boolean;
See Also

Configuring Drivers, DriverDefFileName

What do you think about this topic? Send feedback!


TADManager.DriverDefFileName Property

TADManager.DriverDefFileName Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Gets / sets the name of a driver definitions file.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The DriverDefFileName property allows to get or set the name of a driver definition file. The application can set the name before manager activation.

The application can set the name before driver definitions file will be loaded.

If a path is a relative one or contains template markers, then it will be expanded into full path. Use ActualDriverDefFileName to get the expanded value.

Syntax
property DriverDefFileName: String;
See Also

Configuring Drivers, DriverDefFileAutoLoad, ActualDriverDefFileName

What do you think about this topic? Send feedback!


TADManager.FetchOptions Property

TADManager.FetchOptions Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

The "root" fetch options.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The FetchOptions property returns the reference to the "root" instance of the fetch options. These options control how the data will be fetched and cached in the memory.

The option values will be inherited by all TADCustomConnection's and, consequently, by all TADCustomCommand's and all datasets in application.

See Setting Options for review of how to work with options.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, FormatOptions, UpdateOptions, ResourceOptions

What do you think about this topic? Send feedback!


TADManager.FormatOptions Property

TADManager.FormatOptions Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

The "root" data format options.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The FormatOptions property returns the reference to the "root" instance of the data format options. These options control how the DBMS data types will be mapped into dataset data types.

The option values will be inherited by all TADCustomConnection's and, consequently, by all TADCustomCommand's and all datasets in application.

See Setting Options for review of how to work with options.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, FetchOptions, UpdateOptions, ResourceOptions

What do you think about this topic? Send feedback!


TADManager.ResourceOptions Property

TADManager.ResourceOptions Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

The "root" resources control options.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The ResourceOptions property returns the reference to the "root" instance of the resources control options. These options control how FireDAC should use DBMS and workstation resources.

The option values will be inherited by all TADCustomConnection's and, consequently, by all TADCustomCommand's and all datasets in application.

See Setting Options for review of how to work with options.

Syntax
property ResourceOptions: TADTopResourceOptions;
See Also

Setting Options, FetchOptions, UpdateOptions, FormatOptions

What do you think about this topic? Send feedback!


TADManager.SilentMode Property

TADManager.SilentMode Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Gets or sets FireDAC global "silent" flag.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

Set SilentMode to True to disable wait cursors and dialogs. This flag is application wide. Its value overrides all TADResourceOptions.SilentMode values.

Syntax
property SilentMode: Boolean;
See Also

TADResourceOptions.SilentMode, WaitCursor

What do you think about this topic? Send feedback!


TADManager.UpdateOptions Property

TADManager.UpdateOptions Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

The "root" data updating options.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The UpdateOptions property returns the reference to the "root" instance of the data updating options. These options control how FireDAC should post data changes back to a DB.

The option values will be inherited by all TADCustomConnection's and, consequently, by all TADCustomTableAdapter's and all datasets in application.

See Setting Options for review of how to work with options.

Syntax
property UpdateOptions: TADUpdateOptions;
See Also

Setting Options, FetchOptions, ResourceOptions, FormatOptions

What do you think about this topic? Send feedback!


TADManager.WaitCursor Property

TADManager.WaitCursor Property
TADManager Class TADManager Members uADCompClient Namespace published See Also Send Feedback

Gets or sets FireDAC wait cursor shape.

Group

published

Links
TADManager Class, TADManager Members, uADCompClient Namespace, published, See Also
Description

The WaitCursor property gets or sets the wait cursor shape.

Syntax
property WaitCursor: TADGUIxScreenCursor;
See Also

SilentMode

What do you think about this topic? Send feedback!


TADMemTable Class

TADMemTable Class
published TADMemTable Members Example Classes See Also Send Feedback

The class implementing in-memory dataset.

Group

Classes

Class Hierarchy
  uADCompClient_TADMemTableuADCompClient_TADMemTableuADCompClient_TADMemTableuADCompClient_TADMemTable
File

uADCompClient

Links
published, TADMemTable Members, Example, Classes, See Also
Description

Use TADMemTable to manage data in the client memory and optionally exchange the data with a DBMS.

Syntax
TADMemTable = class(TADCustomMemTable);
See Also

TADDataSet, TADCustomMemTable

Example

See FireDAC\Samples\Comp Layer\TADMemTable\Main sample for details of how to setup TADMemTable.

See FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail sample for details of how to work with master-detail relation.

What do you think about this topic? Send feedback!


TADMemTable Members

TADMemTable Members
Events TADMemTable Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADMemTable.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADMemTable Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
AppendData | Appends data to this dataset from other dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
ConstraintsDisabled | Shortcut for ConstraintsEnabled.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetOptionalParam | Returns an optional custom parameter, associated with a dataset.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MergeChangeLog | Shortcut for CommitUpdates.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetOptionalParam | Sets an optional custom parameter, associated with a dataset.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | Add a short summary here...
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
CommandText | Shortcut for Adapter.SelectCommand.CommandText.Text.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
DisableStringTrim | Shortcut for FormatOptions.StrsTrim.
FetchOnDemand | Shortcut for FormatOptions.Mode.
FetchOptions | The set of options to control rows fetching.
FileName | Shortcut for ResourceOptions.PersistentFileName.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
IsClone | Returns True, if this dataset is a cloned dataset.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
LogChanges | Shortcut for CachedUpdates.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
PacketRecords | Shortcut for FetchOptions.RowsetSize.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
ProviderEOF | Shortcut for SourceEOF.
ReadOnly | Shortcut for UpdateOptions.ReadOnly.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
StatusFilter | Shortcut for FilterChanges.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.
XMLData | Represents dataset content as an XML.
Links
Events, TADMemTable Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
Events TADMemTable Class Legend Properties Send Feedback

The published members of the TADMemTable class are listed here.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADMemTable Class

Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | Add a short summary here...
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FormatOptions | The set of options to control data representation.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ResourceOptions | The set of options to control resources usage.
UpdateOptions | The set of options to control updates posting.
Links
Events, TADMemTable Class, Legend, Properties
What do you think about this topic? Send feedback!


TADMemTable.ActiveStoredUsage Property

TADMemTable.ActiveStoredUsage Property
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Controls how to use Active property value saved to DFM.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
See Also

TDataSet.Active

What do you think about this topic? Send feedback!


TADMemTable.Adapter Property

TADMemTable.Adapter Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Add a short summary here...

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Add a description here...

Syntax
property Adapter: TADCustomTableAdapter;
See Also

List here...

Example
What do you think about this topic? Send feedback!


TADMemTable.AfterApplyUpdates Event

TADMemTable.AfterApplyUpdates Event
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Fires after cached updates are applied to DB.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The AfterApplyUpdates event fires after cached updates are applied to DB as result of ApplyUpdates method call.

Syntax
property AfterApplyUpdates: TADAfterApplyUpdatesEvent;
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates

What do you think about this topic? Send feedback!


TADMemTable.AfterExecute Event

TADMemTable.AfterExecute Event
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Fires after SQL command execution is finished.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The AfterExecute event fires after SQL command execution is finished as result of Execute method call.

Syntax
property AfterExecute: TADDataSetEvent;
See Also

TADDataSetEvent, Execute, BeforeExecute

What do you think about this topic? Send feedback!


TADMemTable.AfterGetRecord Event

TADMemTable.AfterGetRecord Event
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset one time for each fetched record.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecord event fires after dataset fetched next rowset as result of navigation methods calls. The event fires one time for each fetched record. For example, fetching occurs automatically inside of Next, Last, Locate methods. Inside of an event handler application may read dataset fields to get fetched record field values.

Syntax
property AfterGetRecord: TADDataSetEvent;
See Also

AfterGetRecords

What do you think about this topic? Send feedback!


TADMemTable.AfterGetRecords Event

TADMemTable.AfterGetRecords Event
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecords event fires after dataset fetched next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property AfterGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord

What do you think about this topic? Send feedback!


TADMemTable.AfterRowRequest Event

TADMemTable.AfterRowRequest Event
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching record.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The AfterRowRequest event fires after dataset fetched current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property AfterRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest

What do you think about this topic? Send feedback!


TADMemTable.Aggregates Property

TADMemTable.Aggregates Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The collection of client side aggregates, defined for dataset.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use Aggregates to define client side aggregating formulas, that will be automatically maintained and calculated for group of or for all records of dataset.

All records in the group of records has the same field values for defined set of fields. Aggregates performing calculation for group of records must be associated with one of the indexes. These aggregate expressions will be calculated only is associated index is current and active.

Adding aggregate field does not add TADAggregate object to Aggregates collection. That are two alternative ways - to use aggregate fields or to use Aggregates.

DataSet will automatically maintain and calculate Aggregates values when dataset is fetching the data or application edits the data, if AggregatesActive is True. If application needs to perform large updates to dataset and aggregate values are not needed while updating, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

When aggregates are maintained, the Value method of every active aggregate object returns a value that reflects the current data in the dataset. When users edit the data in the dataset, these values are recalculated to reflect the user's changes.

The expressions in Aggregates must contain aggregating functions, like a SUM, COUNT. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Aggregates: TADAggregates;
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch

Example 1
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.

What do you think about this topic? Send feedback!


TADMemTable.AggregatesActive Property

TADMemTable.AggregatesActive Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Controls automatic calculation of aggregate values.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use AggregatesActive to get / set the flag controlling automatic maintenance and calculation of dataset aggregate values.

When AggregatesActive is False (the default), the dataset does not maintain aggregates. This allows the dataset to perform large updates to the dataset or fetch big volumes of data without overhead of calculating aggregate values, which happens at fetching or data editing. When AggregatesActive is True, the dataset calculates and maintains all aggregate values specified by the Aggregates property that are compatible with the current index.

To selectively enable and disable aggregates rather than turning them all on or off at once, use the Active property of individual TADAggregate objects. These objects are available through the Aggregates property.

If application needs to perform batch updates to dataset, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property AggregatesActive: Boolean;
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch

Example
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;
What do you think about this topic? Send feedback!


TADMemTable.BeforeApplyUpdates Event

TADMemTable.BeforeApplyUpdates Event
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Fires before cached updates are applied to DB.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The BeforeApplyUpdates event fires before cached updates are applied to database as result of ApplyUpdates method call.

Syntax
property BeforeApplyUpdates: TADDataSetEvent;
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates

What do you think about this topic? Send feedback!


TADMemTable.BeforeExecute Event

TADMemTable.BeforeExecute Event
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Fires before SQL command execution is started.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The BeforeExecute event fires before SQL command execution is started as result of Execute method call.

Syntax
property BeforeExecute: TADDataSetEvent;
See Also

TADDataSetEvent, Execute, AfterExecute

What do you think about this topic? Send feedback!


TADMemTable.BeforeGetRecords Event

TADMemTable.BeforeGetRecords Event
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching next rowset.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The BeforeGetRecords event fires before dataset will fetch next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property BeforeGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, AfterGetRecords

What do you think about this topic? Send feedback!


TADMemTable.BeforeRowRequest Event

TADMemTable.BeforeRowRequest Event
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching record.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The BeforeRowRequest event fires before dataset will fetch current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property BeforeRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest

What do you think about this topic? Send feedback!


TADMemTable.CachedUpdates Property

TADMemTable.CachedUpdates Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Specifies whether dataset will log changes to the data without immediate applying of them to the database.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

CachedUpdates enables (True) or disables (False) the logging of data changes (Insert/Post, Edit/Post, Delete) without immediate applying of them to the database.

An application must explicitly apply changes from change log to the database, using ApplyUpdates method. All changes will be written in comparably small amount of time in single transaction. The main benefits of enabling cached updates are:

  • fewer transactions and shorter transaction times;
  • minimization of network traffic;
  • simplified implementation of undo / redo functionality for dataset;
  • ability to implement application offline mode or briefcase model.

The potential drawbacks of enabling cached updates are:

  • other applications can access and change the actual data on the server while users are editing local copies of the data, resulting in an update conflict when cached updates are applied to the database;
  • other applications cannot access data changes made by an application until its cached updates are applied to the database.

Note, to change CachedUpdate property value for TADTable, it must be inactive.

Syntax
property CachedUpdates: Boolean;
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates

Example
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;
What do you think about this topic? Send feedback!


TADMemTable.Constraints Property

TADMemTable.Constraints Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Specifies record-level client constraints that must be met when editing the data.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use Constraints to maintain record-level constraints for the dataset.

Record-level constraints force business ruless limiting few fields in a single record. This constraints are checked at end of data editing (Post / AppendRecord / InsertRecord). Constraints, limiting single field are field constraints and must specified at TField.CustomConstraint or TField.ImportedConstraint.

The Constraints checking is performed when ConstraintsEnabled is True. If application needs to perform large updates to the dataset and application can guarantee the data consistancy, then set ConstraintsEnabled to False before updates, and return to original value after updates. The constraints are not checked at data fetching.

The expressions in Constraints must be predicates, evaluating to Boolean value. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • Client dataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Constraints;
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint

Example
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;
What do you think about this topic? Send feedback!


TADMemTable.ConstraintsEnabled Property

TADMemTable.ConstraintsEnabled Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Specifies whether the dataset perform constraint checking.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use ConstraintsEnabled to get / set the flag controlling automatic record-level constraints enforcement.

When ConstraintsEnabled is False (the default), the dataset does not check Constraints. This allows the dataset to perform the large data updates without overhead of checking constraints. When ConstraintsEnabled is True, the dataset checks Constraints at at end of data editing (Post / AppendRecord / InsertRecord).

If application needs to perform batch updates to dataset, then set ConstraintsEnabled to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property ConstraintsEnabled: Boolean;
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired

Example
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;
What do you think about this topic? Send feedback!


TADMemTable.DetailFields Property

TADMemTable.DetailFields Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use DetailFields property value to specify semicolon separated list of the detail dataset field names, used to establish a master-detail relationship with this dataset.

The DetailFields property is useful only for parameter based master-detail setup. For range based setup the indexed fields are used as the detail field list. When DetailFields is not specified explicitly, then field names matching to query parameter names will be used as DetailFields value.

The DetailFields will be used only to assign specified field values when a new record is inserted into detail dataset. The mechanism used to filter the detail dataset records does not use DetailFields.

Syntax
property DetailFields: String;
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName

Example
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';
What do you think about this topic? Send feedback!


TADMemTable.FetchOptions Property

TADMemTable.FetchOptions Property
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

The set of options to control rows fetching.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The FetchOptions property is the set of properties, controlling the fetching of cursor rows. These properties will inherit its values from FetchOptions of connection object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions

What do you think about this topic? Send feedback!


TADMemTable.FilterChanges Property

TADMemTable.FilterChanges Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Specifies what kinds of changed records must be "visible" in the dataset.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

The FilterChanges property allows to get / set changed records kinds, which must be accessible through navigation interface of dataset ("visible" in dataset):

Kind | Meaning
rtModified | Records changed after fetching or last CommitUpdates / CancelUpdates.
rtInserted | New records, not yet posted to DB and added after dataset open or after last CommitUpdates.
rtDeleted | Deleted records, not yet deleted from DB and deleted after dataset open or after last CommitUpdates.
rtUnmodified | Unchanged records.
rtHasErrors | Records having associated errors after ApplyUpdates. To get an error object use RowError property.
Syntax
property FilterChanges: TADUpdateRecordTypes;
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus

Example
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];
What do you think about this topic? Send feedback!


TADMemTable.FormatOptions Property

TADMemTable.FormatOptions Property
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

The set of options to control data representation.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Params

What do you think about this topic? Send feedback!


TADMemTable.IndexDefs Property

TADMemTable.IndexDefs Property
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

Returns indexes definition for the dataset.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

Use IndexDefs property to read or maintain indexes definitions.

The dataset also has Indexes collection. Application should use either IndexDefs, either Indexes, but not both in the same time. We suggest to use Indexes, as it is more flexible. IndexDefs property at first is needed for compatibility with other software using TDataSet, where IndexDefs is really defined.

The TADTable will automatically fill IndexDefs by database indexes, if fiMeta in FetchOptions.Items.

Syntax
property IndexDefs: TIndexDefs;
See Also

Sorting Records, Indexes, TADFetchOptions.Items

What do you think about this topic? Send feedback!


TADMemTable.Indexes Property

TADMemTable.Indexes Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Lists all client indexes that apply to the dataset.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use Indexes to define client side data views on the dataset records. Indexes are a collection of the TADIndex objects, each of them defines optional:

  • Sorting by fields (Fields, CaseInsFields, DescFields, Options).
  • Sorting by expression (Expression, Options).
  • Records filter (Filter, FilterOptions).
  • Records distinction flag (Distinct).

The individual indexes are not just the sort and filter definitions. FireDAC maintains a consistent view on the data for each active index, while application fetches data or edits data. That creates additional overhead, but allows to switch between indexes without delays.

To make a view current, set it Selected property to True or dataset IndexName property to the view name. Note, the view must have Active = True to be maintained.

Dataset maintains Indexes views, when IndexesActive is True. When an application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Setting IndexFieldNames does not add a TADIndex object to Indexes collection. Defining IndexDefs before dataset opening, will clear Indexes and fill them using IndexDefs information. So, there are two alternative ways - use IndexDefs or use Indexes. We suggest to use Indexes, as it is more flexible.

Some of the navigation methods, like a Locate / Lookup / SetRange are using indexes to optimize their operations.

The sorting and filter expressions in Indexes supports syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).
Syntax
property Indexes: TADIndexes;
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch

Example 1
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.

What do you think about this topic? Send feedback!


TADMemTable.IndexesActive Property

TADMemTable.IndexesActive Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Controls automatic maintenance of Index'es.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexesActive to indicate whether the dataset should maintain the data views, defined by the Indexes collection.

When IndexesActive is False, the dataset does not maintain the data views. That avoids the overhead of updating views, while data is fetched or is edited. When IndexesActive is True (by default), the dataset maintains the data views.

When indexes are maintained, each of them may be current index, selected by TADIndex.Selected or by IndexName properties.

To selectively enable and disable data views rather than turning them all on or off at once, use the Active property of individual TADIndex objects. These objects are available through the Indexes property.

If application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property IndexesActive: Boolean;
See Also

Sorting Records, Indexes, BeginBatch, EndBatch

Example
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;
What do you think about this topic? Send feedback!


TADMemTable.IndexFieldNames Property

TADMemTable.IndexFieldNames Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Lists the field names to use as an index.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexFieldNames as an alternative method of specifying the current index to use for a dataset.

Specify the name of each field on which to index the dataset, separating names with semicolons. Ordering of field names is significant. Optionally specify the postfix for any of fields in form "field[:[D][A][N]]", where:

- 'D' - use descending sorting on this field;

- 'A' - use ascending sorting on this field;

- 'N' - use case-insensitive sorting on this field.

Use IndexFieldNames to create sort orders on the fly. The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.

Syntax
property IndexFieldNames: String;
See Also

Sorting Records, Indexes, IndexName

Example
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';
What do you think about this topic? Send feedback!


TADMemTable.IndexName Property

TADMemTable.IndexName Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the current index for the dataset by its name.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexName to specify the current index for the dataset.

If IndexName is empty, the dataset's sort order is based on the IndexFieldNames property or on its default ordering as it is in dataset. If IndexName contains a name of valid index from Indexes collection, then that index is used to determine data view (including sort order) of records.

IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.

Syntax
property IndexName: String;
See Also

Sorting Records, Indexes, IndexFieldNames

Example
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';
What do you think about this topic? Send feedback!


TADMemTable.LocalSQL Property

TADMemTable.LocalSQL Property
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

The reference to a Local SQL engine.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

Use this property to get / set reference to a Local SQL engine.

When engine and Local SQL connection are active, then right after setting LocalSQL property, the dataset will be opened (if not yet) and will be registered in Local SQL engine. Otherwise dataset will be registered when engine and connection will be active. The TADMemTable structure must be defined before it will be opened.

The dataset will be registered using its Name property value. So, its Name property value must be not empty and unique across all datasets linked to the same Local SQL engine.

Setting this property to nil unregisters this dataset from Local SQL engine.

Syntax
property LocalSQL: TADCustomLocalSQL;
See Also

Local SQL, TADLocalSQL, TADMemTable

What do you think about this topic? Send feedback!


TADMemTable.MasterFields Property

TADMemTable.MasterFields Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use MasterFields property value to specify semicolon separated list of the master dataset field names, used to establish a master-detail relationship with this dataset.

Specify MasterFields property value after assigning MasterSource property value. The mechanism used to filter this detail dataset records depends on the dataset class:

  • TADQuery and TADStoredProc will match master fields to this query / procedure parameters by their names. When the master dataset current record is changed, then this dataset parameters will get values from the corresponding MasterFields.
  • TADMemTable will match master fields to this dataset indexed fields by their positions. When the master dataset current record is changed, then a range will be applied to this dataset, where starting and ending range values are equal to the corresponding MasterFields field values. The application must have a current active index. The indexed fields will be the detail dataset fields used to establish mater-detail.
Syntax
property MasterFields: String;
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName

Example
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
What do you think about this topic? Send feedback!


TADMemTable.MasterSource Property

TADMemTable.MasterSource Property
TADMemTable Class TADMemTable Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Gets / sets a master data source, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use MasterSource to specify the data source linked to a dataset, which will be used as master dataset in master-detail relationship between this and specified datasets.

Additionally application must specify MasterFields property value. See MasterFields property description for additional information.

Syntax
property MasterSource: TDataSource;
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName

Example 1
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.

What do you think about this topic? Send feedback!


TADMemTable.OnReconcileError Event

TADMemTable.OnReconcileError Event
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Fires when a dataset needs to reconcile an update to a record that cannot not be applied.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use the OnReconcileError event handler to respond to error conditions that arise when the ApplyUpdates method was applying changes to the records to the database. The OnReconcileError event handler is called by Reconcile method.

As part of Reconcile call the dataset will loop through all records with associated exception objects. And for each such record will call the OnReconcileError event handler. The event handler gets:

  • E - reference to the exception object. See Handling Errors topics for how to work with exception objects.
  • UpdateKind - the update kind of the current record. It may be one of the values: rsInserted, rsDeleted, rsModified, rsUnchanged.

After handling error the event handler should set Action argument. The default value is raMerge. The possible values are:

Action | Description
raSkip | Just skip current record.
raAbort | Just quit from Reconcile call.
raMerge | Clear the current record error state, make current record changes the new initial state of this record. IOW, merge changes into dataset records cache.
raCorrect | Clear current record error state. IOW, mark the record as correctly applied.
raCancel | Cancel current record changes.
raRefresh | Cancel current record changes and reread the record values from the database.

The event handler may analyze the original and current field values, by reading TField.OldValue and NewValue properties. Application may also update the current field value, set Action to raCorrect, and later call ApplyUdpates again.

Syntax
property OnReconcileError: TADReconcileErrorEvent;
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError

Example
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;
What do you think about this topic? Send feedback!


TADMemTable.OnUpdateError Event

TADMemTable.OnUpdateError Event
TADMemTable Class TADMemTable Members uADCompClient Namespace Example published See Also Send Feedback

Fires if an exception is generated when updates are applied to a database.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use the OnUpdateError event handler to respond to exceptions raised while applying immediate or cached updates to a database.

ASender is the dataset to which updates are applied.

AException is a pointer to a EADException object from which an application can extract an error message and the actual cause of the error condition. The OnUpdateError handler can use this information to determine how to respond to the error condition. In most cases AException object will be of class EADDBEngineException or even one of it DBMS specific subclasses.

ARow is a DatS row object, repesenting erroneous record in dataset. This record is also current record in ASender.

ARequest indicates whether the error occurred while inserting, deleting, or modifying a record.

AAction indicates the action to take when the OnUpdateError handler exits. On entry into the handler, AAction is always set to eaDefault, which leads to uaFail, if not changed. If OnUpdateError can handle or correct the error, set AAction to uaRetry before exiting the error handler. Or consider other options.

The error handler can use the OldValue and NewValue properties TField to evaluate error conditions and set NewValue to a new value to reapply. In this case, set AAction to uaRetry before exiting.

The code in an OnUpdateError handler must not call any methods that make a different record the current one !

Syntax
property OnUpdateError: TADUpdateErrorEvent;
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord

Example
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;
What do you think about this topic? Send feedback!


TADMemTable.OnUpdateRecord Event

TADMemTable.OnUpdateRecord Event
TADMemTable Class TADMemTable Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Occurs when record update is applying to a database.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use an OnUpdateRecord event handler to process immediate or cached updates that cannot be correctly or easily handled:

  • using FireDAC automatic SQL update command generation;
  • by a single table adapter component;
  • by a single update component.

This event is useful for applications that require:

  • additional control over parameters and macros substitution in update components;
  • multi SQL statement updates, when DBMS does not support batches or blocks;
  • non-SQL updates posting;
  • etc

ASender is the dataset to which updates are applied.

ARequest indicates whether the current update is the insertion, deletion or modification of a record.

AAction indicates the action taken by the OnUpdateRecord handler before it exits. On entry into the handler, AAction is always set to eaDefault. If OnUpdateRecord is successful, it should set AAction to eaApplied before exiting.

AAction value | Description
eaFail | Mark the update as failed and return an error.
eaSkip | Skip current update and do not mark it as applied.
eaRetry | Retry the current operation.
eaApplied | Mark current update as applied.
eaDefault | Take default action. For successful update it is eaApplied, for failed update it is eaFail.
eaExitSuccess | Stop to process the cached updates, return success.
eaExitFailure | Stop to process the cached updates, return failure.

The OnUpdateRecord event handler code should read the dataset field values, including TField.NewValue, OldValue and CurValue. There:

  • NewValue is the new field value before posting updates.
  • OldValue is the original field value, as it was after record fetching or after last updates applying.
  • CurValue is the current field value, the same as Value property.

Note, the OnUpdateRecord handler code must not call the methods that change the current dataset position.

Syntax
property OnUpdateRecord: TADUpdateRecordEvent;
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError

Example 1
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;
Example 2

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main
What do you think about this topic? Send feedback!


TADMemTable.ResourceOptions Property

TADMemTable.ResourceOptions Property
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

The set of options to control resources usage.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The ResourceOptions property is the set of properties, controlling the resources usage by the dataset. These properties will inherit its values from ResourceOptions of connection object.

Syntax
property ResourceOptions: TADBottomResourceOptions;
See Also

Setting Options, TADBottomResourceOptions

What do you think about this topic? Send feedback!


TADMemTable.UpdateOptions Property

TADMemTable.UpdateOptions Property
TADMemTable Class TADMemTable Members uADCompClient Namespace published See Also Send Feedback

The set of options to control updates posting.

Group

published

Links
TADMemTable Class, TADMemTable Members, uADCompClient Namespace, published, See Also
Description

The UpdateOptions property is the set of properties, controlling the posting updates from the dataset. These properties will inherit its values from UpdateOptions of connection object.

Syntax
property UpdateOptions: TADBottomUpdateOptions;
See Also

Setting Options, TADBottomUpdateOptions

What do you think about this topic? Send feedback!


TADMetaInfoCommand Class

TADMetaInfoCommand Class
published TADMetaInfoCommand Members Classes See Also Send Feedback

The class is responsible for execution of meta-data commands.

Group

Classes

Class Hierarchy
  uADCompClient_TADMetaInfoCommanduADCompClient_TADMetaInfoCommand
File

uADCompClient

Links
published, TADMetaInfoCommand Members, Classes, See Also
Description

Use the TADMetaInfoCommand class to execute meta-data commands.

The class does not provide TDataSet-aware access to returned resultsets.

Syntax
TADMetaInfoCommand = class(TADCustomCommand);
See Also

Working with Metadata, TADCustomCommand, IADPhysCommand, TADMetaInfoQuery

What do you think about this topic? Send feedback!


TADMetaInfoCommand Members

TADMetaInfoCommand Members
Events TADMetaInfoCommand Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADMetaInfoCommand.

Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterFetch | The event fires after fetching from command cursor.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeFetch | The event fires before fetching from command cursor.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.
Class

TADMetaInfoCommand Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current command operation.
AcquireConnection | Acquires reference to the actual connection object.
Close | Closes command current cursor.
CloseAll | Closes all command cursors.
Define | Defines DatS manager for command multiple result sets.
Define | Define DatS table structure for command's current cursor.
Disconnect | Use Disconnect method to release DBMS resources, used by this command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Fetch | Fetches rows from current command cursor.
FillParams | Fills the Params collection.
FindMacro | Returns macro by its name.
FindParam | Returns parameter by its name.
GetConnection | Returns the connection object.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Open | Executes SQL command, returning cursor.
OpenOrExecute | Execute SQL command, optionally returning cursor.
ParamByName | Returns parameter by its name.
Prepare | Prepares SQL command for execution.
ReleaseConnection | Releases reference to the actual connection object.
Unprepare | Releases SQL command resources.
Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Gets / sets the name of base object.
BindedBy | Determines how command is connected to connection object.
CatalogName | Identifies catalog name for some command kinds.
CommandIntf | Returns IADPhysCommand interface.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
DataSet | Reference to dataset object owning this command.
FetchOptions | The set of options to control rows fetching.
FixedCommandKind | True, if the CommandKind property value is set explicitly.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
MetaInfoKind | Gets / sets the kind of metadata to retrieve.
ObjectName | Gets / sets the name of object to get detailed information about it.
ObjectScopes | Gets / sets object scopes filter.
Overload | Oracle stored procedure overload index.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | The collection of parameters for a SQL command.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Identifies schema name for some of command kinds.
SQLText | The SQL command text as it will be sent to the DBMS.
State | Returns the current state of the command object.
TableKinds | Gets / sets table kind filter.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.
Values | Provides access to the values for all parameters for the command.
Wildcard | Gets / sets objects filter by their name.
Links
Events, TADMetaInfoCommand Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
Events TADMetaInfoCommand Class Legend Properties Send Feedback

The published members of the TADMetaInfoCommand class are listed here.

Events
Event | Description
AfterClose | The event fires after command is closed.
AfterOpen | The event fires after command is opened.
BeforeClose | The event fires before command will be closed.
BeforeOpen | The event fires before command will be opened.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.
Class

TADMetaInfoCommand Class

Properties
Property | Description
Active | Gets or sets command active status.
BaseObjectName | Gets / sets the name of base object.
CatalogName | Identifies catalog name for some command kinds.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
FormatOptions | The set of options to control data representation.
MetaInfoKind | Gets / sets the kind of metadata to retrieve.
ObjectName | Gets / sets the name of object to get detailed information about it.
ObjectScopes | Gets / sets object scopes filter.
Overload | Oracle stored procedure overload index.
SchemaName | Identifies schema name for some of command kinds.
TableKinds | Gets / sets table kind filter.
Wildcard | Gets / sets objects filter by their name.
Links
Events, TADMetaInfoCommand Class, Legend, Properties
What do you think about this topic? Send feedback!


TADMetaInfoCommand.Active Property

TADMetaInfoCommand.Active Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace Example published See Also Send Feedback

Gets or sets command active status.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, Example, published, See Also
Description

Set Active to True to execute SQL command and return cursor. After that the State = csOpen and you can fetch rows from current cursor using Fetch method. Setting Active to True, will call Open method.

Set Active to False to close current command cursor. After that State = csPrepared. Setting Active to False, will call Closemethod. To close all command cursors (if command returns multiple result sets), use CloseAll method.

Syntax
property Active: Boolean;
See Also

Fetch, Define, Open, Close, CloseAll, State

Example
ADCommand1.CommandText.Text := 'select * from "Orders"';
ADCommand1.Active := True;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ....
finally
  oTab.Free;
end;
What do you think about this topic? Send feedback!


TADMetaInfoCommand.AfterClose Event

TADMetaInfoCommand.AfterClose Event
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires after command is closed.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

The AfterClose event fires, after command is closed by calling Close or setting Active = False.

Syntax
property AfterClose: TNotifyEvent;
See Also

BeforeClose, Close, Active

What do you think about this topic? Send feedback!


TADMetaInfoCommand.AfterOpen Event

TADMetaInfoCommand.AfterOpen Event
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires after command is opened.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

The AfterOpen event fires, after command is opened by calling Open or setting Active = True.

Syntax
property AfterOpen: TNotifyEvent;
See Also

BeforeOpen, Open, Active

What do you think about this topic? Send feedback!


TADMetaInfoCommand.BaseObjectName Property

TADMetaInfoCommand.BaseObjectName Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Gets / sets the name of base object.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

The BaseObjectName property value meaning and optionality depends on MetaInfoKind:

MetaInfoKind | Meaning
mkIndexFields | Table name.
mkPrimaryKeyFields | Table name.
mkForeignKeyFields | Table name.
mkProcs | Package name.
mkProcArgs | Package name.

The BaseObjectName property value together with CatalogName and SchemaName constitutes the full base object name. If BaseObjectName is case sensitive or contains special character, then it must be explicitly quoted.

Assignment to this property value closes and unprepares command.

Syntax
property BaseObjectName: String;
See Also

MetaInfoKind, CatalogName, SchemaName, ObjectName

Example 1
// SQL Server: retrieve foreign key fields for FK_DEPARTMENTS constraint of the Northwind.dbo.Employees table
var
  oTab: TADDatSTable;
....
  ADMetaInfoCommand1.BaseObjectName := 'Northwind.dbo.Employees';
  ADMetaInfoCommand1.ObjectName := 'FK_DEPARTMENTS';
  ADMetaInfoCommand1.MetaInfoKind := mkForeignKeyFields;
  ADMetaInfoCommand1.Define(oTab);
  ADMetaInfoCommand1.Open(oTab);
  ADMetaInfoCommand1.Fetch(oTab, True);
Example 2
// Oracle: retrieve procedure list for the SYS.DBMS_SQL package
var
  oTab: TADDatSTable;
....
  ADMetaInfoCommand1.BaseObjectName := 'SYS.DBMS_SQL';
  ADMetaInfoCommand1.MetaInfoKind := mkProcs;
  ADMetaInfoCommand1.Define(oTab);
  ADMetaInfoCommand1.Open(oTab);
  ADMetaInfoCommand1.Fetch(oTab, True);
What do you think about this topic? Send feedback!


TADMetaInfoCommand.BeforeClose Event

TADMetaInfoCommand.BeforeClose Event
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires before command will be closed.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

The BeforeClose event fires, before command will be closed by calling Close or setting Active = False.

Syntax
property BeforeClose: TNotifyEvent;
See Also

AfterClose, Close, Active

What do you think about this topic? Send feedback!


TADMetaInfoCommand.BeforeOpen Event

TADMetaInfoCommand.BeforeOpen Event
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

The event fires before command will be opened.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

The BeforeOpen event fires, before command will be opened by calling Open or setting Active = True.

Syntax
property BeforeOpen: TNotifyEvent;
See Also

AfterOpen, Open, Active

What do you think about this topic? Send feedback!


TADMetaInfoCommand.CatalogName Property

TADMetaInfoCommand.CatalogName Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Identifies catalog name for some command kinds.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

The CatalogName identifies the name of the catalog where resides command object. The meaning depends on CommandKind and MetainfoKind:

  • If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then CatalogName specifies the name of the catalog, where resides the procedure.
  • If MetainfoKind is not mkNone, then CatalogName specifies the name of the catalog, where resides the describing object.
Syntax
property CatalogName: String;
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName

Example 1
ADCommand1.CatalogName := 'MY_APP';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;
Example 2
ADMetaInfoCommand1.CatalogName := 'MY_APP';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on SQL Server just ADMetaInfoCommand1.ObjectName := 'MY_APP..MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;
What do you think about this topic? Send feedback!


TADMetaInfoCommand.Connection Property

TADMetaInfoCommand.Connection Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

Specifies the connection object.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

The Connection property value points to the connection object. Alternatively may be specified the ConnectionName property value. The Connection property value must be specified before Prepare call.

Syntax
property Connection: TADCustomConnection;
See Also

ConnectionName, Prepare

What do you think about this topic? Send feedback!


TADMetaInfoCommand.ConnectionName Property

TADMetaInfoCommand.ConnectionName Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

Specifies connection name.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

The ConnectionName property value specifies the name of the connection. It must match to the:

  • name of one of connection definitions, either stored in external file or created on fly;
  • ConnectionName of one of the TADConnection objects.

Alternatively may be specified the Connection property value. The ConnectionName property value must be specified before Preparecall. If is specified the name of one of connection definitions, then FireDAC will transparently create connection object and link it with command.

Syntax
property ConnectionName: String;
See Also

Connection, Prepare

What do you think about this topic? Send feedback!


TADMetaInfoCommand.FormatOptions Property

TADMetaInfoCommand.FormatOptions Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

The set of options to control data representation.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Fetch, Params

What do you think about this topic? Send feedback!


TADMetaInfoCommand.MetaInfoKind Property

TADMetaInfoCommand.MetaInfoKind Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the kind of metadata to retrieve.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, Example, published, See Also
Description

The MetaInfoKind property determines what meta information will be retrieved. If DBMS or FireDAC driver does not support specified MetaInfoKind (for example, mkGenerators for Sybase SQL Anywhere), then no exception will be raised at Open and no records will be returned.

Assignment to this property value closes and unprepares command.

See Working with Metadata for structure of returned datasets.

Syntax
property MetaInfoKind: TADPhysMetaInfoKind;
See Also

CatalogName, SchemaName, BaseObjectName, Overload, ObjectName

Example
What do you think about this topic? Send feedback!


TADMetaInfoCommand.ObjectName Property

TADMetaInfoCommand.ObjectName Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the name of object to get detailed information about it.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, Example, published, See Also
Description

The ObjectName property value defines the database objects, for which will be returned detailed information. The meaning, optionality and usage of catalog and schema names depends on MetaInfoKind:

MetaInfoKind | Meaning | Catalog and schema names
mkTableFields | Table name. | Applicable.
mkIndexes | Table name. | Applicable.
mkIndexFields | Index name. | --
mkPrimaryKey | Table name. | Applicable.
mkForeignKeys | Table name. | Applicable.
mkForeignKeyFields | Foreign key constraint name. | --
mkProcArgs | Stored procedure name. | Applicable, for non-packages stored procedures.

The ObjectName together with CatalogName and SchemaName may constitute the full object name. If object name is case sensitive or contains special character, then it must be explicitly quoted.

Assignment to this property value closes dataset.

Syntax
property ObjectName: String;
See Also

MetaInfoKind, CatalogName, SchemaName, BaseObjectName

Example
var
  oTab: TADDatSTable;
....
  ADMetaInfoCommand1.CatalogName := 'Northwind';
  ADMetaInfoCommand1.SchemaName := 'dbo';
  ADMetaInfoCommand1.ObjectName := 'Employees';
  ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
  ADMetaInfoCommand1.Define(oTab);
  ADMetaInfoCommand1.Open(oTab);
  ADMetaInfoCommand1.Fetch(oTab, True);
What do you think about this topic? Send feedback!


TADMetaInfoCommand.ObjectScopes Property

TADMetaInfoCommand.ObjectScopes Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

Gets / sets object scopes filter.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

Use the ObjectScopes property value to filter database objects by their scope:

Scope | Meaning
osMy | Objects created by the current login user.
osSystem | Objects belonging to the DBMS.
osOther | All other objects.

Assignment to this property value closes and unprepares command.

Syntax
property ObjectScopes: TADPhysObjectScopes;
See Also

TableKinds

What do you think about this topic? Send feedback!


TADMetaInfoCommand.OnCommandChanged Event

TADMetaInfoCommand.OnCommandChanged Event
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace Example published See Also Send Feedback

The event fires after CommandText is changed.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, Example, published, See Also
Description

The OnCommandChanged event fires, after CommandText is changed.

Syntax
property OnCommandChanged: TNotifyEvent;
See Also

CommandText

Example
procedure TForm1.ADCommand1CommandChanged(ASender: TObject);
begin
  if ADCommand1.FindParam('ID') <> nil then
    ADCommand1.FindParams('ID').AsInteger := 100;
end;
What do you think about this topic? Send feedback!


TADMetaInfoCommand.OnError Event

TADMetaInfoCommand.OnError Event
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The event fires when an error happens, while command is communicating with DBMS.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Parameters
Parameters | Description
ASender | The reference to command.
AInitiator | The reference to interface of object, which initially raised the exception.
AException | The exception object, which may be modified or even replaced by another exception object instance.
Description

The OnError event fires, when command executes one of the following operations and an error happens:

  • Prepare. The command is preparing DBMS command text for execution.
  • Open. The command is executing DBMS command to open cursor.
  • Execute. The command is executing DBMS command text.
  • Fetch. The command is fetching rows from cursor.

If most cases AException object will of EADDBEngineException class. If AException is of EADDBArrayExecuteError class, then it is Array DML error handling case. You should use code like in the example.

Syntax
property OnError: TADErrorEvent;
See Also

Handling Errors, Array DML, Open, Execute, Prepare, Fetch, EADDBArrayExecuteError class, EADDBEngineException class

Example 1

Handling Array DML errors:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;
Example 2

Error substitution:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;
What do you think about this topic? Send feedback!


TADMetaInfoCommand.Overload Property

TADMetaInfoCommand.Overload Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace Example published See Also Send Feedback

Oracle stored procedure overload index.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, Example, published, See Also
Description

The Overload property specifies Oracle packaged stored procedure overload index. It has no meaning for other DBMS's.

Syntax
property Overload: Word;
See Also

CommandText, CommandKind

Example
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'DBMS_SQL.PARSE';
ADCommand1.Overload := 1;
What do you think about this topic? Send feedback!


TADMetaInfoCommand.SchemaName Property

TADMetaInfoCommand.SchemaName Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Identifies schema name for some of command kinds.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

The SchemaName identifies the name of the schema where resides command object. The meaning depends on CommandKind and MetainfoKind:

  • If CommandKind in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs], then SchemaName specifies the name of the schema, where resides the procedure.
  • If MetainfoKind is not mkNone, then SchemaName specifies the name of the schema, where resides the describing object.
Syntax
property SchemaName: String;
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName

Example 1
ADCommand1.SchemaName := 'SCOTT';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;
Example 2
ADMetaInfoCommand1.SchemaName := 'ADDEMO';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on Oracle just ADMetaInfoCommand1.ObjectName := 'ADDEMO.MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;
What do you think about this topic? Send feedback!


TADMetaInfoCommand.TableKinds Property

TADMetaInfoCommand.TableKinds Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

Gets / sets table kind filter.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

The TableKinds property value filters database tables, by their kinds:

Kind | Meaning
tkSynonym | Synonyms.
tkTable | Regular tables.
tkView | Views.
tkTempTable | Temporary tables.
tkLocalTable | Local tables.
Syntax
property TableKinds: TADPhysTableKinds;
See Also

ObjectScopes

What do you think about this topic? Send feedback!


TADMetaInfoCommand.Wildcard Property

TADMetaInfoCommand.Wildcard Property
TADMetaInfoCommand Class TADMetaInfoCommand Members uADCompClient Namespace published See Also Send Feedback

Gets / sets objects filter by their name.

Group

published

Links
TADMetaInfoCommand Class, TADMetaInfoCommand Members, uADCompClient Namespace, published, See Also
Description

The Wildcard property value is the LIKE mask, which will be applied to the object names.

Syntax
property Wildcard: String;
See Also

ObjectScopes, TableKinds

What do you think about this topic? Send feedback!


TADMetaInfoQuery Class

TADMetaInfoQuery Class
published TADMetaInfoQuery Members Example Classes See Also Send Feedback

The class implementing dataset, capable to execute meta-info queries.

Group

Classes

Class Hierarchy
  uADCompClient_TADMetaInfoQueryuADCompClient_TADMetaInfoQueryuADCompClient_TADMetaInfoQueryuADCompClient_TADMetaInfoQuery
File

uADCompClient

Links
published, TADMetaInfoQuery Members, Example, Classes, See Also
Description

Use TADMetaInfoQuery to execute meta-info queries, browse the meta data resultsets records. To execute a query, specify the following optional property values:

  • CatalogName;
  • SchemaName;
  • ObjectScopes;
  • MetaInfoKind;
  • BaseObjectName;
  • ObjectName;
  • TableKinds;
  • Wildcard.
Syntax
TADMetaInfoQuery = class(TADRdbmsDataSet);
See Also

Working with Metadata, TADMetaInfoCommand

Example

See FireDAC\Samples\Comp Layer\TADMetaInfoQuery\Main sample for details.

What do you think about this topic? Send feedback!


TADMetaInfoQuery Members

TADMetaInfoQuery Members
Events TADMetaInfoQuery Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADMetaInfoQuery.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADMetaInfoQuery Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
BaseObjectName | Gets / sets the name of base object.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Specified the DBMS catalog name
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
MetaInfoKind | Gets / sets the kind of metadata to retrieve.
ObjectName | Gets / sets the name of object to get detailed information about it.
ObjectScopes | Gets / sets object scopes filter.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Specified the DBMS schema name.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
TableKinds | Gets / sets tables filter by their kinds.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.
Wildcard | Gets / sets objects filter by their name.
Links
Events, TADMetaInfoQuery Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
Events TADMetaInfoQuery Class Legend Properties Send Feedback

The published members of the TADMetaInfoQuery class are listed here.

Events
Event | Description
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
Class

TADMetaInfoQuery Class

Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
BaseObjectName | Gets / sets the name of base object.
CatalogName | Specified the DBMS catalog name
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
FetchOptions | The set of options to control rows fetching.
FormatOptions | The set of options to control data representation.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
MetaInfoKind | Gets / sets the kind of metadata to retrieve.
ObjectName | Gets / sets the name of object to get detailed information about it.
ObjectScopes | Gets / sets object scopes filter.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Specified the DBMS schema name.
TableKinds | Gets / sets tables filter by their kinds.
Transaction | Gets / sets reference to transaction object.
UpdateTransaction | Gets / sets reference to transaction object.
Wildcard | Gets / sets objects filter by their name.
Links
Events, TADMetaInfoQuery Class, Legend, Properties
What do you think about this topic? Send feedback!


TADMetaInfoQuery.ActiveStoredUsage Property

TADMetaInfoQuery.ActiveStoredUsage Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Controls how to use Active property value saved to DFM.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
See Also

TDataSet.Active

What do you think about this topic? Send feedback!


TADMetaInfoQuery.AfterGetRecord Event

TADMetaInfoQuery.AfterGetRecord Event
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset one time for each fetched record.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecord event fires after dataset fetched next rowset as result of navigation methods calls. The event fires one time for each fetched record. For example, fetching occurs automatically inside of Next, Last, Locate methods. Inside of an event handler application may read dataset fields to get fetched record field values.

Syntax
property AfterGetRecord: TADDataSetEvent;
See Also

AfterGetRecords

What do you think about this topic? Send feedback!


TADMetaInfoQuery.AfterGetRecords Event

TADMetaInfoQuery.AfterGetRecords Event
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecords event fires after dataset fetched next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property AfterGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord

What do you think about this topic? Send feedback!


TADMetaInfoQuery.AfterRowRequest Event

TADMetaInfoQuery.AfterRowRequest Event
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching record.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The AfterRowRequest event fires after dataset fetched current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property AfterRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest

What do you think about this topic? Send feedback!


TADMetaInfoQuery.Aggregates Property

TADMetaInfoQuery.Aggregates Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The collection of client side aggregates, defined for dataset.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use Aggregates to define client side aggregating formulas, that will be automatically maintained and calculated for group of or for all records of dataset.

All records in the group of records has the same field values for defined set of fields. Aggregates performing calculation for group of records must be associated with one of the indexes. These aggregate expressions will be calculated only is associated index is current and active.

Adding aggregate field does not add TADAggregate object to Aggregates collection. That are two alternative ways - to use aggregate fields or to use Aggregates.

DataSet will automatically maintain and calculate Aggregates values when dataset is fetching the data or application edits the data, if AggregatesActive is True. If application needs to perform large updates to dataset and aggregate values are not needed while updating, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

When aggregates are maintained, the Value method of every active aggregate object returns a value that reflects the current data in the dataset. When users edit the data in the dataset, these values are recalculated to reflect the user's changes.

The expressions in Aggregates must contain aggregating functions, like a SUM, COUNT. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Aggregates: TADAggregates;
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch

Example 1
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.

What do you think about this topic? Send feedback!


TADMetaInfoQuery.AggregatesActive Property

TADMetaInfoQuery.AggregatesActive Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example published See Also Send Feedback

Controls automatic calculation of aggregate values.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use AggregatesActive to get / set the flag controlling automatic maintenance and calculation of dataset aggregate values.

When AggregatesActive is False (the default), the dataset does not maintain aggregates. This allows the dataset to perform large updates to the dataset or fetch big volumes of data without overhead of calculating aggregate values, which happens at fetching or data editing. When AggregatesActive is True, the dataset calculates and maintains all aggregate values specified by the Aggregates property that are compatible with the current index.

To selectively enable and disable aggregates rather than turning them all on or off at once, use the Active property of individual TADAggregate objects. These objects are available through the Aggregates property.

If application needs to perform batch updates to dataset, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property AggregatesActive: Boolean;
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch

Example
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;
What do you think about this topic? Send feedback!


TADMetaInfoQuery.BaseObjectName Property

TADMetaInfoQuery.BaseObjectName Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Gets / sets the name of base object.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

The BaseObjectName property value meaning and optionality depends on MetaInfoKind:

MetaInfoKind | Meaning
mkIndexFields | Table name.
mkPrimaryKeyFields | Table name.
mkForeignKeyFields | Table name.
mkProcs | Package name.
mkProcArgs | Package name.

The BaseObjectName property value together with CatalogName and SchemaName constitutes the full base object name. If current DBMS session may "see" few objects with the same name, but in different catalogs and/or schemas, then we strongly suggest to specify CatalogName and/or SchemaName property values to explicitly limit the list of objects.

If BaseObjectName is case sensitive or contains special character, then it must be explicitly quoted.

Assignment to this property value closes dataset.

Syntax
property BaseObjectName: String;
See Also

MetaInfoKind, CatalogName, SchemaName, ObjectName

Example 1
  // SQL Server: retrieve foreign key fields for FK_DEPARTMENTS constraint of the Northwind.dbo.Employees table
  ADMetaInfoQuery1.BaseObjectName := 'Northwind.dbo.Employees';
  ADMetaInfoQuery1.ObjectName := 'FK_DEPARTMENTS';
  ADMetaInfoQuery1.MetaInfoKind := mkForeignKeyFields;
  ADMetaInfoQuery1.Open;
Example 2
  // Oracle: retrieve procedure list for the SYS.DBMS_SQL package
  ADMetaInfoQuery1.BaseObjectName := 'SYS.DBMS_SQL';
  ADMetaInfoQuery1.MetaInfoKind := mkProcs;
  ADMetaInfoQuery1.Open;
What do you think about this topic? Send feedback!


TADMetaInfoQuery.BeforeGetRecords Event

TADMetaInfoQuery.BeforeGetRecords Event
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching next rowset.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The BeforeGetRecords event fires before dataset will fetch next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property BeforeGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, AfterGetRecords

What do you think about this topic? Send feedback!


TADMetaInfoQuery.BeforeRowRequest Event

TADMetaInfoQuery.BeforeRowRequest Event
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching record.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The BeforeRowRequest event fires before dataset will fetch current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property BeforeRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest

What do you think about this topic? Send feedback!


TADMetaInfoQuery.CatalogName Property

TADMetaInfoQuery.CatalogName Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Specified the DBMS catalog name

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

Use the CatalogName to restrict the metadata retrieval to the specified DBMS catalog.

When CatalogName or SchemaName are assigned, then ObjectScopes may be not used.

Syntax
property CatalogName: String;
See Also

SchemaName, ObjectScopes

What do you think about this topic? Send feedback!


TADMetaInfoQuery.Connection Property

TADMetaInfoQuery.Connection Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Specifies the FireDAC connection component to use.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

Use Connection to specify an FireDAC connection object to use to connect to an DBMS.

At design-time, select from the list of available TADCustomConnection objects (if any have been added to the application) invoked from the Object Inspector. If a form or data module has TADCustomConnection dropped on it, then TADRdbmsDataSet assigns this connection object to Connection property automatically right after dropping on the form or data module.

At runtime, set Connection to reference an existing TADConnection object.

The TADRdbmsDataSet can be bind to TADCustomConnection object using Connection or ConnectionName property. Using ConnectionName property allows to bind to a connection object, if it is even not yet created or is not accessible.

Syntax
property Connection: TADCustomConnection;
See Also

ConnectionName

What do you think about this topic? Send feedback!


TADMetaInfoQuery.ConnectionName Property

TADMetaInfoQuery.ConnectionName Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example published See Also Send Feedback

Specifies the FireDAC connection to use by its name.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use ConnectionName to specify an FireDAC connection to use to connect to an DBMS. The ConnectionName property value specifies the name of the connection. It must match to the:

  • name of one of connection definitions, either stored in external file (persistent) or created on fly (private);
  • ConnectionName of one of the TADConnection objects.

The ConnectionName property value must be specified before Prepare call. If it matches the name of one of connection definitions, then FireDAC will transparently create connection object and link the dataset with it.

The TADRdbmsDataSet cab be bind to TADCustomConnection object using Connection or ConnectionName property. Using Connection property allows to bind to a connection object explicitly and reduce the overhead for resolving connection names.

Syntax
property ConnectionName: String;
See Also

Connection, TADCustomConnection.Temporary

Example
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');
What do you think about this topic? Send feedback!


TADMetaInfoQuery.FetchOptions Property

TADMetaInfoQuery.FetchOptions Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

The set of options to control rows fetching.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The FetchOptions property is the set of properties, controlling the fetching of cursor rows. These properties will inherit its values from FetchOptions of connection object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions

What do you think about this topic? Send feedback!


TADMetaInfoQuery.FormatOptions Property

TADMetaInfoQuery.FormatOptions Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

The set of options to control data representation.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Params

What do you think about this topic? Send feedback!


TADMetaInfoQuery.Indexes Property

TADMetaInfoQuery.Indexes Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Lists all client indexes that apply to the dataset.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use Indexes to define client side data views on the dataset records. Indexes are a collection of the TADIndex objects, each of them defines optional:

  • Sorting by fields (Fields, CaseInsFields, DescFields, Options).
  • Sorting by expression (Expression, Options).
  • Records filter (Filter, FilterOptions).
  • Records distinction flag (Distinct).

The individual indexes are not just the sort and filter definitions. FireDAC maintains a consistent view on the data for each active index, while application fetches data or edits data. That creates additional overhead, but allows to switch between indexes without delays.

To make a view current, set it Selected property to True or dataset IndexName property to the view name. Note, the view must have Active = True to be maintained.

Dataset maintains Indexes views, when IndexesActive is True. When an application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Setting IndexFieldNames does not add a TADIndex object to Indexes collection. Defining IndexDefs before dataset opening, will clear Indexes and fill them using IndexDefs information. So, there are two alternative ways - use IndexDefs or use Indexes. We suggest to use Indexes, as it is more flexible.

Some of the navigation methods, like a Locate / Lookup / SetRange are using indexes to optimize their operations.

The sorting and filter expressions in Indexes supports syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).
Syntax
property Indexes: TADIndexes;
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch

Example 1
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.

What do you think about this topic? Send feedback!


TADMetaInfoQuery.IndexesActive Property

TADMetaInfoQuery.IndexesActive Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example published See Also Send Feedback

Controls automatic maintenance of Index'es.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexesActive to indicate whether the dataset should maintain the data views, defined by the Indexes collection.

When IndexesActive is False, the dataset does not maintain the data views. That avoids the overhead of updating views, while data is fetched or is edited. When IndexesActive is True (by default), the dataset maintains the data views.

When indexes are maintained, each of them may be current index, selected by TADIndex.Selected or by IndexName properties.

To selectively enable and disable data views rather than turning them all on or off at once, use the Active property of individual TADIndex objects. These objects are available through the Indexes property.

If application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property IndexesActive: Boolean;
See Also

Sorting Records, Indexes, BeginBatch, EndBatch

Example
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;
What do you think about this topic? Send feedback!


TADMetaInfoQuery.IndexFieldNames Property

TADMetaInfoQuery.IndexFieldNames Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example published See Also Send Feedback

Lists the field names to use as an index.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexFieldNames as an alternative method of specifying the current index to use for a dataset.

Specify the name of each field on which to index the dataset, separating names with semicolons. Ordering of field names is significant. Optionally specify the postfix for any of fields in form "field[:[D][A][N]]", where:

- 'D' - use descending sorting on this field;

- 'A' - use ascending sorting on this field;

- 'N' - use case-insensitive sorting on this field.

Use IndexFieldNames to create sort orders on the fly. The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.

Syntax
property IndexFieldNames: String;
See Also

Sorting Records, Indexes, IndexName

Example
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';
What do you think about this topic? Send feedback!


TADMetaInfoQuery.IndexName Property

TADMetaInfoQuery.IndexName Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the current index for the dataset by its name.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexName to specify the current index for the dataset.

If IndexName is empty, the dataset's sort order is based on the IndexFieldNames property or on its default ordering as it is in dataset. If IndexName contains a name of valid index from Indexes collection, then that index is used to determine data view (including sort order) of records.

IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.

Syntax
property IndexName: String;
See Also

Sorting Records, Indexes, IndexFieldNames

Example
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';
What do you think about this topic? Send feedback!


TADMetaInfoQuery.LocalSQL Property

TADMetaInfoQuery.LocalSQL Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

The reference to a Local SQL engine.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

Use this property to get / set reference to a Local SQL engine.

When engine and Local SQL connection are active, then right after setting LocalSQL property, the dataset will be opened (if not yet) and will be registered in Local SQL engine. Otherwise dataset will be registered when engine and connection will be active. The TADMemTable structure must be defined before it will be opened.

The dataset will be registered using its Name property value. So, its Name property value must be not empty and unique across all datasets linked to the same Local SQL engine.

Setting this property to nil unregisters this dataset from Local SQL engine.

Syntax
property LocalSQL: TADCustomLocalSQL;
See Also

Local SQL, TADLocalSQL, TADMemTable

What do you think about this topic? Send feedback!


TADMetaInfoQuery.MetaInfoKind Property

TADMetaInfoQuery.MetaInfoKind Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the kind of metadata to retrieve.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example, published, See Also
Description

The MetaInfoKind property determines what meta information will be retrieved. If DBMS or FireDAC driver does not support specified MetaInfoKind (for example, mkGenerators for Sybase SQL Anywhere), then no exception will be raised at Open and no records will be returned.

Assignment to this property value closes dataset.

Syntax
property MetaInfoKind: TADPhysMetaInfoKind;
See Also

Working with Metadata, CatalogName, SchemaName, BaseObjectName, Overload, ObjectName

Example
  // get the table list for Northwind catalog, dbo schema
  ADMetaInfoQuery1.CatalogName := 'Northwind';
  ADMetaInfoQuery1.SchemaName := 'dbo';
  ADMetaInfoQuery1.MetaInfoKind := mkTables;
  ADMetaInfoQuery1.Open;
What do you think about this topic? Send feedback!


TADMetaInfoQuery.ObjectName Property

TADMetaInfoQuery.ObjectName Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the name of object to get detailed information about it.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example, published, See Also
Description

The ObjectName property value defines the database objects, for which will be returned detailed information. The meaning, optionality and usage of the catalog and schema names depends on MetaInfoKind:

MetaInfoKind | Meaning | Catalog and schema names
mkTableFields | Table name. | Applicable.
mkIndexes | Table name. | Applicable.
mkIndexFields | Index name. | --
mkPrimaryKey | Table name. | Applicable.
mkForeignKeys | Table name. | Applicable.
mkForeignKeyFields | Foreign key constraint name. | --
mkProcArgs | Stored procedure name. | Applicable, for non-packages stored procedures.

The ObjectName together with CatalogName and SchemaName may constitute the full object name. If current DBMS session may "see" few objects with the same name, but in different catalogs and/or schemas, then we strongly suggest to specify CatalogName and/or SchemaName property values to explicitly limit the list of objects.

If object name is case sensitive or contains special character, then it must be explicitly quoted.

Assignment to this property value closes dataset.

Syntax
property ObjectName: String;
See Also

Working with Metadata, MetaInfoKind, CatalogName, SchemaName, BaseObjectName

Example
  // get the field list of Northwind.dbo.Employees table
  ADMetaInfoQuery1.CatalogName := 'Northwind';
  ADMetaInfoQuery1.SchemaName := 'dbo';
  ADMetaInfoQuery1.ObjectName := 'Employees';
  ADMetaInfoQuery1.MetaInfoKind := mkTableFields;
  ADMetaInfoQuery1.Open;
What do you think about this topic? Send feedback!


TADMetaInfoQuery.ObjectScopes Property

TADMetaInfoQuery.ObjectScopes Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Gets / sets object scopes filter.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

Use the ObjectScopes property value to filter database objects by their scope:

Scope | Meaning
osMy | Objects created by the current login user.
osSystem | Objects belonging to the DBMS.
osOther | All other objects.

Assignment to this property value closes dataset. When CatalogName or SchemaName properties are assigned then ObjectScopes may be not used.

Syntax
property ObjectScopes: TADPhysObjectScopes;
See Also

TableKinds, CatalogName, SchemaName

What do you think about this topic? Send feedback!


TADMetaInfoQuery.OnCommandChanged Event

TADMetaInfoQuery.OnCommandChanged Event
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after the SQL property value is changed.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The OnCommandChanged event fires after the SQL command text value is changed:

  • for TADQuery - after SQL is changed;
  • for TADStoredProc - after StoredProcName is changed;
  • for TADTable - after TableName is changed.
Syntax
property OnCommandChanged: TNotifyEvent;
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName

What do you think about this topic? Send feedback!


TADMetaInfoQuery.OnError Event

TADMetaInfoQuery.OnError Event
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The event fires when an error happens, while dataset is communicating with DBMS.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
AInitiator | The reference to interface of object, which initially raised the exception.
AException | The exception object, which may be modified or even replaced by another exception object instance.
Description

The OnError event fires, when dataset executes one of the following operations and an error happens:

  • Prepare. The dataset is preparing DBMS command text for execution.
  • Open. The dataset is executing DBMS command to open cursor.
  • Execute , ExecSQL , ExecProc. The dataset is executing DBMS command text.
  • Navigation methods. The dataset is fetching rows from cursor.

If most cases AException object will of EADDBEngineException class. If AException is of EADDBArrayExecuteError class, then it is Array DML error handling case. You should use a code like in the first example.

To centralize error handling, you can consider to use TADCustomConnection.OnError.

Syntax
property OnError: TADErrorEvent;
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError

Example 1

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;
Example 2

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;
What do you think about this topic? Send feedback!


TADMetaInfoQuery.ResourceOptions Property

TADMetaInfoQuery.ResourceOptions Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

The set of options to control resources usage.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The ResourceOptions property is the set of properties, controlling the resources usage by the dataset. These properties will inherit its values from ResourceOptions of connection object.

Syntax
property ResourceOptions: TADBottomResourceOptions;
See Also

Setting Options, TADBottomResourceOptions

What do you think about this topic? Send feedback!


TADMetaInfoQuery.SchemaAdapter Property

TADMetaInfoQuery.SchemaAdapter Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use SchemaAdapter property to set a reference to the TADSchemaAdapter object to enable Centralized Cashed Updates mode. The schema adapter object will be used as a central change log share by few datasets.

To enable propagation of master dataset changes to a detail dataset set FetchOptions.DetailCascade to True for a detail dataset. Also both master and detail datasets must point to the same TADSchemaAdapter object.

Syntax
property SchemaAdapter: TADCustomSchemaAdapter;
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade

Example
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;
What do you think about this topic? Send feedback!


TADMetaInfoQuery.SchemaName Property

TADMetaInfoQuery.SchemaName Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Specified the DBMS schema name.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

Use the SchemaName to restrict the metadata retrieval to the specified DBMS schema.

When CatalogName or SchemaName are assigned, then ObjectScopes may be not used.

Syntax
property SchemaName: String;
See Also

CatalogName, ObjectScopes

What do you think about this topic? Send feedback!


TADMetaInfoQuery.TableKinds Property

TADMetaInfoQuery.TableKinds Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Gets / sets tables filter by their kinds.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The TableKinds property value filters database tables, by their kinds. Assignment to this property will close dataset.

Kind | Meaning
tkSynonym | Synonyms.
tkTable | Regular tables.
tkView | Views.
tkTempTable | Temporary tables.
tkLocalTable | Local tables.
Syntax
property TableKinds: TADPhysTableKinds;
See Also

Working with Metadata, ObjectScopes, CatalogName, SchemaName

What do you think about this topic? Send feedback!


TADMetaInfoQuery.Transaction Property

TADMetaInfoQuery.Transaction Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Gets / sets reference to transaction object.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The Transaction property allows to associate dataset with explicit transaction object. If it is not specified, then dataset will be associated with connection default transaction.

The specified transaction object will be used only for Prepare, Open, ExecSQL, ExecProc, Execute methods. For commands, generated to apply changes to database, FireDAC will use UpdateTransaction, if it is specified, otherwise - Transaction.

Currently explicit transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property Transaction: TADCustomTransaction;
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction

What do you think about this topic? Send feedback!


TADMetaInfoQuery.UpdateTransaction Property

TADMetaInfoQuery.UpdateTransaction Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets reference to transaction object.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, Example, published, See Also
Description

The UpdateTransaction property allows to associate dataset internal update commands with explicit transaction object. If it is not specified, then dataset update commands will be associated with connection default update transaction. If it is not specified, then - with dataset Transaction.

For Prepare, Open, ExecSQL, ExecProc, Execute methods will be used Transaction objects.

Currently explicit update transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property UpdateTransaction: TADCustomTransaction;
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction

Example
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction
What do you think about this topic? Send feedback!


TADMetaInfoQuery.Wildcard Property

TADMetaInfoQuery.Wildcard Property
TADMetaInfoQuery Class TADMetaInfoQuery Members uADCompClient Namespace published See Also Send Feedback

Gets / sets objects filter by their name.

Group

published

Links
TADMetaInfoQuery Class, TADMetaInfoQuery Members, uADCompClient Namespace, published, See Also
Description

The Wildcard property value is the LIKE mask, which will be applied to the object names.

Syntax
property Wildcard: String;
See Also

ObjectScopes, TableKinds

What do you think about this topic? Send feedback!


TADQuery Class

TADQuery Class
public published TADQuery Members Classes See Also Send Feedback

The class implementing dataset, capable to execute SQL queries.

Group

Classes

Class Hierarchy
  uADCompClient_TADQueryuADCompClient_TADQueryuADCompClient_TADQueryuADCompClient_TADQueryuADCompClient_TADQuery
File

uADCompClient

Links
public, published, TADQuery Members, Classes, See Also
Description

Use TADQuery to execute SQL queries, browse the result sets and edit the result set records.

See the TADCustomQuery description for more details.

Syntax
TADQuery = class(TADCustomQuery);
See Also

Executing Command, TADCommand, TADCustomQuery, IADPhysCommand

What do you think about this topic? Send feedback!


TADQuery Members

TADQuery Members
Events TADQuery Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADQuery.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADQuery Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecSQL | Executes the SQL statement for the query.
ExecSQL | Executes the specified SQL statement for the query.
ExecSQL | Executes the specified SQL statement and parameter values for the query.
ExecSQL | Executes the specified SQL statement and assigns parameter values for the query.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DataSource | Specifies the data source object from which associated dataset to get matching field values to the details dataset parameters.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the query SQL text.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
SQL | Contains the text of the SQL statement to execute for the query.
Table | The reference to DatS table object, actually representing the internal data storage.
Text | Points to the actual text of the SQL query passed to the DBMS CLI.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.
Links
Events, TADQuery Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADQuery Class Legend Properties Send Feedback

The public members of the TADQuery class are listed here.

Class

TADQuery Class

Properties
Property | Description
MacroCount | Returns the number of macro in Macros collection.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
Links
TADQuery Class, Legend, Properties
What do you think about this topic? Send feedback!


TADQuery.MacroCount Property

TADQuery.MacroCount Property
TADQuery Class TADQuery Members uADCompClient Namespace public See Also Send Feedback

Returns the number of macro in Macros collection.

Group

public

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, public, See Also
Description

The MacroCount property teturns the number of of macro substitution variables in Macros collection.

Syntax
property MacroCount: Word;
See Also

Macros

What do you think about this topic? Send feedback!


TADQuery.RowsAffected Property

TADQuery.RowsAffected Property
TADQuery Class TADQuery Members uADCompClient Namespace Example public Send Feedback

Returns the number of rows operated upon by the latest query execution.

Group

public

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, public
Description

Inspect RowsAffected to determine how many rows were inserted, updated, deleted or fetched by the last dataset operation. If no rows were processed, RowsAffected = 0. If numbers of processed rows is not accessible, RowsAffected = –1.

At MS SQL Server RowsAffected may be unexpectedly equal to -1, if stored procedure or table trigger omits SET NOCOUNT ON. Also, this may be a reason of "Command inserted / updated / deleted [0] records instead of [1] record" error at posting updates to database. Check MS BOL for more details about SET NOCOUNT ON.

Syntax
property RowsAffected: TADCounter;
Example
procedure TForm1.ADQuery1AfterExecute(ASender: TObject);
begin
  if ADQuery1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADQuery1.Command1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADQuery1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADQuery1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADQuery1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADQuery1.RowsAffected]);
    end;
end;
What do you think about this topic? Send feedback!


published

published
Events TADQuery Class Legend Properties Send Feedback

The published members of the TADQuery class are listed here.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADQuery Class

Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FormatOptions | The set of options to control data representation.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
Params | Contains the parameters for a SQL statement.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SQL | Contains the text of the SQL statement to execute for the query.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateTransaction | Gets / sets reference to transaction object.
Links
Events, TADQuery Class, Legend, Properties
What do you think about this topic? Send feedback!


TADQuery.ActiveStoredUsage Property

TADQuery.ActiveStoredUsage Property
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Controls how to use Active property value saved to DFM.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
See Also

TDataSet.Active

What do you think about this topic? Send feedback!


TADQuery.AfterApplyUpdates Event

TADQuery.AfterApplyUpdates Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after cached updates are applied to DB.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The AfterApplyUpdates event fires after cached updates are applied to DB as result of ApplyUpdates method call.

Syntax
property AfterApplyUpdates: TADAfterApplyUpdatesEvent;
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates

What do you think about this topic? Send feedback!


TADQuery.AfterExecute Event

TADQuery.AfterExecute Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after SQL command execution is finished.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The AfterExecute event fires after SQL command execution is finished as result of Execute method call.

Syntax
property AfterExecute: TADDataSetEvent;
See Also

TADDataSetEvent, Execute, BeforeExecute

What do you think about this topic? Send feedback!


TADQuery.AfterGetRecord Event

TADQuery.AfterGetRecord Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset one time for each fetched record.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecord event fires after dataset fetched next rowset as result of navigation methods calls. The event fires one time for each fetched record. For example, fetching occurs automatically inside of Next, Last, Locate methods. Inside of an event handler application may read dataset fields to get fetched record field values.

Syntax
property AfterGetRecord: TADDataSetEvent;
See Also

AfterGetRecords

What do you think about this topic? Send feedback!


TADQuery.AfterGetRecords Event

TADQuery.AfterGetRecords Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecords event fires after dataset fetched next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property AfterGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord

What do you think about this topic? Send feedback!


TADQuery.AfterRowRequest Event

TADQuery.AfterRowRequest Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching record.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The AfterRowRequest event fires after dataset fetched current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property AfterRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest

What do you think about this topic? Send feedback!


TADQuery.Aggregates Property

TADQuery.Aggregates Property
TADQuery Class TADQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The collection of client side aggregates, defined for dataset.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use Aggregates to define client side aggregating formulas, that will be automatically maintained and calculated for group of or for all records of dataset.

All records in the group of records has the same field values for defined set of fields. Aggregates performing calculation for group of records must be associated with one of the indexes. These aggregate expressions will be calculated only is associated index is current and active.

Adding aggregate field does not add TADAggregate object to Aggregates collection. That are two alternative ways - to use aggregate fields or to use Aggregates.

DataSet will automatically maintain and calculate Aggregates values when dataset is fetching the data or application edits the data, if AggregatesActive is True. If application needs to perform large updates to dataset and aggregate values are not needed while updating, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

When aggregates are maintained, the Value method of every active aggregate object returns a value that reflects the current data in the dataset. When users edit the data in the dataset, these values are recalculated to reflect the user's changes.

The expressions in Aggregates must contain aggregating functions, like a SUM, COUNT. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Aggregates: TADAggregates;
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch

Example 1
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.

What do you think about this topic? Send feedback!


TADQuery.AggregatesActive Property

TADQuery.AggregatesActive Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Controls automatic calculation of aggregate values.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use AggregatesActive to get / set the flag controlling automatic maintenance and calculation of dataset aggregate values.

When AggregatesActive is False (the default), the dataset does not maintain aggregates. This allows the dataset to perform large updates to the dataset or fetch big volumes of data without overhead of calculating aggregate values, which happens at fetching or data editing. When AggregatesActive is True, the dataset calculates and maintains all aggregate values specified by the Aggregates property that are compatible with the current index.

To selectively enable and disable aggregates rather than turning them all on or off at once, use the Active property of individual TADAggregate objects. These objects are available through the Aggregates property.

If application needs to perform batch updates to dataset, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property AggregatesActive: Boolean;
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch

Example
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;
What do you think about this topic? Send feedback!


TADQuery.BeforeApplyUpdates Event

TADQuery.BeforeApplyUpdates Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires before cached updates are applied to DB.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The BeforeApplyUpdates event fires before cached updates are applied to database as result of ApplyUpdates method call.

Syntax
property BeforeApplyUpdates: TADDataSetEvent;
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates

What do you think about this topic? Send feedback!


TADQuery.BeforeExecute Event

TADQuery.BeforeExecute Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires before SQL command execution is started.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The BeforeExecute event fires before SQL command execution is started as result of Execute method call.

Syntax
property BeforeExecute: TADDataSetEvent;
See Also

TADDataSetEvent, Execute, AfterExecute

What do you think about this topic? Send feedback!


TADQuery.BeforeGetRecords Event

TADQuery.BeforeGetRecords Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching next rowset.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The BeforeGetRecords event fires before dataset will fetch next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property BeforeGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, AfterGetRecords

What do you think about this topic? Send feedback!


TADQuery.BeforeRowRequest Event

TADQuery.BeforeRowRequest Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching record.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The BeforeRowRequest event fires before dataset will fetch current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property BeforeRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest

What do you think about this topic? Send feedback!


TADQuery.CachedUpdates Property

TADQuery.CachedUpdates Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Specifies whether dataset will log changes to the data without immediate applying of them to the database.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

CachedUpdates enables (True) or disables (False) the logging of data changes (Insert/Post, Edit/Post, Delete) without immediate applying of them to the database.

An application must explicitly apply changes from change log to the database, using ApplyUpdates method. All changes will be written in comparably small amount of time in single transaction. The main benefits of enabling cached updates are:

  • fewer transactions and shorter transaction times;
  • minimization of network traffic;
  • simplified implementation of undo / redo functionality for dataset;
  • ability to implement application offline mode or briefcase model.

The potential drawbacks of enabling cached updates are:

  • other applications can access and change the actual data on the server while users are editing local copies of the data, resulting in an update conflict when cached updates are applied to the database;
  • other applications cannot access data changes made by an application until its cached updates are applied to the database.

Note, to change CachedUpdate property value for TADTable, it must be inactive.

Syntax
property CachedUpdates: Boolean;
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates

Example
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;
What do you think about this topic? Send feedback!


TADQuery.Connection Property

TADQuery.Connection Property
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Specifies the FireDAC connection component to use.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

Use Connection to specify an FireDAC connection object to use to connect to an DBMS.

At design-time, select from the list of available TADCustomConnection objects (if any have been added to the application) invoked from the Object Inspector. If a form or data module has TADCustomConnection dropped on it, then TADRdbmsDataSet assigns this connection object to Connection property automatically right after dropping on the form or data module.

At runtime, set Connection to reference an existing TADConnection object.

The TADRdbmsDataSet can be bind to TADCustomConnection object using Connection or ConnectionName property. Using ConnectionName property allows to bind to a connection object, if it is even not yet created or is not accessible.

Syntax
property Connection: TADCustomConnection;
See Also

ConnectionName

What do you think about this topic? Send feedback!


TADQuery.ConnectionName Property

TADQuery.ConnectionName Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Specifies the FireDAC connection to use by its name.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use ConnectionName to specify an FireDAC connection to use to connect to an DBMS. The ConnectionName property value specifies the name of the connection. It must match to the:

  • name of one of connection definitions, either stored in external file (persistent) or created on fly (private);
  • ConnectionName of one of the TADConnection objects.

The ConnectionName property value must be specified before Prepare call. If it matches the name of one of connection definitions, then FireDAC will transparently create connection object and link the dataset with it.

The TADRdbmsDataSet cab be bind to TADCustomConnection object using Connection or ConnectionName property. Using Connection property allows to bind to a connection object explicitly and reduce the overhead for resolving connection names.

Syntax
property ConnectionName: String;
See Also

Connection, TADCustomConnection.Temporary

Example
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');
What do you think about this topic? Send feedback!


TADQuery.Constraints Property

TADQuery.Constraints Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Specifies record-level client constraints that must be met when editing the data.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use Constraints to maintain record-level constraints for the dataset.

Record-level constraints force business ruless limiting few fields in a single record. This constraints are checked at end of data editing (Post / AppendRecord / InsertRecord). Constraints, limiting single field are field constraints and must specified at TField.CustomConstraint or TField.ImportedConstraint.

The Constraints checking is performed when ConstraintsEnabled is True. If application needs to perform large updates to the dataset and application can guarantee the data consistancy, then set ConstraintsEnabled to False before updates, and return to original value after updates. The constraints are not checked at data fetching.

The expressions in Constraints must be predicates, evaluating to Boolean value. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • Client dataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Constraints;
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint

Example
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;
What do you think about this topic? Send feedback!


TADQuery.ConstraintsEnabled Property

TADQuery.ConstraintsEnabled Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Specifies whether the dataset perform constraint checking.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use ConstraintsEnabled to get / set the flag controlling automatic record-level constraints enforcement.

When ConstraintsEnabled is False (the default), the dataset does not check Constraints. This allows the dataset to perform the large data updates without overhead of checking constraints. When ConstraintsEnabled is True, the dataset checks Constraints at at end of data editing (Post / AppendRecord / InsertRecord).

If application needs to perform batch updates to dataset, then set ConstraintsEnabled to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property ConstraintsEnabled: Boolean;
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired

Example
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;
What do you think about this topic? Send feedback!


TADQuery.DetailFields Property

TADQuery.DetailFields Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use DetailFields property value to specify semicolon separated list of the detail dataset field names, used to establish a master-detail relationship with this dataset.

The DetailFields property is useful only for parameter based master-detail setup. For range based setup the indexed fields are used as the detail field list. When DetailFields is not specified explicitly, then field names matching to query parameter names will be used as DetailFields value.

The DetailFields will be used only to assign specified field values when a new record is inserted into detail dataset. The mechanism used to filter the detail dataset records does not use DetailFields.

Syntax
property DetailFields: String;
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName

Example
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';
What do you think about this topic? Send feedback!


TADQuery.FetchOptions Property

TADQuery.FetchOptions Property
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

The set of options to control rows fetching.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The FetchOptions property is the set of properties, controlling the fetching of cursor rows. These properties will inherit its values from FetchOptions of connection object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions

What do you think about this topic? Send feedback!


TADQuery.FilterChanges Property

TADQuery.FilterChanges Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Specifies what kinds of changed records must be "visible" in the dataset.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

The FilterChanges property allows to get / set changed records kinds, which must be accessible through navigation interface of dataset ("visible" in dataset):

Kind | Meaning
rtModified | Records changed after fetching or last CommitUpdates / CancelUpdates.
rtInserted | New records, not yet posted to DB and added after dataset open or after last CommitUpdates.
rtDeleted | Deleted records, not yet deleted from DB and deleted after dataset open or after last CommitUpdates.
rtUnmodified | Unchanged records.
rtHasErrors | Records having associated errors after ApplyUpdates. To get an error object use RowError property.
Syntax
property FilterChanges: TADUpdateRecordTypes;
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus

Example
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];
What do you think about this topic? Send feedback!


TADQuery.FormatOptions Property

TADQuery.FormatOptions Property
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

The set of options to control data representation.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Params

What do you think about this topic? Send feedback!


TADQuery.Indexes Property

TADQuery.Indexes Property
TADQuery Class TADQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Lists all client indexes that apply to the dataset.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use Indexes to define client side data views on the dataset records. Indexes are a collection of the TADIndex objects, each of them defines optional:

  • Sorting by fields (Fields, CaseInsFields, DescFields, Options).
  • Sorting by expression (Expression, Options).
  • Records filter (Filter, FilterOptions).
  • Records distinction flag (Distinct).

The individual indexes are not just the sort and filter definitions. FireDAC maintains a consistent view on the data for each active index, while application fetches data or edits data. That creates additional overhead, but allows to switch between indexes without delays.

To make a view current, set it Selected property to True or dataset IndexName property to the view name. Note, the view must have Active = True to be maintained.

Dataset maintains Indexes views, when IndexesActive is True. When an application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Setting IndexFieldNames does not add a TADIndex object to Indexes collection. Defining IndexDefs before dataset opening, will clear Indexes and fill them using IndexDefs information. So, there are two alternative ways - use IndexDefs or use Indexes. We suggest to use Indexes, as it is more flexible.

Some of the navigation methods, like a Locate / Lookup / SetRange are using indexes to optimize their operations.

The sorting and filter expressions in Indexes supports syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).
Syntax
property Indexes: TADIndexes;
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch

Example 1
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.

What do you think about this topic? Send feedback!


TADQuery.IndexesActive Property

TADQuery.IndexesActive Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Controls automatic maintenance of Index'es.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexesActive to indicate whether the dataset should maintain the data views, defined by the Indexes collection.

When IndexesActive is False, the dataset does not maintain the data views. That avoids the overhead of updating views, while data is fetched or is edited. When IndexesActive is True (by default), the dataset maintains the data views.

When indexes are maintained, each of them may be current index, selected by TADIndex.Selected or by IndexName properties.

To selectively enable and disable data views rather than turning them all on or off at once, use the Active property of individual TADIndex objects. These objects are available through the Indexes property.

If application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property IndexesActive: Boolean;
See Also

Sorting Records, Indexes, BeginBatch, EndBatch

Example
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;
What do you think about this topic? Send feedback!


TADQuery.IndexFieldNames Property

TADQuery.IndexFieldNames Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Lists the field names to use as an index.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexFieldNames as an alternative method of specifying the current index to use for a dataset.

Specify the name of each field on which to index the dataset, separating names with semicolons. Ordering of field names is significant. Optionally specify the postfix for any of fields in form "field[:[D][A][N]]", where:

- 'D' - use descending sorting on this field;

- 'A' - use ascending sorting on this field;

- 'N' - use case-insensitive sorting on this field.

Use IndexFieldNames to create sort orders on the fly. The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.

Syntax
property IndexFieldNames: String;
See Also

Sorting Records, Indexes, IndexName

Example
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';
What do you think about this topic? Send feedback!


TADQuery.IndexName Property

TADQuery.IndexName Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the current index for the dataset by its name.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexName to specify the current index for the dataset.

If IndexName is empty, the dataset's sort order is based on the IndexFieldNames property or on its default ordering as it is in dataset. If IndexName contains a name of valid index from Indexes collection, then that index is used to determine data view (including sort order) of records.

IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.

Syntax
property IndexName: String;
See Also

Sorting Records, Indexes, IndexFieldNames

Example
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';
What do you think about this topic? Send feedback!


TADQuery.LocalSQL Property

TADQuery.LocalSQL Property
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

The reference to a Local SQL engine.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

Use this property to get / set reference to a Local SQL engine.

When engine and Local SQL connection are active, then right after setting LocalSQL property, the dataset will be opened (if not yet) and will be registered in Local SQL engine. Otherwise dataset will be registered when engine and connection will be active. The TADMemTable structure must be defined before it will be opened.

The dataset will be registered using its Name property value. So, its Name property value must be not empty and unique across all datasets linked to the same Local SQL engine.

Setting this property to nil unregisters this dataset from Local SQL engine.

Syntax
property LocalSQL: TADCustomLocalSQL;
See Also

Local SQL, TADLocalSQL, TADMemTable

What do you think about this topic? Send feedback!


TADQuery.Macros Property

TADQuery.Macros Property
TADQuery Class TADQuery Members uADCompClient Namespace Example 1 Example 2 Example 3 published See Also Send Feedback

The collection of macro substitution variables.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example 1, Example 2, Example 3, published, See Also
Description

The Macros property is the collection of macro substitution variables. It is populated automatically after assigning SQL property, if ResourceOptions.MacroCreate = True. Otherwise it may be populated by hands. At Prepare call, macro values will be substituted into SQL, if ResourceOptions.MacroExpand = True.

Syntax
property Macros: TADMacros;
See Also

TADCustomQuery.SQL, Params, Prepare, TADMacros, TADResourceOptions.MacroCreate, TADResourceOptions.MacroExpand

Example 1

Substitute table name:

ADQuery1.SQL.Text := 'select * from &Tab';
ADQuery1.Macros[0].AsIdentifier := 'Order Details';
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from "Order Details"
Example 2

Substitute WHERE condition:

ADQuery1.SQL.Text := 'select * from MyTab {if !cond} where !cond {fi}';

ADQuery1.Macros[0].AsString := 'ID > 100';
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from MyTab where ID > 100

ADQuery1.Macros[0].Clear;
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from MyTab
Example 3

See FireDAC\Samples\Comp Layer\TADQuery\Macros demo for details.

What do you think about this topic? Send feedback!


TADQuery.MasterFields Property

TADQuery.MasterFields Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use MasterFields property value to specify semicolon separated list of the master dataset field names, used to establish a master-detail relationship with this dataset.

Specify MasterFields property value after assigning MasterSource property value. The mechanism used to filter this detail dataset records depends on the dataset class:

  • TADQuery and TADStoredProc will match master fields to this query / procedure parameters by their names. When the master dataset current record is changed, then this dataset parameters will get values from the corresponding MasterFields.
  • TADMemTable will match master fields to this dataset indexed fields by their positions. When the master dataset current record is changed, then a range will be applied to this dataset, where starting and ending range values are equal to the corresponding MasterFields field values. The application must have a current active index. The indexed fields will be the detail dataset fields used to establish mater-detail.
Syntax
property MasterFields: String;
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName

Example
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
What do you think about this topic? Send feedback!


TADQuery.MasterSource Property

TADQuery.MasterSource Property
TADQuery Class TADQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Gets / sets a master data source, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use MasterSource to specify the data source linked to a dataset, which will be used as master dataset in master-detail relationship between this and specified datasets.

Additionally application must specify MasterFields property value. See MasterFields property description for additional information.

Syntax
property MasterSource: TDataSource;
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName

Example 1
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.

What do you think about this topic? Send feedback!


TADQuery.OnCommandChanged Event

TADQuery.OnCommandChanged Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after the SQL property value is changed.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The OnCommandChanged event fires after the SQL command text value is changed:

  • for TADQuery - after SQL is changed;
  • for TADStoredProc - after StoredProcName is changed;
  • for TADTable - after TableName is changed.
Syntax
property OnCommandChanged: TNotifyEvent;
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName

What do you think about this topic? Send feedback!


TADQuery.OnError Event

TADQuery.OnError Event
TADQuery Class TADQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The event fires when an error happens, while dataset is communicating with DBMS.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
AInitiator | The reference to interface of object, which initially raised the exception.
AException | The exception object, which may be modified or even replaced by another exception object instance.
Description

The OnError event fires, when dataset executes one of the following operations and an error happens:

  • Prepare. The dataset is preparing DBMS command text for execution.
  • Open. The dataset is executing DBMS command to open cursor.
  • Execute , ExecSQL , ExecProc. The dataset is executing DBMS command text.
  • Navigation methods. The dataset is fetching rows from cursor.

If most cases AException object will of EADDBEngineException class. If AException is of EADDBArrayExecuteError class, then it is Array DML error handling case. You should use a code like in the first example.

To centralize error handling, you can consider to use TADCustomConnection.OnError.

Syntax
property OnError: TADErrorEvent;
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError

Example 1

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;
Example 2

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;
What do you think about this topic? Send feedback!


TADQuery.OnExecuteError Event

TADQuery.OnExecuteError Event
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

The event is triggered when an error happens, while executing a Array DML query.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
ATimes | The current Array DML size. It may be different from value of the Execute method ATimes parameter, if full operation is splitted into few more small (on Firebird, for example).
AOffset | The current Array DML offset. It may be different from value of the Execute method AOffset parameter, if there was skipped erroneous rows or full operation is splitted into few more small (on Firebird, for example).
AError | The original DBMS returned error. Check AError.Errors[i].RowIndex for the index of erroneous row in parameters array.
AAction | The action dataset should take after return from event handler.
Description

The OnExecuteError event is triggered, when the dataset failed to execute Array DML using Execute method and ATimes > 1. Using this event handler you can:

  • skip erroneous row of the parameters array;
  • change values in erroneous row of the parameters array;
  • stop full Array DML execution.

Note, OnExecuteError will be not called for the syntax errors or when ATimes = 1.

Syntax
property OnExecuteError: TADExecuteErrorEvent;
See Also

Array DML, EADDBEngineException, TADErrorAction, TADDataSet.Execute

Example
procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AError: EADDBEngineException; var AAction: TADErrorAction);
begin
  if AException.Errors[0].Kind = ekUKViolated then
    AAction := eaSkip
  else
    AAction := eaFail;
end;
What do you think about this topic? Send feedback!


TADQuery.OnMasterSetValues Event

TADQuery.OnMasterSetValues Event
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Fires after a detailed dataset has set detailed query parameters.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

Use the OnMasterSetValues event handler to override parameter values supplied to detail dataset from the master dataset. Also, because BeforeOpen and AfterOpen events do not fire for a detail dataset, the OnMasterSetValues may be used instead of them.

Syntax
property OnMasterSetValues: TADDataSetEvent;
See Also

Master-Detail Relationship, MasterSource, MasterFields

What do you think about this topic? Send feedback!


TADQuery.OnReconcileError Event

TADQuery.OnReconcileError Event
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Fires when a dataset needs to reconcile an update to a record that cannot not be applied.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use the OnReconcileError event handler to respond to error conditions that arise when the ApplyUpdates method was applying changes to the records to the database. The OnReconcileError event handler is called by Reconcile method.

As part of Reconcile call the dataset will loop through all records with associated exception objects. And for each such record will call the OnReconcileError event handler. The event handler gets:

  • E - reference to the exception object. See Handling Errors topics for how to work with exception objects.
  • UpdateKind - the update kind of the current record. It may be one of the values: rsInserted, rsDeleted, rsModified, rsUnchanged.

After handling error the event handler should set Action argument. The default value is raMerge. The possible values are:

Action | Description
raSkip | Just skip current record.
raAbort | Just quit from Reconcile call.
raMerge | Clear the current record error state, make current record changes the new initial state of this record. IOW, merge changes into dataset records cache.
raCorrect | Clear current record error state. IOW, mark the record as correctly applied.
raCancel | Cancel current record changes.
raRefresh | Cancel current record changes and reread the record values from the database.

The event handler may analyze the original and current field values, by reading TField.OldValue and NewValue properties. Application may also update the current field value, set Action to raCorrect, and later call ApplyUdpates again.

Syntax
property OnReconcileError: TADReconcileErrorEvent;
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError

Example
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;
What do you think about this topic? Send feedback!


TADQuery.OnUpdateError Event

TADQuery.OnUpdateError Event
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Fires if an exception is generated when updates are applied to a database.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use the OnUpdateError event handler to respond to exceptions raised while applying immediate or cached updates to a database.

ASender is the dataset to which updates are applied.

AException is a pointer to a EADException object from which an application can extract an error message and the actual cause of the error condition. The OnUpdateError handler can use this information to determine how to respond to the error condition. In most cases AException object will be of class EADDBEngineException or even one of it DBMS specific subclasses.

ARow is a DatS row object, repesenting erroneous record in dataset. This record is also current record in ASender.

ARequest indicates whether the error occurred while inserting, deleting, or modifying a record.

AAction indicates the action to take when the OnUpdateError handler exits. On entry into the handler, AAction is always set to eaDefault, which leads to uaFail, if not changed. If OnUpdateError can handle or correct the error, set AAction to uaRetry before exiting the error handler. Or consider other options.

The error handler can use the OldValue and NewValue properties TField to evaluate error conditions and set NewValue to a new value to reapply. In this case, set AAction to uaRetry before exiting.

The code in an OnUpdateError handler must not call any methods that make a different record the current one !

Syntax
property OnUpdateError: TADUpdateErrorEvent;
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord

Example
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;
What do you think about this topic? Send feedback!


TADQuery.OnUpdateRecord Event

TADQuery.OnUpdateRecord Event
TADQuery Class TADQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Occurs when record update is applying to a database.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use an OnUpdateRecord event handler to process immediate or cached updates that cannot be correctly or easily handled:

  • using FireDAC automatic SQL update command generation;
  • by a single table adapter component;
  • by a single update component.

This event is useful for applications that require:

  • additional control over parameters and macros substitution in update components;
  • multi SQL statement updates, when DBMS does not support batches or blocks;
  • non-SQL updates posting;
  • etc

ASender is the dataset to which updates are applied.

ARequest indicates whether the current update is the insertion, deletion or modification of a record.

AAction indicates the action taken by the OnUpdateRecord handler before it exits. On entry into the handler, AAction is always set to eaDefault. If OnUpdateRecord is successful, it should set AAction to eaApplied before exiting.

AAction value | Description
eaFail | Mark the update as failed and return an error.
eaSkip | Skip current update and do not mark it as applied.
eaRetry | Retry the current operation.
eaApplied | Mark current update as applied.
eaDefault | Take default action. For successful update it is eaApplied, for failed update it is eaFail.
eaExitSuccess | Stop to process the cached updates, return success.
eaExitFailure | Stop to process the cached updates, return failure.

The OnUpdateRecord event handler code should read the dataset field values, including TField.NewValue, OldValue and CurValue. There:

  • NewValue is the new field value before posting updates.
  • OldValue is the original field value, as it was after record fetching or after last updates applying.
  • CurValue is the current field value, the same as Value property.

Note, the OnUpdateRecord handler code must not call the methods that change the current dataset position.

Syntax
property OnUpdateRecord: TADUpdateRecordEvent;
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError

Example 1
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;
Example 2

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main
What do you think about this topic? Send feedback!


TADQuery.Params Property

TADQuery.Params Property
TADQuery Class TADQuery Members uADCompClient Namespace Example 1 Example 2 Example 3 Example 4 published See Also Send Feedback

Contains the parameters for a SQL statement.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example 1, Example 2, Example 3, Example 4, published, See Also
Description

Use Params property to view and set SQL statement parameter names, values, and data types at run time. Use the collection editor for the Params property to set parameter information at design time.

If dataset is TADQuery, then Params is populated automatically after changing SQL property value, if ResourceOptions.ParamCreate = True. The parameters order is the same as they appear in the SQL command. When Params.BindMode = pbByName, then each parameter name will appear in Params only once. When Params.BindMode = pbByNumber, then each parameter marker will appear in the Params, including duplicated names.

If dataset is TADStoredProc, then Params is populated automatically after calling Prepare method at run time or changing StoredProcName at design time, if fiMeta is in FetchOption.Items. The parameters order is the same as in the stored procedure header.

Otherwise Params may be populated by hands. At Prepare call, parameters will be bind to prepared SQL command. After that you cannot change parameter types, otherwise will get an exception.

An easier way to set and retrieve parameter values when the name of each parameter is known is to call ParamByName. This method is especially preferred versus accessing parameters by index when they are populated automatically and there is a chance that the SQL property or StoredProcName property will be changed in the code dynamically.

Syntax
property Params: TADParams;
See Also

Executing Command, Executing Stored Procedure, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items

Example 1
// TADQuery automatic parameters creation - ResourceOptions.ParamCreate = True
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.Open;
Example 2
// TADQuery manual parameters creation - ResourceOptions.ParamCreate = False
ADQuery1.ResourceOptions.ParamCreate := False;
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
with ADQuery1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
  AsString := 'qwe';
end;
ADQuery1.Open;
Example 3
// TADStoredProc automatic parameters creation - fiMeta in FetchOptions.Items
ADStoredProc1.StoredProcName := 'my_proc';
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;
Example 4
// TADStoredProc manual parameters creation - fiMeta not in FetchOptions.Items
ADStoredProc1.FetchOptions.Items := ADStoredProc1.FetchOptions.Items - [fiMeta];
ADStoredProc1.StoredProcName := 'my_proc';
with ADStoredProc1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
end;
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;
What do you think about this topic? Send feedback!


TADQuery.ResourceOptions Property

TADQuery.ResourceOptions Property
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

The set of options to control resources usage.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The ResourceOptions property is the set of properties, controlling the resources usage by the dataset. These properties will inherit its values from ResourceOptions of connection object.

Syntax
property ResourceOptions: TADBottomResourceOptions;
See Also

Setting Options, TADBottomResourceOptions

What do you think about this topic? Send feedback!


TADQuery.SchemaAdapter Property

TADQuery.SchemaAdapter Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use SchemaAdapter property to set a reference to the TADSchemaAdapter object to enable Centralized Cashed Updates mode. The schema adapter object will be used as a central change log share by few datasets.

To enable propagation of master dataset changes to a detail dataset set FetchOptions.DetailCascade to True for a detail dataset. Also both master and detail datasets must point to the same TADSchemaAdapter object.

Syntax
property SchemaAdapter: TADCustomSchemaAdapter;
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade

Example
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;
What do you think about this topic? Send feedback!


TADQuery.SQL Property

TADQuery.SQL Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Contains the text of the SQL statement to execute for the query.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

Use SQL property to specify the SQL command that a query will Execute / ExecSQL / Open.

At design time the SQL property can be edited by invoking FireDAC Query Editor dialog. For that double click on TADCustomQuery component. The dialog offers syntax hilighting editor, query builder, ability to test query and other.

The SQL property may contain one SQL command or "batch" SQL command, consisting from few SQL command or server side programming language block of code. To execute full featured SQL script use the TADScript component.

The SQL statement in the SQL property may contain also:

  • parameter markers, following standard SQL-92 syntax conventions. Parameters are created automatically and stored in the Params property, if ResourceOptions.ParamCreate is True. If ParamBindModeis pbByName, then for all occurrences of the same marker will be created single item in Params. If pbByNumber, then - one item per each marker.
  • substitution variable markers. Macros are created automatically and stored in the Macros property, if ResourceOptions.MacroCreate is True.
  • escape sequences. They allow writing DBMS independent SQL commands.
  • conditional substitutions. They allow expand SQL command conditionally, depending on application defined attributes

For details see Preprocessing Command Text.

To improove performance on adding big SQL queries to the property using TStringList methods, surround this code into SQL.BeginUpdate / SQL.EndUpdate.

After filling this property value the Param collection will be filled automatically, if ResourceOptions.ParamCreate is True.

Syntax
property SQL: TStrings;
See Also

Executing Command, Preprocessing Command Text, TADRdbmsDataSet.Prepare, TDataSet.Open, ExecSQL, TADResourceOptions.ParamCreate, TADResourceOptions.MacroCreate, TADRdbmsDataSet.ParamBindMode

Example
ADQuery1.SQL.BeginUpdate;
try
  ADQuery1.SQL.Add('SELECT ...');
  ADQuery1.SQL.Add('...');
  ADQuery1.SQL.Add('...');
  ADQuery1.SQL.Add('WHERE ID = :ID');
finally
  ADQuery1.SQL.EndUpdate;
end;
ADQuery1.ParamByName('ID').AsInteger := 100;
ADQuery1.Open;
What do you think about this topic? Send feedback!


TADQuery.Transaction Property

TADQuery.Transaction Property
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

Gets / sets reference to transaction object.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The Transaction property allows to associate dataset with explicit transaction object. If it is not specified, then dataset will be associated with connection default transaction.

The specified transaction object will be used only for Prepare, Open, ExecSQL, ExecProc, Execute methods. For commands, generated to apply changes to database, FireDAC will use UpdateTransaction, if it is specified, otherwise - Transaction.

Currently explicit transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property Transaction: TADCustomTransaction;
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction

What do you think about this topic? Send feedback!


TADQuery.UpdateObject Property

TADQuery.UpdateObject Property
TADQuery Class TADQuery Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Specifies the update object component used to post updates by dataset.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use UpdateObject to specify the TADUpdateSQL component to use in an application that must be able to post updates in a non-standard way.

The FireDAC has build in updates command generator, which using multiple information sources is able to generate SQL update commands for most of scenarios. In some cases, such as a query made against multiple tables, which may require multi-statement update, FireDAC cannot generate SQL update commands. In these cases, UpdateObject can be used to specify a TADUpdateSQL component that allows to specify custom SQL commands for each update posting case, like a insert / update / delete.

As alternative to update object usage, you can consider to use OnUpdateRecord event. It gives more options, but requires manual coding of posting updates. Also, in OnUpdateRecord handler you can use multiple update objects. See demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.

Syntax
property UpdateObject: TADCustomUpdateObject;
See Also

OnUpdateRecord, TADUpdateSQL

Example 1
ADUpdateSQL1.InsertSQL.Text := 'insert into mytab values (:new_id, :new_name)';
ADQuery1.UpdateObject := ADUpdateSQL1;
ADQuery1.Append;
ADQuery1['id'] := 100;
ADQuery1['name'] := 'qwe';
ADQuery1.Post;
Example 2

Demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.

What do you think about this topic? Send feedback!


TADQuery.UpdateOptions Property

TADQuery.UpdateOptions Property
TADQuery Class TADQuery Members uADCompClient Namespace published See Also Send Feedback

The set of options to control updates posting.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, published, See Also
Description

The UpdateOptions property is the set of properties, controlling the posting updates from the dataset. These properties will inherit its values from UpdateOptions of connection object.

Syntax
property UpdateOptions: TADBottomUpdateOptions;
See Also

Setting Options, TADBottomUpdateOptions

What do you think about this topic? Send feedback!


TADQuery.UpdateTransaction Property

TADQuery.UpdateTransaction Property
TADQuery Class TADQuery Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets reference to transaction object.

Group

published

Links
TADQuery Class, TADQuery Members, uADCompClient Namespace, Example, published, See Also
Description

The UpdateTransaction property allows to associate dataset internal update commands with explicit transaction object. If it is not specified, then dataset update commands will be associated with connection default update transaction. If it is not specified, then - with dataset Transaction.

For Prepare, Open, ExecSQL, ExecProc, Execute methods will be used Transaction objects.

Currently explicit update transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property UpdateTransaction: TADCustomTransaction;
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction

Example
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction
What do you think about this topic? Send feedback!


TADRdbmsDataSet Class

TADRdbmsDataSet Class
public protected TADRdbmsDataSet Members Classes See Also Send Feedback

The TADRdbmsDataSet class includes everything, required by descendants to execute SQL commands.

Group

Classes

Class Hierarchy
  uADCompClient_TADRdbmsDataSetuADCompClient_TADRdbmsDataSetuADCompClient_TADRdbmsDataSet
File

uADCompClient

Links
public, protected, TADRdbmsDataSet Members, Classes, See Also
Description

The TADRdbmsDataSet class is an intermediate class in FireDAC dataset classes hierarchy. The programmer must not use it directly.

Use the TADRdbmsDataSet to subclass new dataset class capable to execute SQL commands. This class creates and maintains everything, required by descendants to execute SQL commands - table adapter and command objects.

For options description, please, look at uADStanOption description.

Syntax
TADRdbmsDataSet = class(TADAdaptedDataSet);
See Also

TADAdaptedDataSet, TADCustomQuery, TADCustomStoredProc, TADMetaInfoQuery, uADStanOption

What do you think about this topic? Send feedback!


TADRdbmsDataSet Members

TADRdbmsDataSet Members
Events TADRdbmsDataSet Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADRdbmsDataSet.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADRdbmsDataSet Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.
Links
Events, TADRdbmsDataSet Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
Events TADRdbmsDataSet Class Legend Methods Properties Send Feedback

The public members of the TADRdbmsDataSet class are listed here.

Events
Event | Description
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
Class

TADRdbmsDataSet Class

Methods
Method | Description
Disconnect | Disconnects the dataset from DBMS.
FindMacro | Returns macro by its name.
MacroByName | Returns macro by its name.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Prepare | Prepares SQL command for execution.
Unprepare | Releases SQL command resources.
Properties
Property | Description
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
FetchOptions | The set of options to control rows fetching.
FormatOptions | The set of options to control data representation.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
Transaction | Gets / sets reference to transaction object.
UpdateOptions | The set of options to control updates posting.
UpdateTransaction | Gets / sets reference to transaction object.
Links
Events, TADRdbmsDataSet Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADRdbmsDataSet.Connection Property

TADRdbmsDataSet.Connection Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

Specifies the FireDAC connection component to use.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Description

Use Connection to specify an FireDAC connection object to use to connect to an DBMS.

At design-time, select from the list of available TADCustomConnection objects (if any have been added to the application) invoked from the Object Inspector. If a form or data module has TADCustomConnection dropped on it, then TADRdbmsDataSet assigns this connection object to Connection property automatically right after dropping on the form or data module.

At runtime, set Connection to reference an existing TADConnection object.

The TADRdbmsDataSet can be bind to TADCustomConnection object using Connection or ConnectionName property. Using ConnectionName property allows to bind to a connection object, if it is even not yet created or is not accessible.

Syntax
property Connection: TADCustomConnection;
See Also

ConnectionName

What do you think about this topic? Send feedback!


TADRdbmsDataSet.ConnectionName Property

TADRdbmsDataSet.ConnectionName Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Specifies the FireDAC connection to use by its name.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example, public, See Also
Description

Use ConnectionName to specify an FireDAC connection to use to connect to an DBMS. The ConnectionName property value specifies the name of the connection. It must match to the:

  • name of one of connection definitions, either stored in external file (persistent) or created on fly (private);
  • ConnectionName of one of the TADConnection objects.

The ConnectionName property value must be specified before Prepare call. If it matches the name of one of connection definitions, then FireDAC will transparently create connection object and link the dataset with it.

The TADRdbmsDataSet cab be bind to TADCustomConnection object using Connection or ConnectionName property. Using Connection property allows to bind to a connection object explicitly and reduce the overhead for resolving connection names.

Syntax
property ConnectionName: String;
See Also

Connection, TADCustomConnection.Temporary

Example
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');
What do you think about this topic? Send feedback!


TADRdbmsDataSet.FetchOptions Property

TADRdbmsDataSet.FetchOptions Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

The set of options to control rows fetching.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Description

The FetchOptions property is the set of properties, controlling the fetching of cursor rows. These properties will inherit its values from FetchOptions of connection object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions

What do you think about this topic? Send feedback!


TADRdbmsDataSet.FormatOptions Property

TADRdbmsDataSet.FormatOptions Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

The set of options to control data representation.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Params

What do you think about this topic? Send feedback!


TADRdbmsDataSet.OnCommandChanged Event

TADRdbmsDataSet.OnCommandChanged Event
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

Fires after the SQL property value is changed.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Description

The OnCommandChanged event fires after the SQL command text value is changed:

  • for TADQuery - after SQL is changed;
  • for TADStoredProc - after StoredProcName is changed;
  • for TADTable - after TableName is changed.
Syntax
property OnCommandChanged: TNotifyEvent;
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName

What do you think about this topic? Send feedback!


TADRdbmsDataSet.OnError Event

TADRdbmsDataSet.OnError Event
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

The event fires when an error happens, while dataset is communicating with DBMS.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
AInitiator | The reference to interface of object, which initially raised the exception.
AException | The exception object, which may be modified or even replaced by another exception object instance.
Description

The OnError event fires, when dataset executes one of the following operations and an error happens:

  • Prepare. The dataset is preparing DBMS command text for execution.
  • Open. The dataset is executing DBMS command to open cursor.
  • Execute , ExecSQL , ExecProc. The dataset is executing DBMS command text.
  • Navigation methods. The dataset is fetching rows from cursor.

If most cases AException object will of EADDBEngineException class. If AException is of EADDBArrayExecuteError class, then it is Array DML error handling case. You should use a code like in the first example.

To centralize error handling, you can consider to use TADCustomConnection.OnError.

Syntax
property OnError: TADErrorEvent;
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError

Example 1

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;
Example 2

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;
What do you think about this topic? Send feedback!


TADRdbmsDataSet.Prepared Property

TADRdbmsDataSet.Prepared Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

Gets or sets command prepare for execution status.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Description

Set Prepared to True to prepare SQL command for execution. Setting Prepared to True, will call Prepare method. It is not required to set Prepared to True for standard SQL command before execution, because first Execute / ExecSQL / Open call will automatically prepare command. But it is required for stored procedures, if you need to automatically populate Params collection. After command is prepared, SQLText will return SQL command text as it is sent to the DBMS.

To prepare SQL command DBMS connection must be active, otherwise an exception will be raised.

After SQL command preparation application cannot change command parameter data types and sizes, otherwise on next Execute or Open call an exception will be raised. So, setup parameters before setting Prepared to True.

Set Prepared to False to unprepare SQL command and release all it resources. Setting Prepared to False, will call Unprepare method.

Syntax
property Prepared: Boolean;
See Also

Prepare, Unprepare, Params

What do you think about this topic? Send feedback!


TADRdbmsDataSet.ResourceOptions Property

TADRdbmsDataSet.ResourceOptions Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

The set of options to control resources usage.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Description

The ResourceOptions property is the set of properties, controlling the resources usage by the dataset. These properties will inherit its values from ResourceOptions of connection object.

Syntax
property ResourceOptions: TADBottomResourceOptions;
See Also

Setting Options, TADBottomResourceOptions

What do you think about this topic? Send feedback!


TADRdbmsDataSet.SchemaAdapter Property

TADRdbmsDataSet.SchemaAdapter Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example, public, See Also
Description

Use SchemaAdapter property to set a reference to the TADSchemaAdapter object to enable Centralized Cashed Updates mode. The schema adapter object will be used as a central change log share by few datasets.

To enable propagation of master dataset changes to a detail dataset set FetchOptions.DetailCascade to True for a detail dataset. Also both master and detail datasets must point to the same TADSchemaAdapter object.

Syntax
property SchemaAdapter: TADCustomSchemaAdapter;
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade

Example
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;
What do you think about this topic? Send feedback!


TADRdbmsDataSet.Transaction Property

TADRdbmsDataSet.Transaction Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

Gets / sets reference to transaction object.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Description

The Transaction property allows to associate dataset with explicit transaction object. If it is not specified, then dataset will be associated with connection default transaction.

The specified transaction object will be used only for Prepare, Open, ExecSQL, ExecProc, Execute methods. For commands, generated to apply changes to database, FireDAC will use UpdateTransaction, if it is specified, otherwise - Transaction.

Currently explicit transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property Transaction: TADCustomTransaction;
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction

What do you think about this topic? Send feedback!


TADRdbmsDataSet.UpdateOptions Property

TADRdbmsDataSet.UpdateOptions Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

The set of options to control updates posting.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Description

The UpdateOptions property is the set of properties, controlling the posting updates from the dataset. These properties will inherit its values from UpdateOptions of connection object.

Syntax
property UpdateOptions: TADBottomUpdateOptions;
See Also

Setting Options, TADBottomUpdateOptions

What do you think about this topic? Send feedback!


TADRdbmsDataSet.UpdateTransaction Property

TADRdbmsDataSet.UpdateTransaction Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Gets / sets reference to transaction object.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example, public, See Also
Description

The UpdateTransaction property allows to associate dataset internal update commands with explicit transaction object. If it is not specified, then dataset update commands will be associated with connection default update transaction. If it is not specified, then - with dataset Transaction.

For Prepare, Open, ExecSQL, ExecProc, Execute methods will be used Transaction objects.

Currently explicit update transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property UpdateTransaction: TADCustomTransaction;
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction

Example
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction
What do you think about this topic? Send feedback!


TADRdbmsDataSet.Disconnect Method

TADRdbmsDataSet.Disconnect Method
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Disconnects the dataset from DBMS.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
AAbortJob: Boolean = False | True, if current dataset task must be aborted.
Description

The Disconnect method optionally aborts current dataset task, like a Open, ExecSQL, ExecProc, Execute or rows fetching. Then closes dataset and unprepares it.

Syntax
procedure Disconnect(AAbortJob: Boolean = False); override;
See Also

AbortJob

Example
ADQuery1.Disconnect(True);
// is equivalent to:
// ADQuery1.AbortJob(True);
// ADQuery1.Close;
// ADQuery1.Unprepare;
What do you think about this topic? Send feedback!


TADRdbmsDataSet.FindMacro Method

TADRdbmsDataSet.FindMacro Method
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

Returns macro by its name.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const AValue: string | A name of macro to return.
Returns

The macro with Name = AValue or nil if such macro does not exists.

Description

The FindMacro method returns a macro from Macros collection by its name AValue. If there is no such macro, then method will return nil.

Syntax
function FindMacro(const AValue: string): TADMacro;
See Also

Macros, MacroByName

What do you think about this topic? Send feedback!


TADRdbmsDataSet.MacroByName Method

TADRdbmsDataSet.MacroByName Method
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

Returns macro by its name.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Parameters
Parameters | Description
const AValue: string | A name of macro to return.
Returns

The macro with Name = AValue.

Description

The MacroByName method returns a macro from Macros collection by its name AValue. If there is no such macro, then exception will be raised.

Syntax
function MacroByName(const AValue: string): TADMacro;
See Also

Macros, FindMacro

What do you think about this topic? Send feedback!


TADRdbmsDataSet.Open Method (String)

TADRdbmsDataSet.Open Method (String)
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified SQL statement and opens dataset.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command to execute.
Description

Call Open to execute the SQL statement specified in ASQL or is currently assigned to the internal command object, if ASQL is empty.

The method closes the dataset if it was active, then assigns ASQL to the command text, and sets the Active property to True. When Active is true, the dataset is populated with data from a database.

When an application needs to execute the same SQL command many times, then an application may ordinarily set SQL property, call Prepare before calling Open for the first time, then use any Open version without specifying ASQL.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum command execution time. After that time command execution will be canceled and exception raised.

To cancel command execution use TADAdaptedDataSet.AbortJob.

If DBMS returns error, then FireDAC raises an exception. It may be analyzed in OnError event.

Syntax
procedure Open(const ASQL: String); overload;
See Also

Prepare, TDataSet.Open, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
ADQuery1.Open('select * from customers');
What do you think about this topic? Send feedback!


TADRdbmsDataSet.Open Method (String, array of Variant)

TADRdbmsDataSet.Open Method (String, array of Variant)
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified SQL statement with specified parameter values and opens dataset.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command to execute.
const AParams: array of Variant | And open array of parameter values.
Description

Call Open to execute the SQL statement specified in ASQL or is currently assigned to the internal command object, if ASQL is empty. And a command has parameters.

The method closes the dataset if it was active, then assigns ASQL to the command text, and sets the Active property to True. When Active is true, the dataset is populated with data from a database. This method allows to specify the parameter values using positional parameter binding.

When an application needs to execute the same SQL command many times, then an application may ordinarily set SQL property, call Prepare before calling Open for the first time, then use any Open version without specifying ASQL.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum command execution time. After that time command execution will be canceled and exception raised.

To cancel command execution use TADAdaptedDataSet.AbortJob.

When a DBMS returns an error, then FireDAC raises an exception. See Handling Errors for details. In case of long string values and error like that:

[FireDAC][Phys][ODBC]-345. Data too large for variable [P]. Max len = [8002], actual len = [18329]

you have to use the Open version, which accepts the parameter data types. And to specify ftMemo or ftBlob for corresponding ('P') parameter. Or just use the standard Open call and setup parameter data types and values separately.

Syntax
procedure Open(const ASQL: String; const AParams: array of Variant); overload;
See Also

Prepare, TDataSet.Open, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
ADQuery1.Open('select * from Employees where department_id = :id', [100]);
....
ADQuery1.Open('', [101]); // executes the above SQL command, but for ID = 101
....
ADQuery1.Open('', [102]); // executes the above SQL command, but for ID = 101
....
What do you think about this topic? Send feedback!


TADRdbmsDataSet.Open Method (String, array of Variant, array of TFieldType)

TADRdbmsDataSet.Open Method (String, array of Variant, array of TFieldType)
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified SQL statement with specified parameter values and opens dataset.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
const ASQL: String | A SQL command to execute.
const AParams: array of Variant | And open array of parameter values.
const ATypes: array of TFieldType | And open array of parameter data types.
Description

Call Open to execute the SQL statement specified in ASQL or is currently assigned to the internal command object, if ASQL is empty. And a command has parameters.

The method closes the dataset if it was active, then assigns ASQL to the command text, and sets the Active property to True. When Active is true, the dataset is populated with data from a database. This method allows to specify the parameter values using positional parameter binding, and exact parameter data types. If you need to leave the parameter data type unchanged, then put ftUnknown into array item corresponding to the parameter.

When an application needs to execute the same SQL command many times, then an application may ordinarily set SQL property, call Prepare before calling Open for the first time, then use any Open version without specifing ASQL.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum command execution time. After that time command execution will be canceled and exception raised.

To cancel command execution use TADAdaptedDataSet.AbortJob.

When a DBMS returns an error, then FireDAC raises an exception. See Handling Errors for details. In case of long string values and error like that:

[FireDAC][Phys][ODBC]-345. Data too large for variable [P]. Max len = [8002], actual len = [18329]

you have to specify ftMemo or ftBlob for corresponding ('P') parameter. Or just use the standard Open call and setup parameter data types and values separately.

Syntax
procedure Open(const ASQL: String; const AParams: array of Variant; const ATypes: array of TFieldType); overload;
See Also

Prepare, TDataSet.Open, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
ADQuery1.Open('select * from Employees where department_id = :id', [100], [ftInteger]);
What do you think about this topic? Send feedback!


TADRdbmsDataSet.Prepare Method

TADRdbmsDataSet.Prepare Method
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example public See Also Send Feedback

Prepares SQL command for execution.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example, public, See Also
Description

Call the Prepare method to prepare SQL command for execution. It is not required to call Prepare for standard SQL command before execution, because first Execute / ExecSQL / Open call will automatically prepare command. But it is required for stored procedures, if you need to automatically populate Params collection. After command is prepared, SQLText will return SQL command text as it is sent to the DBMS.

To prepare SQL command DBMS connection must be active, otherwise exception will be raised.

After prepare call application cannot change command parameter data types and sizes, otherwise on next Execute / ExecSQL / ExecProc / Open call an exception will be raised. So, setup parameters before Prepare call.

Syntax
procedure Prepare;
See Also

Prepared, Unprepare, Params

Example
ADQuery1.SQL.Text := 'select * from MyTab';
ADQuery1.Prepare;
What do you think about this topic? Send feedback!


TADRdbmsDataSet.Unprepare Method

TADRdbmsDataSet.Unprepare Method
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace public See Also Send Feedback

Releases SQL command resources.

Group

public

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, public, See Also
Description

Use Unprepare call to release prepared SQL command resources. You can unprepare command by setting Prepared to False.

Syntax
procedure Unprepare;
See Also

Prepare, Prepared

What do you think about this topic? Send feedback!


protected

protected
TADRdbmsDataSet Class Legend Properties Send Feedback

The protected members of the TADRdbmsDataSet class are listed here.

Class

TADRdbmsDataSet Class

Properties
Property | Description
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
Links
TADRdbmsDataSet Class, Legend, Properties
What do you think about this topic? Send feedback!


TADRdbmsDataSet.MacroCount Property

TADRdbmsDataSet.MacroCount Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace protected See Also Send Feedback

Returns the number of macro in Macros collection.

Group

protected

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, protected, See Also
Description

The MacroCount property teturns the number of of macro substitution variables in Macros collection.

Syntax
property MacroCount: Word;
See Also

Macros

What do you think about this topic? Send feedback!


TADRdbmsDataSet.Macros Property

TADRdbmsDataSet.Macros Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example 1 Example 2 Example 3 protected See Also Send Feedback

The collection of macro substitution variables.

Group

protected

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example 1, Example 2, Example 3, protected, See Also
Description

The Macros property is the collection of macro substitution variables. It is populated automatically after assigning SQL property, if ResourceOptions.MacroCreate = True. Otherwise it may be populated by hands. At Prepare call, macro values will be substituted into SQL, if ResourceOptions.MacroExpand = True.

Syntax
property Macros: TADMacros;
See Also

TADCustomQuery.SQL, Params, Prepare, TADMacros, TADResourceOptions.MacroCreate, TADResourceOptions.MacroExpand

Example 1

Substitute table name:

ADQuery1.SQL.Text := 'select * from &Tab';
ADQuery1.Macros[0].AsIdentifier := 'Order Details';
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from "Order Details"
Example 2

Substitute WHERE condition:

ADQuery1.SQL.Text := 'select * from MyTab {if !cond} where !cond {fi}';

ADQuery1.Macros[0].AsString := 'ID > 100';
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from MyTab where ID > 100

ADQuery1.Macros[0].Clear;
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from MyTab
Example 3

See FireDAC\Samples\Comp Layer\TADQuery\Macros demo for details.

What do you think about this topic? Send feedback!


TADRdbmsDataSet.ParamBindMode Property

TADRdbmsDataSet.ParamBindMode Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace protected See Also Send Feedback

Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.

Group

protected

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, protected, See Also
Description

Get or set ParamBindMode to determine the order in which parameters in the Params property are matched to the parameters used by the SQL command on the server. ParamBindMode can be one of the following:

Value | Ordering
pbByName | Parameters specified in the Params property are matched to identically named parameters on the server. This is the default.
pbByNumber | Parameters in Params are assigned one-by-one to the next available parameter on the server (for example, the first parameter in Params is assigned to the first parameter used by the SQL command, and so on).

Whenever possible, ParamBindMode should be pbByName. This guarantees that parameters are matched to the correct parameters used by the SQL command regardless of physical ordering in Params. At design time, the names of known parameters appear in the Parameters editor.

Syntax
property ParamBindMode: TADParamBindMode;
See Also

Params

What do you think about this topic? Send feedback!


TADRdbmsDataSet.RowsAffected Property

TADRdbmsDataSet.RowsAffected Property
TADRdbmsDataSet Class TADRdbmsDataSet Members uADCompClient Namespace Example protected Send Feedback

Returns the number of rows operated upon by the latest query execution.

Group

protected

Links
TADRdbmsDataSet Class, TADRdbmsDataSet Members, uADCompClient Namespace, Example, protected
Description

Inspect RowsAffected to determine how many rows were inserted, updated, deleted or fetched by the last dataset operation. If no rows were processed, RowsAffected = 0. If numbers of processed rows is not accessible, RowsAffected = –1.

At MS SQL Server RowsAffected may be unexpectedly equal to -1, if stored procedure or table trigger omits SET NOCOUNT ON. Also, this may be a reason of "Command inserted / updated / deleted [0] records instead of [1] record" error at posting updates to database. Check MS BOL for more details about SET NOCOUNT ON.

Syntax
property RowsAffected: TADCounter;
Example
procedure TForm1.ADQuery1AfterExecute(ASender: TObject);
begin
  if ADQuery1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADQuery1.Command1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADQuery1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADQuery1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADQuery1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADQuery1.RowsAffected]);
    end;
end;
What do you think about this topic? Send feedback!


TADSchemaAdapter Class

TADSchemaAdapter Class
Example Classes See Also Send Feedback

The class implementing Centralized Cached Updates support.

Group

Classes

Class Hierarchy
  uADCompClient_TADSchemaAdapteruADCompClient_TADSchemaAdapter
File

uADCompClient

Links
Example, Classes, See Also
Description

Use TADCustomSchemaAdapter to manage Centralized Cached Updates.

Syntax
TADSchemaAdapter = class(TADCustomSchemaAdapter);
See Also

Caching Updates, Master-Detail Relationship, TADCustomSchemaAdapter

Example

See demos:

- FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\Centralized

- FireDAC\Samples\Comp Layer\TADSchemaAdapter\MemTable

What do you think about this topic? Send feedback!


TADStoredProc Class

TADStoredProc Class
published TADStoredProc Members Classes See Also Send Feedback

The class implementing dataset, capable to execute server side stored procedures.

Group

Classes

Class Hierarchy
  uADCompClient_TADStoredProcuADCompClient_TADStoredProcuADCompClient_TADStoredProcuADCompClient_TADStoredProcuADCompClient_TADStoredProc
File

uADCompClient

Links
published, TADStoredProc Members, Classes, See Also
Description

Use TADStoredProc to execute server side stored procedures, browse the result sets and edit the result set records.

Syntax
TADStoredProc = class(TADCustomStoredProc);
See Also

Executing Stored Procedure, TADCustomStoredProc, TADQuery

What do you think about this topic? Send feedback!


TADStoredProc Members

TADStoredProc Members
Events TADStoredProc Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADStoredProc.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADStoredProc Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DescriptionsAvailable | Determines if parameter information is available from the stored procedure on the server.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecFunc | Executes a stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter values for the stored function arguments and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter data type and values for the stored proc arguments and returns its value.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure and assigns parameter values for the stored proc arguments.
ExecProc | Executes the specified stored procedure and assigns parameter data type and values for the stored proc arguments.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the stored procedure names to the specified catalog.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
Overload | Specifies which Oracle overloaded packaged stored procedure to execute.
PackageName | Limits the stored procedure names to the specified package name.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the number of parameters for the stored procedure.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the stored procedure names to the specified schema.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
StoredProcName | Identifies the name of the stored procedure on the server to call.
Table | The reference to DatS table object, actually representing the internal data storage.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.
Links
Events, TADStoredProc Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
Events TADStoredProc Class Legend Properties Send Feedback

The published members of the TADStoredProc class are listed here.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADStoredProc Class

Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the stored procedure names to the specified catalog.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FormatOptions | The set of options to control data representation.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
Overload | Specifies which Oracle overloaded packaged stored procedure to execute.
PackageName | Limits the stored procedure names to the specified package name.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | Contains the parameters for a SQL statement.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the stored procedure names to the specified schema.
StoredProcName | Identifies the name of the stored procedure on the server to call.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateTransaction | Gets / sets reference to transaction object.
Links
Events, TADStoredProc Class, Legend, Properties
What do you think about this topic? Send feedback!


TADStoredProc.ActiveStoredUsage Property

TADStoredProc.ActiveStoredUsage Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Controls how to use Active property value saved to DFM.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
See Also

TDataSet.Active

What do you think about this topic? Send feedback!


TADStoredProc.AfterApplyUpdates Event

TADStoredProc.AfterApplyUpdates Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires after cached updates are applied to DB.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The AfterApplyUpdates event fires after cached updates are applied to DB as result of ApplyUpdates method call.

Syntax
property AfterApplyUpdates: TADAfterApplyUpdatesEvent;
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates

What do you think about this topic? Send feedback!


TADStoredProc.AfterExecute Event

TADStoredProc.AfterExecute Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires after SQL command execution is finished.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The AfterExecute event fires after SQL command execution is finished as result of Execute method call.

Syntax
property AfterExecute: TADDataSetEvent;
See Also

TADDataSetEvent, Execute, BeforeExecute

What do you think about this topic? Send feedback!


TADStoredProc.AfterGetRecord Event

TADStoredProc.AfterGetRecord Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset one time for each fetched record.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecord event fires after dataset fetched next rowset as result of navigation methods calls. The event fires one time for each fetched record. For example, fetching occurs automatically inside of Next, Last, Locate methods. Inside of an event handler application may read dataset fields to get fetched record field values.

Syntax
property AfterGetRecord: TADDataSetEvent;
See Also

AfterGetRecords

What do you think about this topic? Send feedback!


TADStoredProc.AfterGetRecords Event

TADStoredProc.AfterGetRecords Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecords event fires after dataset fetched next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property AfterGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord

What do you think about this topic? Send feedback!


TADStoredProc.AfterRowRequest Event

TADStoredProc.AfterRowRequest Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching record.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The AfterRowRequest event fires after dataset fetched current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property AfterRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest

What do you think about this topic? Send feedback!


TADStoredProc.Aggregates Property

TADStoredProc.Aggregates Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The collection of client side aggregates, defined for dataset.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use Aggregates to define client side aggregating formulas, that will be automatically maintained and calculated for group of or for all records of dataset.

All records in the group of records has the same field values for defined set of fields. Aggregates performing calculation for group of records must be associated with one of the indexes. These aggregate expressions will be calculated only is associated index is current and active.

Adding aggregate field does not add TADAggregate object to Aggregates collection. That are two alternative ways - to use aggregate fields or to use Aggregates.

DataSet will automatically maintain and calculate Aggregates values when dataset is fetching the data or application edits the data, if AggregatesActive is True. If application needs to perform large updates to dataset and aggregate values are not needed while updating, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

When aggregates are maintained, the Value method of every active aggregate object returns a value that reflects the current data in the dataset. When users edit the data in the dataset, these values are recalculated to reflect the user's changes.

The expressions in Aggregates must contain aggregating functions, like a SUM, COUNT. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Aggregates: TADAggregates;
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch

Example 1
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.

What do you think about this topic? Send feedback!


TADStoredProc.AggregatesActive Property

TADStoredProc.AggregatesActive Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Controls automatic calculation of aggregate values.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use AggregatesActive to get / set the flag controlling automatic maintenance and calculation of dataset aggregate values.

When AggregatesActive is False (the default), the dataset does not maintain aggregates. This allows the dataset to perform large updates to the dataset or fetch big volumes of data without overhead of calculating aggregate values, which happens at fetching or data editing. When AggregatesActive is True, the dataset calculates and maintains all aggregate values specified by the Aggregates property that are compatible with the current index.

To selectively enable and disable aggregates rather than turning them all on or off at once, use the Active property of individual TADAggregate objects. These objects are available through the Aggregates property.

If application needs to perform batch updates to dataset, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property AggregatesActive: Boolean;
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch

Example
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;
What do you think about this topic? Send feedback!


TADStoredProc.BeforeApplyUpdates Event

TADStoredProc.BeforeApplyUpdates Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires before cached updates are applied to DB.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The BeforeApplyUpdates event fires before cached updates are applied to database as result of ApplyUpdates method call.

Syntax
property BeforeApplyUpdates: TADDataSetEvent;
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates

What do you think about this topic? Send feedback!


TADStoredProc.BeforeExecute Event

TADStoredProc.BeforeExecute Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires before SQL command execution is started.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The BeforeExecute event fires before SQL command execution is started as result of Execute method call.

Syntax
property BeforeExecute: TADDataSetEvent;
See Also

TADDataSetEvent, Execute, AfterExecute

What do you think about this topic? Send feedback!


TADStoredProc.BeforeGetRecords Event

TADStoredProc.BeforeGetRecords Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching next rowset.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The BeforeGetRecords event fires before dataset will fetch next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property BeforeGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, AfterGetRecords

What do you think about this topic? Send feedback!


TADStoredProc.BeforeRowRequest Event

TADStoredProc.BeforeRowRequest Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching record.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The BeforeRowRequest event fires before dataset will fetch current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property BeforeRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest

What do you think about this topic? Send feedback!


TADStoredProc.CachedUpdates Property

TADStoredProc.CachedUpdates Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Specifies whether dataset will log changes to the data without immediate applying of them to the database.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

CachedUpdates enables (True) or disables (False) the logging of data changes (Insert/Post, Edit/Post, Delete) without immediate applying of them to the database.

An application must explicitly apply changes from change log to the database, using ApplyUpdates method. All changes will be written in comparably small amount of time in single transaction. The main benefits of enabling cached updates are:

  • fewer transactions and shorter transaction times;
  • minimization of network traffic;
  • simplified implementation of undo / redo functionality for dataset;
  • ability to implement application offline mode or briefcase model.

The potential drawbacks of enabling cached updates are:

  • other applications can access and change the actual data on the server while users are editing local copies of the data, resulting in an update conflict when cached updates are applied to the database;
  • other applications cannot access data changes made by an application until its cached updates are applied to the database.

Note, to change CachedUpdate property value for TADTable, it must be inactive.

Syntax
property CachedUpdates: Boolean;
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates

Example
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;
What do you think about this topic? Send feedback!


TADStoredProc.CatalogName Property

TADStoredProc.CatalogName Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Limits the stored procedure names to the specified catalog.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

Specify the CatalogName property value to limit the set of stored procedures to the specified catalog.

Syntax
property CatalogName: String;
See Also

Object Names, SchemaName, PackageName, Overload, StoredProcName

What do you think about this topic? Send feedback!


TADStoredProc.Connection Property

TADStoredProc.Connection Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Specifies the FireDAC connection component to use.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

Use Connection to specify an FireDAC connection object to use to connect to an DBMS.

At design-time, select from the list of available TADCustomConnection objects (if any have been added to the application) invoked from the Object Inspector. If a form or data module has TADCustomConnection dropped on it, then TADRdbmsDataSet assigns this connection object to Connection property automatically right after dropping on the form or data module.

At runtime, set Connection to reference an existing TADConnection object.

The TADRdbmsDataSet can be bind to TADCustomConnection object using Connection or ConnectionName property. Using ConnectionName property allows to bind to a connection object, if it is even not yet created or is not accessible.

Syntax
property Connection: TADCustomConnection;
See Also

ConnectionName

What do you think about this topic? Send feedback!


TADStoredProc.ConnectionName Property

TADStoredProc.ConnectionName Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Specifies the FireDAC connection to use by its name.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use ConnectionName to specify an FireDAC connection to use to connect to an DBMS. The ConnectionName property value specifies the name of the connection. It must match to the:

  • name of one of connection definitions, either stored in external file (persistent) or created on fly (private);
  • ConnectionName of one of the TADConnection objects.

The ConnectionName property value must be specified before Prepare call. If it matches the name of one of connection definitions, then FireDAC will transparently create connection object and link the dataset with it.

The TADRdbmsDataSet cab be bind to TADCustomConnection object using Connection or ConnectionName property. Using Connection property allows to bind to a connection object explicitly and reduce the overhead for resolving connection names.

Syntax
property ConnectionName: String;
See Also

Connection, TADCustomConnection.Temporary

Example
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');
What do you think about this topic? Send feedback!


TADStoredProc.Constraints Property

TADStoredProc.Constraints Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Specifies record-level client constraints that must be met when editing the data.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use Constraints to maintain record-level constraints for the dataset.

Record-level constraints force business ruless limiting few fields in a single record. This constraints are checked at end of data editing (Post / AppendRecord / InsertRecord). Constraints, limiting single field are field constraints and must specified at TField.CustomConstraint or TField.ImportedConstraint.

The Constraints checking is performed when ConstraintsEnabled is True. If application needs to perform large updates to the dataset and application can guarantee the data consistancy, then set ConstraintsEnabled to False before updates, and return to original value after updates. The constraints are not checked at data fetching.

The expressions in Constraints must be predicates, evaluating to Boolean value. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • Client dataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Constraints;
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint

Example
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;
What do you think about this topic? Send feedback!


TADStoredProc.ConstraintsEnabled Property

TADStoredProc.ConstraintsEnabled Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Specifies whether the dataset perform constraint checking.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use ConstraintsEnabled to get / set the flag controlling automatic record-level constraints enforcement.

When ConstraintsEnabled is False (the default), the dataset does not check Constraints. This allows the dataset to perform the large data updates without overhead of checking constraints. When ConstraintsEnabled is True, the dataset checks Constraints at at end of data editing (Post / AppendRecord / InsertRecord).

If application needs to perform batch updates to dataset, then set ConstraintsEnabled to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property ConstraintsEnabled: Boolean;
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired

Example
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;
What do you think about this topic? Send feedback!


TADStoredProc.DetailFields Property

TADStoredProc.DetailFields Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use DetailFields property value to specify semicolon separated list of the detail dataset field names, used to establish a master-detail relationship with this dataset.

The DetailFields property is useful only for parameter based master-detail setup. For range based setup the indexed fields are used as the detail field list. When DetailFields is not specified explicitly, then field names matching to query parameter names will be used as DetailFields value.

The DetailFields will be used only to assign specified field values when a new record is inserted into detail dataset. The mechanism used to filter the detail dataset records does not use DetailFields.

Syntax
property DetailFields: String;
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName

Example
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';
What do you think about this topic? Send feedback!


TADStoredProc.FetchOptions Property

TADStoredProc.FetchOptions Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

The set of options to control rows fetching.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The FetchOptions property is the set of properties, controlling the fetching of cursor rows. These properties will inherit its values from FetchOptions of connection object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions

What do you think about this topic? Send feedback!


TADStoredProc.FilterChanges Property

TADStoredProc.FilterChanges Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Specifies what kinds of changed records must be "visible" in the dataset.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

The FilterChanges property allows to get / set changed records kinds, which must be accessible through navigation interface of dataset ("visible" in dataset):

Kind | Meaning
rtModified | Records changed after fetching or last CommitUpdates / CancelUpdates.
rtInserted | New records, not yet posted to DB and added after dataset open or after last CommitUpdates.
rtDeleted | Deleted records, not yet deleted from DB and deleted after dataset open or after last CommitUpdates.
rtUnmodified | Unchanged records.
rtHasErrors | Records having associated errors after ApplyUpdates. To get an error object use RowError property.
Syntax
property FilterChanges: TADUpdateRecordTypes;
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus

Example
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];
What do you think about this topic? Send feedback!


TADStoredProc.FormatOptions Property

TADStoredProc.FormatOptions Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

The set of options to control data representation.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Params

What do you think about this topic? Send feedback!


TADStoredProc.Indexes Property

TADStoredProc.Indexes Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Lists all client indexes that apply to the dataset.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use Indexes to define client side data views on the dataset records. Indexes are a collection of the TADIndex objects, each of them defines optional:

  • Sorting by fields (Fields, CaseInsFields, DescFields, Options).
  • Sorting by expression (Expression, Options).
  • Records filter (Filter, FilterOptions).
  • Records distinction flag (Distinct).

The individual indexes are not just the sort and filter definitions. FireDAC maintains a consistent view on the data for each active index, while application fetches data or edits data. That creates additional overhead, but allows to switch between indexes without delays.

To make a view current, set it Selected property to True or dataset IndexName property to the view name. Note, the view must have Active = True to be maintained.

Dataset maintains Indexes views, when IndexesActive is True. When an application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Setting IndexFieldNames does not add a TADIndex object to Indexes collection. Defining IndexDefs before dataset opening, will clear Indexes and fill them using IndexDefs information. So, there are two alternative ways - use IndexDefs or use Indexes. We suggest to use Indexes, as it is more flexible.

Some of the navigation methods, like a Locate / Lookup / SetRange are using indexes to optimize their operations.

The sorting and filter expressions in Indexes supports syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).
Syntax
property Indexes: TADIndexes;
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch

Example 1
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.

What do you think about this topic? Send feedback!


TADStoredProc.IndexesActive Property

TADStoredProc.IndexesActive Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Controls automatic maintenance of Index'es.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexesActive to indicate whether the dataset should maintain the data views, defined by the Indexes collection.

When IndexesActive is False, the dataset does not maintain the data views. That avoids the overhead of updating views, while data is fetched or is edited. When IndexesActive is True (by default), the dataset maintains the data views.

When indexes are maintained, each of them may be current index, selected by TADIndex.Selected or by IndexName properties.

To selectively enable and disable data views rather than turning them all on or off at once, use the Active property of individual TADIndex objects. These objects are available through the Indexes property.

If application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property IndexesActive: Boolean;
See Also

Sorting Records, Indexes, BeginBatch, EndBatch

Example
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;
What do you think about this topic? Send feedback!


TADStoredProc.IndexFieldNames Property

TADStoredProc.IndexFieldNames Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Lists the field names to use as an index.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexFieldNames as an alternative method of specifying the current index to use for a dataset.

Specify the name of each field on which to index the dataset, separating names with semicolons. Ordering of field names is significant. Optionally specify the postfix for any of fields in form "field[:[D][A][N]]", where:

- 'D' - use descending sorting on this field;

- 'A' - use ascending sorting on this field;

- 'N' - use case-insensitive sorting on this field.

Use IndexFieldNames to create sort orders on the fly. The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.

Syntax
property IndexFieldNames: String;
See Also

Sorting Records, Indexes, IndexName

Example
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';
What do you think about this topic? Send feedback!


TADStoredProc.IndexName Property

TADStoredProc.IndexName Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the current index for the dataset by its name.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexName to specify the current index for the dataset.

If IndexName is empty, the dataset's sort order is based on the IndexFieldNames property or on its default ordering as it is in dataset. If IndexName contains a name of valid index from Indexes collection, then that index is used to determine data view (including sort order) of records.

IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.

Syntax
property IndexName: String;
See Also

Sorting Records, Indexes, IndexFieldNames

Example
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';
What do you think about this topic? Send feedback!


TADStoredProc.LocalSQL Property

TADStoredProc.LocalSQL Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

The reference to a Local SQL engine.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

Use this property to get / set reference to a Local SQL engine.

When engine and Local SQL connection are active, then right after setting LocalSQL property, the dataset will be opened (if not yet) and will be registered in Local SQL engine. Otherwise dataset will be registered when engine and connection will be active. The TADMemTable structure must be defined before it will be opened.

The dataset will be registered using its Name property value. So, its Name property value must be not empty and unique across all datasets linked to the same Local SQL engine.

Setting this property to nil unregisters this dataset from Local SQL engine.

Syntax
property LocalSQL: TADCustomLocalSQL;
See Also

Local SQL, TADLocalSQL, TADMemTable

What do you think about this topic? Send feedback!


TADStoredProc.MasterFields Property

TADStoredProc.MasterFields Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use MasterFields property value to specify semicolon separated list of the master dataset field names, used to establish a master-detail relationship with this dataset.

Specify MasterFields property value after assigning MasterSource property value. The mechanism used to filter this detail dataset records depends on the dataset class:

  • TADQuery and TADStoredProc will match master fields to this query / procedure parameters by their names. When the master dataset current record is changed, then this dataset parameters will get values from the corresponding MasterFields.
  • TADMemTable will match master fields to this dataset indexed fields by their positions. When the master dataset current record is changed, then a range will be applied to this dataset, where starting and ending range values are equal to the corresponding MasterFields field values. The application must have a current active index. The indexed fields will be the detail dataset fields used to establish mater-detail.
Syntax
property MasterFields: String;
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName

Example
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
What do you think about this topic? Send feedback!


TADStoredProc.MasterSource Property

TADStoredProc.MasterSource Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Gets / sets a master data source, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use MasterSource to specify the data source linked to a dataset, which will be used as master dataset in master-detail relationship between this and specified datasets.

Additionally application must specify MasterFields property value. See MasterFields property description for additional information.

Syntax
property MasterSource: TDataSource;
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName

Example 1
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.

What do you think about this topic? Send feedback!


TADStoredProc.OnCommandChanged Event

TADStoredProc.OnCommandChanged Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Fires after the SQL property value is changed.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The OnCommandChanged event fires after the SQL command text value is changed:

  • for TADQuery - after SQL is changed;
  • for TADStoredProc - after StoredProcName is changed;
  • for TADTable - after TableName is changed.
Syntax
property OnCommandChanged: TNotifyEvent;
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName

What do you think about this topic? Send feedback!


TADStoredProc.OnError Event

TADStoredProc.OnError Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The event fires when an error happens, while dataset is communicating with DBMS.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
AInitiator | The reference to interface of object, which initially raised the exception.
AException | The exception object, which may be modified or even replaced by another exception object instance.
Description

The OnError event fires, when dataset executes one of the following operations and an error happens:

  • Prepare. The dataset is preparing DBMS command text for execution.
  • Open. The dataset is executing DBMS command to open cursor.
  • Execute , ExecSQL , ExecProc. The dataset is executing DBMS command text.
  • Navigation methods. The dataset is fetching rows from cursor.

If most cases AException object will of EADDBEngineException class. If AException is of EADDBArrayExecuteError class, then it is Array DML error handling case. You should use a code like in the first example.

To centralize error handling, you can consider to use TADCustomConnection.OnError.

Syntax
property OnError: TADErrorEvent;
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError

Example 1

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;
Example 2

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;
What do you think about this topic? Send feedback!


TADStoredProc.OnExecuteError Event

TADStoredProc.OnExecuteError Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

The event is triggered when an error happens, while executing a Array DML query.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
ATimes | The current Array DML size. It may be different from value of the Execute method ATimes parameter, if full operation is splitted into few more small (on Firebird, for example).
AOffset | The current Array DML offset. It may be different from value of the Execute method AOffset parameter, if there was skipped erroneous rows or full operation is splitted into few more small (on Firebird, for example).
AError | The original DBMS returned error. Check AError.Errors[i].RowIndex for the index of erroneous row in parameters array.
AAction | The action dataset should take after return from event handler.
Description

The OnExecuteError event is triggered, when the dataset failed to execute Array DML using Execute method and ATimes > 1. Using this event handler you can:

  • skip erroneous row of the parameters array;
  • change values in erroneous row of the parameters array;
  • stop full Array DML execution.

Note, OnExecuteError will be not called for the syntax errors or when ATimes = 1.

Syntax
property OnExecuteError: TADExecuteErrorEvent;
See Also

Array DML, EADDBEngineException, TADErrorAction, TADDataSet.Execute

Example
procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AError: EADDBEngineException; var AAction: TADErrorAction);
begin
  if AException.Errors[0].Kind = ekUKViolated then
    AAction := eaSkip
  else
    AAction := eaFail;
end;
What do you think about this topic? Send feedback!


TADStoredProc.OnReconcileError Event

TADStoredProc.OnReconcileError Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Fires when a dataset needs to reconcile an update to a record that cannot not be applied.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use the OnReconcileError event handler to respond to error conditions that arise when the ApplyUpdates method was applying changes to the records to the database. The OnReconcileError event handler is called by Reconcile method.

As part of Reconcile call the dataset will loop through all records with associated exception objects. And for each such record will call the OnReconcileError event handler. The event handler gets:

  • E - reference to the exception object. See Handling Errors topics for how to work with exception objects.
  • UpdateKind - the update kind of the current record. It may be one of the values: rsInserted, rsDeleted, rsModified, rsUnchanged.

After handling error the event handler should set Action argument. The default value is raMerge. The possible values are:

Action | Description
raSkip | Just skip current record.
raAbort | Just quit from Reconcile call.
raMerge | Clear the current record error state, make current record changes the new initial state of this record. IOW, merge changes into dataset records cache.
raCorrect | Clear current record error state. IOW, mark the record as correctly applied.
raCancel | Cancel current record changes.
raRefresh | Cancel current record changes and reread the record values from the database.

The event handler may analyze the original and current field values, by reading TField.OldValue and NewValue properties. Application may also update the current field value, set Action to raCorrect, and later call ApplyUdpates again.

Syntax
property OnReconcileError: TADReconcileErrorEvent;
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError

Example
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;
What do you think about this topic? Send feedback!


TADStoredProc.OnUpdateError Event

TADStoredProc.OnUpdateError Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Fires if an exception is generated when updates are applied to a database.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use the OnUpdateError event handler to respond to exceptions raised while applying immediate or cached updates to a database.

ASender is the dataset to which updates are applied.

AException is a pointer to a EADException object from which an application can extract an error message and the actual cause of the error condition. The OnUpdateError handler can use this information to determine how to respond to the error condition. In most cases AException object will be of class EADDBEngineException or even one of it DBMS specific subclasses.

ARow is a DatS row object, repesenting erroneous record in dataset. This record is also current record in ASender.

ARequest indicates whether the error occurred while inserting, deleting, or modifying a record.

AAction indicates the action to take when the OnUpdateError handler exits. On entry into the handler, AAction is always set to eaDefault, which leads to uaFail, if not changed. If OnUpdateError can handle or correct the error, set AAction to uaRetry before exiting the error handler. Or consider other options.

The error handler can use the OldValue and NewValue properties TField to evaluate error conditions and set NewValue to a new value to reapply. In this case, set AAction to uaRetry before exiting.

The code in an OnUpdateError handler must not call any methods that make a different record the current one !

Syntax
property OnUpdateError: TADUpdateErrorEvent;
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord

Example
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;
What do you think about this topic? Send feedback!


TADStoredProc.OnUpdateRecord Event

TADStoredProc.OnUpdateRecord Event
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Occurs when record update is applying to a database.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use an OnUpdateRecord event handler to process immediate or cached updates that cannot be correctly or easily handled:

  • using FireDAC automatic SQL update command generation;
  • by a single table adapter component;
  • by a single update component.

This event is useful for applications that require:

  • additional control over parameters and macros substitution in update components;
  • multi SQL statement updates, when DBMS does not support batches or blocks;
  • non-SQL updates posting;
  • etc

ASender is the dataset to which updates are applied.

ARequest indicates whether the current update is the insertion, deletion or modification of a record.

AAction indicates the action taken by the OnUpdateRecord handler before it exits. On entry into the handler, AAction is always set to eaDefault. If OnUpdateRecord is successful, it should set AAction to eaApplied before exiting.

AAction value | Description
eaFail | Mark the update as failed and return an error.
eaSkip | Skip current update and do not mark it as applied.
eaRetry | Retry the current operation.
eaApplied | Mark current update as applied.
eaDefault | Take default action. For successful update it is eaApplied, for failed update it is eaFail.
eaExitSuccess | Stop to process the cached updates, return success.
eaExitFailure | Stop to process the cached updates, return failure.

The OnUpdateRecord event handler code should read the dataset field values, including TField.NewValue, OldValue and CurValue. There:

  • NewValue is the new field value before posting updates.
  • OldValue is the original field value, as it was after record fetching or after last updates applying.
  • CurValue is the current field value, the same as Value property.

Note, the OnUpdateRecord handler code must not call the methods that change the current dataset position.

Syntax
property OnUpdateRecord: TADUpdateRecordEvent;
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError

Example 1
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;
Example 2

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main
What do you think about this topic? Send feedback!


TADStoredProc.Overload Property

TADStoredProc.Overload Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Specifies which Oracle overloaded packaged stored procedure to execute.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

Use Overload to specify which overloaded stored procedure to execute on an Oracle server. An Oracle overloaded stored procedure is one that shares a name with one or more other stored procedures. Oracle distinguishes among overloaded stored procedures by assigning each procedure a unique numeric identifier. An application can specify this identifier using the Overload property.

By default, Overload is zero, which assumes there is no procedure overloading. For all servers except Oracle, this value will not have the effect. If an application attempts to access an Oracle overloaded procedure without setting Overload, the FireDAC accesses the lowest numbered, or first, overloaded procedure on the server.

If Overload is 1, the FireDAC executes the first overloaded procedure on the server. If Overload is 2, it executes the second, and so on.

While Oracle overloaded procedures share names, their parameter lists are unique. An application must ensure that it passes the correct parameter list to an overloaded procedure.

Syntax
property Overload: Word;
See Also

Executing Stored Procedure, Params, StoredProcName

What do you think about this topic? Send feedback!


TADStoredProc.PackageName Property

TADStoredProc.PackageName Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Limits the stored procedure names to the specified package name.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

Specify the PackageName property value to limit the procedure name to the specified package.

Syntax
property PackageName: String;
See Also

Object Names, CatalogName, SchemaName, Overload, StoredProcName

What do you think about this topic? Send feedback!


TADStoredProc.ParamBindMode Property

TADStoredProc.ParamBindMode Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

Get or set ParamBindMode to determine the order in which parameters in the Params property are matched to the parameters used by the SQL command on the server. ParamBindMode can be one of the following:

Value | Ordering
pbByName | Parameters specified in the Params property are matched to identically named parameters on the server. This is the default.
pbByNumber | Parameters in Params are assigned one-by-one to the next available parameter on the server (for example, the first parameter in Params is assigned to the first parameter used by the SQL command, and so on).

Whenever possible, ParamBindMode should be pbByName. This guarantees that parameters are matched to the correct parameters used by the SQL command regardless of physical ordering in Params. At design time, the names of known parameters appear in the Parameters editor.

Syntax
property ParamBindMode: TADParamBindMode;
See Also

Params

What do you think about this topic? Send feedback!


TADStoredProc.Params Property

TADStoredProc.Params Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example 1 Example 2 Example 3 Example 4 published See Also Send Feedback

Contains the parameters for a SQL statement.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example 1, Example 2, Example 3, Example 4, published, See Also
Description

Use Params property to view and set SQL statement parameter names, values, and data types at run time. Use the collection editor for the Params property to set parameter information at design time.

If dataset is TADQuery, then Params is populated automatically after changing SQL property value, if ResourceOptions.ParamCreate = True. The parameters order is the same as they appear in the SQL command. When Params.BindMode = pbByName, then each parameter name will appear in Params only once. When Params.BindMode = pbByNumber, then each parameter marker will appear in the Params, including duplicated names.

If dataset is TADStoredProc, then Params is populated automatically after calling Prepare method at run time or changing StoredProcName at design time, if fiMeta is in FetchOption.Items. The parameters order is the same as in the stored procedure header.

Otherwise Params may be populated by hands. At Prepare call, parameters will be bind to prepared SQL command. After that you cannot change parameter types, otherwise will get an exception.

An easier way to set and retrieve parameter values when the name of each parameter is known is to call ParamByName. This method is especially preferred versus accessing parameters by index when they are populated automatically and there is a chance that the SQL property or StoredProcName property will be changed in the code dynamically.

Syntax
property Params: TADParams;
See Also

Executing Command, Executing Stored Procedure, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items

Example 1
// TADQuery automatic parameters creation - ResourceOptions.ParamCreate = True
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.Open;
Example 2
// TADQuery manual parameters creation - ResourceOptions.ParamCreate = False
ADQuery1.ResourceOptions.ParamCreate := False;
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
with ADQuery1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
  AsString := 'qwe';
end;
ADQuery1.Open;
Example 3
// TADStoredProc automatic parameters creation - fiMeta in FetchOptions.Items
ADStoredProc1.StoredProcName := 'my_proc';
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;
Example 4
// TADStoredProc manual parameters creation - fiMeta not in FetchOptions.Items
ADStoredProc1.FetchOptions.Items := ADStoredProc1.FetchOptions.Items - [fiMeta];
ADStoredProc1.StoredProcName := 'my_proc';
with ADStoredProc1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
end;
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;
What do you think about this topic? Send feedback!


TADStoredProc.ResourceOptions Property

TADStoredProc.ResourceOptions Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

The set of options to control resources usage.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The ResourceOptions property is the set of properties, controlling the resources usage by the dataset. These properties will inherit its values from ResourceOptions of connection object.

Syntax
property ResourceOptions: TADBottomResourceOptions;
See Also

Setting Options, TADBottomResourceOptions

What do you think about this topic? Send feedback!


TADStoredProc.SchemaAdapter Property

TADStoredProc.SchemaAdapter Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

Use SchemaAdapter property to set a reference to the TADSchemaAdapter object to enable Centralized Cashed Updates mode. The schema adapter object will be used as a central change log share by few datasets.

To enable propagation of master dataset changes to a detail dataset set FetchOptions.DetailCascade to True for a detail dataset. Also both master and detail datasets must point to the same TADSchemaAdapter object.

Syntax
property SchemaAdapter: TADCustomSchemaAdapter;
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade

Example
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;
What do you think about this topic? Send feedback!


TADStoredProc.SchemaName Property

TADStoredProc.SchemaName Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Limits the stored procedure names to the specified schema.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

Specify the SchemaName property value to limit the set of schemas to the specified schema.

Syntax
property SchemaName: String;
See Also

Object Names, CatalogName, PackageName, Overload, StoredProcName

What do you think about this topic? Send feedback!


TADStoredProc.StoredProcName Property

TADStoredProc.StoredProcName Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Identifies the name of the stored procedure on the server to call.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Set StoredProcName to specify the name of the stored in database procedure to call. The full name of the stored procedure will be build from CatalogName, SchemaName, PackageName, Overload property values. Also a full name may be assigned to the StoredProcName (only for non-packaged procedures). If name is case sensitive or contains special characters, then it must be explicitly quoted.

If database does not have stored procedure with StoredProcName name, then when the application attempts to prepare the stored procedure, an exception will be raised.

Syntax
property StoredProcName: string;
See Also

Object Names, Executing Stored Procedure, CatalogName, SchemaName, PackageName, Overload

Example 1
ADStoredProc1.StoredProcName := 'Northwind.dbo.[my proc]';
// the same as following
ADStoredProc1.CatalogName := 'Northwind';
ADStoredProc1.SchemaName := 'dbo';
ADStoredProc1.StoredProcName := '[my proc]';
Example 2
ADStoredProc1.PackageName := 'sys.dbms_sql';
ADStoredProc1.StoredProcName := 'execute';
What do you think about this topic? Send feedback!


TADStoredProc.Transaction Property

TADStoredProc.Transaction Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

Gets / sets reference to transaction object.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The Transaction property allows to associate dataset with explicit transaction object. If it is not specified, then dataset will be associated with connection default transaction.

The specified transaction object will be used only for Prepare, Open, ExecSQL, ExecProc, Execute methods. For commands, generated to apply changes to database, FireDAC will use UpdateTransaction, if it is specified, otherwise - Transaction.

Currently explicit transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property Transaction: TADCustomTransaction;
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction

What do you think about this topic? Send feedback!


TADStoredProc.UpdateObject Property

TADStoredProc.UpdateObject Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Specifies the update object component used to post updates by dataset.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use UpdateObject to specify the TADUpdateSQL component to use in an application that must be able to post updates in a non-standard way.

The FireDAC has build in updates command generator, which using multiple information sources is able to generate SQL update commands for most of scenarios. In some cases, such as a query made against multiple tables, which may require multi-statement update, FireDAC cannot generate SQL update commands. In these cases, UpdateObject can be used to specify a TADUpdateSQL component that allows to specify custom SQL commands for each update posting case, like a insert / update / delete.

As alternative to update object usage, you can consider to use OnUpdateRecord event. It gives more options, but requires manual coding of posting updates. Also, in OnUpdateRecord handler you can use multiple update objects. See demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.

Syntax
property UpdateObject: TADCustomUpdateObject;
See Also

OnUpdateRecord, TADUpdateSQL

Example 1
ADUpdateSQL1.InsertSQL.Text := 'insert into mytab values (:new_id, :new_name)';
ADQuery1.UpdateObject := ADUpdateSQL1;
ADQuery1.Append;
ADQuery1['id'] := 100;
ADQuery1['name'] := 'qwe';
ADQuery1.Post;
Example 2

Demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.

What do you think about this topic? Send feedback!


TADStoredProc.UpdateOptions Property

TADStoredProc.UpdateOptions Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace published See Also Send Feedback

The set of options to control updates posting.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, published, See Also
Description

The UpdateOptions property is the set of properties, controlling the posting updates from the dataset. These properties will inherit its values from UpdateOptions of connection object.

Syntax
property UpdateOptions: TADBottomUpdateOptions;
See Also

Setting Options, TADBottomUpdateOptions

What do you think about this topic? Send feedback!


TADStoredProc.UpdateTransaction Property

TADStoredProc.UpdateTransaction Property
TADStoredProc Class TADStoredProc Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets reference to transaction object.

Group

published

Links
TADStoredProc Class, TADStoredProc Members, uADCompClient Namespace, Example, published, See Also
Description

The UpdateTransaction property allows to associate dataset internal update commands with explicit transaction object. If it is not specified, then dataset update commands will be associated with connection default update transaction. If it is not specified, then - with dataset Transaction.

For Prepare, Open, ExecSQL, ExecProc, Execute methods will be used Transaction objects.

Currently explicit update transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property UpdateTransaction: TADCustomTransaction;
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction

Example
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction
What do you think about this topic? Send feedback!


TADTable Class

TADTable Class
public protected published TADTable Members Classes See Also Send Feedback

The class implementing dataset, working with single database table.

Group

Classes

Class Hierarchy
  uADCompClient_TADTableuADCompClient_TADTableuADCompClient_TADTableuADCompClient_TADTableuADCompClient_TADTable
File

uADCompClient

Links
public, protected, published, TADTable Members, Classes, See Also
Description

Use TADTable to browse database table and edit it records. The TADTable generates a SELECT statement basing on its properties and send it to a DBMS.

Syntax
TADTable = class(TADCustomQuery);
See Also

Browsing Table, TADQuery

What do you think about this topic? Send feedback!


TADTable Members

TADTable Members
Events TADTable Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADTable.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADTable Class

Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecSQL | Executes the SQL statement for the query.
ExecSQL | Executes the specified SQL statement for the query.
ExecSQL | Executes the specified SQL statement and parameter values for the query.
ExecSQL | Executes the specified SQL statement and assigns parameter values for the query.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetCustomWhere | Allows to submit a custom WHERE phrase or additional filtering condition.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefireSQL | Allows to rebuild a SELECT statement and reopen the table.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the table names to the catalog.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DataSource | Specifies the data source object from which associated dataset to get matching field values to the details dataset parameters.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
Exists | Returns True when the specified table exists.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the query SQL text.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the table names to the schema.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
SQL | Contains the text of the SQL statement to execute for the query.
Table | The reference to DatS table object, actually representing the internal data storage.
TableName | Gets / sets table name to open.
Text | Points to the actual text of the SQL query passed to the DBMS CLI.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.
Links
Events, TADTable Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADTable Class Legend Methods Properties Send Feedback

The public members of the TADTable class are listed here.

Class

TADTable Class

Methods
Method | Description
Disconnect | Disconnects the dataset from DBMS.
Open | Executes the specified SQL statement and opens dataset.
RefireSQL | Allows to rebuild a SELECT statement and reopen the table.
Properties
Property | Description
Exists | Returns True when the specified table exists.
Links
TADTable Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADTable.Exists Property

TADTable.Exists Property
TADTable Class TADTable Members uADCompClient Namespace public See Also Send Feedback

Returns True when the specified table exists.

Group

public

Links
TADTable Class, TADTable Members, uADCompClient Namespace, public, See Also
Description

Use the Exists property to verify when a table specified by the CatalogName, SchemaName, TableName properties is existing.

Syntax
property Exists: Boolean;
See Also

CatalogName, SchemaName, TableName

What do you think about this topic? Send feedback!


TADTable.Disconnect Method

TADTable.Disconnect Method
TADTable Class TADTable Members uADCompClient Namespace Example public See Also Send Feedback

Disconnects the dataset from DBMS.

Group

public

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
AAbortJob: Boolean = False | True, if current dataset task must be aborted.
Description

The Disconnect method optionally aborts current dataset task, like a Open, ExecSQL, ExecProc, Execute or rows fetching. Then closes dataset and unprepares it.

Syntax
procedure Disconnect(AAbortJob: Boolean = False); override;
See Also

AbortJob

Example
ADQuery1.Disconnect(True);
// is equivalent to:
// ADQuery1.AbortJob(True);
// ADQuery1.Close;
// ADQuery1.Unprepare;
What do you think about this topic? Send feedback!


TADTable.Open Method

TADTable.Open Method
TADTable Class TADTable Members uADCompClient Namespace Example public See Also Send Feedback

Executes the specified SQL statement and opens dataset.

Group

public

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, public, See Also
Parameters
Parameters | Description
ASQL | A SQL command to execute.
Description

Call Open to execute the SQL statement specified in ASQL or is currently assigned to the internal command object, if ASQL is empty.

The method closes the dataset if it was active, then assigns ASQL to the command text, and sets the Active property to True. When Active is true, the dataset is populated with data from a database.

When an application needs to execute the same SQL command many times, then an application may ordinarily set SQL property, call Prepare before calling Open for the first time, then use any Open version without specifying ASQL.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum command execution time. After that time command execution will be canceled and exception raised.

To cancel command execution use TADAdaptedDataSet.AbortJob.

If DBMS returns error, then FireDAC raises an exception. It may be analyzed in OnError event.

Syntax
procedure Open(const ATableName: String); overload;
See Also

Prepare, TDataSet.Open, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError

Example
ADQuery1.Open('select * from customers');
What do you think about this topic? Send feedback!


TADTable.RefireSQL Method

TADTable.RefireSQL Method
TADTable Class TADTable Members uADCompClient Namespace public See Also Send Feedback

Allows to rebuild a SELECT statement and reopen the table.

Group

public

Links
TADTable Class, TADTable Members, uADCompClient Namespace, public, See Also
Description

Use the RefireSQL method to force FireDAC to rebuild a SELECT statement, which TADTable will send to a DBMS, and to reopen the table. That may be useful, when the GetCustomWhere method value has to be changed.

Syntax
procedure RefireSQL;
See Also

GetCustomWhere

What do you think about this topic? Send feedback!


protected

protected
TADTable Class Legend Methods Send Feedback

The protected members of the TADTable class are listed here.

Class

TADTable Class

Methods
Method | Description
GetCustomWhere | Allows to submit a custom WHERE phrase or additional filtering condition.
Links
TADTable Class, Legend, Methods
What do you think about this topic? Send feedback!


TADTable.GetCustomWhere Method

TADTable.GetCustomWhere Method
TADTable Class TADTable Members uADCompClient Namespace protected See Also Send Feedback

Allows to submit a custom WHERE phrase or additional filtering condition.

Group

protected

Links
TADTable Class, TADTable Members, uADCompClient Namespace, protected, See Also
Description

Override the GetCustomWhere method to submit a custom WHERE phrase or additional filtering condition to a SELECT command, which TADTable will send to a DBMS. The returned value must be a SQL predicate.

Syntax
function GetCustomWhere: String; virtual;
See Also

Filtering Records

What do you think about this topic? Send feedback!


published

published
Events TADTable Class Legend Properties Send Feedback

The published members of the TADTable class are listed here.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADTable Class

Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the table names to the catalog.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FormatOptions | The set of options to control data representation.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the table names to the schema.
TableName | Gets / sets table name to open.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateTransaction | Gets / sets reference to transaction object.
Links
Events, TADTable Class, Legend, Properties
What do you think about this topic? Send feedback!


TADTable.ActiveStoredUsage Property

TADTable.ActiveStoredUsage Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Controls how to use Active property value saved to DFM.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
See Also

TDataSet.Active

What do you think about this topic? Send feedback!


TADTable.AfterApplyUpdates Event

TADTable.AfterApplyUpdates Event
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Fires after cached updates are applied to DB.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The AfterApplyUpdates event fires after cached updates are applied to DB as result of ApplyUpdates method call.

Syntax
property AfterApplyUpdates: TADAfterApplyUpdatesEvent;
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates

What do you think about this topic? Send feedback!


TADTable.AfterGetRecord Event

TADTable.AfterGetRecord Event
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset one time for each fetched record.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecord event fires after dataset fetched next rowset as result of navigation methods calls. The event fires one time for each fetched record. For example, fetching occurs automatically inside of Next, Last, Locate methods. Inside of an event handler application may read dataset fields to get fetched record field values.

Syntax
property AfterGetRecord: TADDataSetEvent;
See Also

AfterGetRecords

What do you think about this topic? Send feedback!


TADTable.AfterGetRecords Event

TADTable.AfterGetRecords Event
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching next rowset.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The AfterGetRecords event fires after dataset fetched next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property AfterGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord

What do you think about this topic? Send feedback!


TADTable.AfterRowRequest Event

TADTable.AfterRowRequest Event
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Fires after fetching record.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The AfterRowRequest event fires after dataset fetched current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property AfterRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest

What do you think about this topic? Send feedback!


TADTable.Aggregates Property

TADTable.Aggregates Property
TADTable Class TADTable Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The collection of client side aggregates, defined for dataset.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use Aggregates to define client side aggregating formulas, that will be automatically maintained and calculated for group of or for all records of dataset.

All records in the group of records has the same field values for defined set of fields. Aggregates performing calculation for group of records must be associated with one of the indexes. These aggregate expressions will be calculated only is associated index is current and active.

Adding aggregate field does not add TADAggregate object to Aggregates collection. That are two alternative ways - to use aggregate fields or to use Aggregates.

DataSet will automatically maintain and calculate Aggregates values when dataset is fetching the data or application edits the data, if AggregatesActive is True. If application needs to perform large updates to dataset and aggregate values are not needed while updating, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

When aggregates are maintained, the Value method of every active aggregate object returns a value that reflects the current data in the dataset. When users edit the data in the dataset, these values are recalculated to reflect the user's changes.

The expressions in Aggregates must contain aggregating functions, like a SUM, COUNT. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Aggregates: TADAggregates;
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch

Example 1
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.

What do you think about this topic? Send feedback!


TADTable.AggregatesActive Property

TADTable.AggregatesActive Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Controls automatic calculation of aggregate values.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use AggregatesActive to get / set the flag controlling automatic maintenance and calculation of dataset aggregate values.

When AggregatesActive is False (the default), the dataset does not maintain aggregates. This allows the dataset to perform large updates to the dataset or fetch big volumes of data without overhead of calculating aggregate values, which happens at fetching or data editing. When AggregatesActive is True, the dataset calculates and maintains all aggregate values specified by the Aggregates property that are compatible with the current index.

To selectively enable and disable aggregates rather than turning them all on or off at once, use the Active property of individual TADAggregate objects. These objects are available through the Aggregates property.

If application needs to perform batch updates to dataset, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property AggregatesActive: Boolean;
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch

Example
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;
What do you think about this topic? Send feedback!


TADTable.BeforeApplyUpdates Event

TADTable.BeforeApplyUpdates Event
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Fires before cached updates are applied to DB.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The BeforeApplyUpdates event fires before cached updates are applied to database as result of ApplyUpdates method call.

Syntax
property BeforeApplyUpdates: TADDataSetEvent;
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates

What do you think about this topic? Send feedback!


TADTable.BeforeGetRecords Event

TADTable.BeforeGetRecords Event
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching next rowset.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The BeforeGetRecords event fires before dataset will fetch next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property BeforeGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, AfterGetRecords

What do you think about this topic? Send feedback!


TADTable.BeforeRowRequest Event

TADTable.BeforeRowRequest Event
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Fires before fetching record.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The BeforeRowRequest event fires before dataset will fetch current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property BeforeRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest

What do you think about this topic? Send feedback!


TADTable.CachedUpdates Property

TADTable.CachedUpdates Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Specifies whether dataset will log changes to the data without immediate applying of them to the database.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

CachedUpdates enables (True) or disables (False) the logging of data changes (Insert/Post, Edit/Post, Delete) without immediate applying of them to the database.

An application must explicitly apply changes from change log to the database, using ApplyUpdates method. All changes will be written in comparably small amount of time in single transaction. The main benefits of enabling cached updates are:

  • fewer transactions and shorter transaction times;
  • minimization of network traffic;
  • simplified implementation of undo / redo functionality for dataset;
  • ability to implement application offline mode or briefcase model.

The potential drawbacks of enabling cached updates are:

  • other applications can access and change the actual data on the server while users are editing local copies of the data, resulting in an update conflict when cached updates are applied to the database;
  • other applications cannot access data changes made by an application until its cached updates are applied to the database.

Note, to change CachedUpdate property value for TADTable, it must be inactive.

Syntax
property CachedUpdates: Boolean;
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates

Example
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;
What do you think about this topic? Send feedback!


TADTable.CatalogName Property

TADTable.CatalogName Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Limits the table names to the catalog.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

Specify the CatalogName property value to limit the set of catalogs to the single value.

Syntax
property CatalogName: String;
See Also

Object Names, SchemaName, TableName

What do you think about this topic? Send feedback!


TADTable.Connection Property

TADTable.Connection Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Specifies the FireDAC connection component to use.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

Use Connection to specify an FireDAC connection object to use to connect to an DBMS.

At design-time, select from the list of available TADCustomConnection objects (if any have been added to the application) invoked from the Object Inspector. If a form or data module has TADCustomConnection dropped on it, then TADRdbmsDataSet assigns this connection object to Connection property automatically right after dropping on the form or data module.

At runtime, set Connection to reference an existing TADConnection object.

The TADRdbmsDataSet can be bind to TADCustomConnection object using Connection or ConnectionName property. Using ConnectionName property allows to bind to a connection object, if it is even not yet created or is not accessible.

Syntax
property Connection: TADCustomConnection;
See Also

ConnectionName

What do you think about this topic? Send feedback!


TADTable.ConnectionName Property

TADTable.ConnectionName Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Specifies the FireDAC connection to use by its name.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use ConnectionName to specify an FireDAC connection to use to connect to an DBMS. The ConnectionName property value specifies the name of the connection. It must match to the:

  • name of one of connection definitions, either stored in external file (persistent) or created on fly (private);
  • ConnectionName of one of the TADConnection objects.

The ConnectionName property value must be specified before Prepare call. If it matches the name of one of connection definitions, then FireDAC will transparently create connection object and link the dataset with it.

The TADRdbmsDataSet cab be bind to TADCustomConnection object using Connection or ConnectionName property. Using Connection property allows to bind to a connection object explicitly and reduce the overhead for resolving connection names.

Syntax
property ConnectionName: String;
See Also

Connection, TADCustomConnection.Temporary

Example
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');
What do you think about this topic? Send feedback!


TADTable.Constraints Property

TADTable.Constraints Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Specifies record-level client constraints that must be met when editing the data.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use Constraints to maintain record-level constraints for the dataset.

Record-level constraints force business ruless limiting few fields in a single record. This constraints are checked at end of data editing (Post / AppendRecord / InsertRecord). Constraints, limiting single field are field constraints and must specified at TField.CustomConstraint or TField.ImportedConstraint.

The Constraints checking is performed when ConstraintsEnabled is True. If application needs to perform large updates to the dataset and application can guarantee the data consistancy, then set ConstraintsEnabled to False before updates, and return to original value after updates. The constraints are not checked at data fetching.

The expressions in Constraints must be predicates, evaluating to Boolean value. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • Client dataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Constraints;
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint

Example
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;
What do you think about this topic? Send feedback!


TADTable.ConstraintsEnabled Property

TADTable.ConstraintsEnabled Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Specifies whether the dataset perform constraint checking.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use ConstraintsEnabled to get / set the flag controlling automatic record-level constraints enforcement.

When ConstraintsEnabled is False (the default), the dataset does not check Constraints. This allows the dataset to perform the large data updates without overhead of checking constraints. When ConstraintsEnabled is True, the dataset checks Constraints at at end of data editing (Post / AppendRecord / InsertRecord).

If application needs to perform batch updates to dataset, then set ConstraintsEnabled to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property ConstraintsEnabled: Boolean;
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired

Example
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;
What do you think about this topic? Send feedback!


TADTable.DetailFields Property

TADTable.DetailFields Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use DetailFields property value to specify semicolon separated list of the detail dataset field names, used to establish a master-detail relationship with this dataset.

The DetailFields property is useful only for parameter based master-detail setup. For range based setup the indexed fields are used as the detail field list. When DetailFields is not specified explicitly, then field names matching to query parameter names will be used as DetailFields value.

The DetailFields will be used only to assign specified field values when a new record is inserted into detail dataset. The mechanism used to filter the detail dataset records does not use DetailFields.

Syntax
property DetailFields: String;
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName

Example
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';
What do you think about this topic? Send feedback!


TADTable.FetchOptions Property

TADTable.FetchOptions Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

The set of options to control rows fetching.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The FetchOptions property is the set of properties, controlling the fetching of cursor rows. These properties will inherit its values from FetchOptions of connection object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions

What do you think about this topic? Send feedback!


TADTable.FilterChanges Property

TADTable.FilterChanges Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Specifies what kinds of changed records must be "visible" in the dataset.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

The FilterChanges property allows to get / set changed records kinds, which must be accessible through navigation interface of dataset ("visible" in dataset):

Kind | Meaning
rtModified | Records changed after fetching or last CommitUpdates / CancelUpdates.
rtInserted | New records, not yet posted to DB and added after dataset open or after last CommitUpdates.
rtDeleted | Deleted records, not yet deleted from DB and deleted after dataset open or after last CommitUpdates.
rtUnmodified | Unchanged records.
rtHasErrors | Records having associated errors after ApplyUpdates. To get an error object use RowError property.
Syntax
property FilterChanges: TADUpdateRecordTypes;
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus

Example
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];
What do you think about this topic? Send feedback!


TADTable.FormatOptions Property

TADTable.FormatOptions Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

The set of options to control data representation.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Params

What do you think about this topic? Send feedback!


TADTable.IndexFieldNames Property

TADTable.IndexFieldNames Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Lists the field names to use as an index.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexFieldNames as an alternative method of specifying the current index to use for a dataset.

Specify the name of each field on which to index the dataset, separating names with semicolons. Ordering of field names is significant. Optionally specify the postfix for any of fields in form "field[:[D][A][N]]", where:

- 'D' - use descending sorting on this field;

- 'A' - use ascending sorting on this field;

- 'N' - use case-insensitive sorting on this field.

Use IndexFieldNames to create sort orders on the fly. The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.

Syntax
property IndexFieldNames: String;
See Also

Sorting Records, Indexes, IndexName

Example
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';
What do you think about this topic? Send feedback!


TADTable.IndexName Property

TADTable.IndexName Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets the current index for the dataset by its name.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use IndexName to specify the current index for the dataset.

If IndexName is empty, the dataset's sort order is based on the IndexFieldNames property or on its default ordering as it is in dataset. If IndexName contains a name of valid index from Indexes collection, then that index is used to determine data view (including sort order) of records.

IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.

Syntax
property IndexName: String;
See Also

Sorting Records, Indexes, IndexFieldNames

Example
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';
What do you think about this topic? Send feedback!


TADTable.LocalSQL Property

TADTable.LocalSQL Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

The reference to a Local SQL engine.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

Use this property to get / set reference to a Local SQL engine.

When engine and Local SQL connection are active, then right after setting LocalSQL property, the dataset will be opened (if not yet) and will be registered in Local SQL engine. Otherwise dataset will be registered when engine and connection will be active. The TADMemTable structure must be defined before it will be opened.

The dataset will be registered using its Name property value. So, its Name property value must be not empty and unique across all datasets linked to the same Local SQL engine.

Setting this property to nil unregisters this dataset from Local SQL engine.

Syntax
property LocalSQL: TADCustomLocalSQL;
See Also

Local SQL, TADLocalSQL, TADMemTable

What do you think about this topic? Send feedback!


TADTable.MasterFields Property

TADTable.MasterFields Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use MasterFields property value to specify semicolon separated list of the master dataset field names, used to establish a master-detail relationship with this dataset.

Specify MasterFields property value after assigning MasterSource property value. The mechanism used to filter this detail dataset records depends on the dataset class:

  • TADQuery and TADStoredProc will match master fields to this query / procedure parameters by their names. When the master dataset current record is changed, then this dataset parameters will get values from the corresponding MasterFields.
  • TADMemTable will match master fields to this dataset indexed fields by their positions. When the master dataset current record is changed, then a range will be applied to this dataset, where starting and ending range values are equal to the corresponding MasterFields field values. The application must have a current active index. The indexed fields will be the detail dataset fields used to establish mater-detail.
Syntax
property MasterFields: String;
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName

Example
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
What do you think about this topic? Send feedback!


TADTable.MasterSource Property

TADTable.MasterSource Property
TADTable Class TADTable Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Gets / sets a master data source, used to establish a master-detail relationship with this dataset.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use MasterSource to specify the data source linked to a dataset, which will be used as master dataset in master-detail relationship between this and specified datasets.

Additionally application must specify MasterFields property value. See MasterFields property description for additional information.

Syntax
property MasterSource: TDataSource;
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName

Example 1
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.

What do you think about this topic? Send feedback!


TADTable.OnCommandChanged Event

TADTable.OnCommandChanged Event
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Fires after the SQL property value is changed.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The OnCommandChanged event fires after the SQL command text value is changed:

  • for TADQuery - after SQL is changed;
  • for TADStoredProc - after StoredProcName is changed;
  • for TADTable - after TableName is changed.
Syntax
property OnCommandChanged: TNotifyEvent;
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName

What do you think about this topic? Send feedback!


TADTable.OnError Event

TADTable.OnError Event
TADTable Class TADTable Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

The event fires when an error happens, while dataset is communicating with DBMS.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
AInitiator | The reference to interface of object, which initially raised the exception.
AException | The exception object, which may be modified or even replaced by another exception object instance.
Description

The OnError event fires, when dataset executes one of the following operations and an error happens:

  • Prepare. The dataset is preparing DBMS command text for execution.
  • Open. The dataset is executing DBMS command to open cursor.
  • Execute , ExecSQL , ExecProc. The dataset is executing DBMS command text.
  • Navigation methods. The dataset is fetching rows from cursor.

If most cases AException object will of EADDBEngineException class. If AException is of EADDBArrayExecuteError class, then it is Array DML error handling case. You should use a code like in the first example.

To centralize error handling, you can consider to use TADCustomConnection.OnError.

Syntax
property OnError: TADErrorEvent;
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError

Example 1

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;
Example 2

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;
What do you think about this topic? Send feedback!


TADTable.OnExecuteError Event

TADTable.OnExecuteError Event
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

The event is triggered when an error happens, while executing a Array DML query.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Parameters
Parameters | Description
ASender | The reference to dataset.
ATimes | The current Array DML size. It may be different from value of the Execute method ATimes parameter, if full operation is splitted into few more small (on Firebird, for example).
AOffset | The current Array DML offset. It may be different from value of the Execute method AOffset parameter, if there was skipped erroneous rows or full operation is splitted into few more small (on Firebird, for example).
AError | The original DBMS returned error. Check AError.Errors[i].RowIndex for the index of erroneous row in parameters array.
AAction | The action dataset should take after return from event handler.
Description

The OnExecuteError event is triggered, when the dataset failed to execute Array DML using Execute method and ATimes > 1. Using this event handler you can:

  • skip erroneous row of the parameters array;
  • change values in erroneous row of the parameters array;
  • stop full Array DML execution.

Note, OnExecuteError will be not called for the syntax errors or when ATimes = 1.

Syntax
property OnExecuteError: TADExecuteErrorEvent;
See Also

Array DML, EADDBEngineException, TADErrorAction, TADDataSet.Execute

Example
procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AError: EADDBEngineException; var AAction: TADErrorAction);
begin
  if AException.Errors[0].Kind = ekUKViolated then
    AAction := eaSkip
  else
    AAction := eaFail;
end;
What do you think about this topic? Send feedback!


TADTable.OnReconcileError Event

TADTable.OnReconcileError Event
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Fires when a dataset needs to reconcile an update to a record that cannot not be applied.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use the OnReconcileError event handler to respond to error conditions that arise when the ApplyUpdates method was applying changes to the records to the database. The OnReconcileError event handler is called by Reconcile method.

As part of Reconcile call the dataset will loop through all records with associated exception objects. And for each such record will call the OnReconcileError event handler. The event handler gets:

  • E - reference to the exception object. See Handling Errors topics for how to work with exception objects.
  • UpdateKind - the update kind of the current record. It may be one of the values: rsInserted, rsDeleted, rsModified, rsUnchanged.

After handling error the event handler should set Action argument. The default value is raMerge. The possible values are:

Action | Description
raSkip | Just skip current record.
raAbort | Just quit from Reconcile call.
raMerge | Clear the current record error state, make current record changes the new initial state of this record. IOW, merge changes into dataset records cache.
raCorrect | Clear current record error state. IOW, mark the record as correctly applied.
raCancel | Cancel current record changes.
raRefresh | Cancel current record changes and reread the record values from the database.

The event handler may analyze the original and current field values, by reading TField.OldValue and NewValue properties. Application may also update the current field value, set Action to raCorrect, and later call ApplyUdpates again.

Syntax
property OnReconcileError: TADReconcileErrorEvent;
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError

Example
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;
What do you think about this topic? Send feedback!


TADTable.OnUpdateError Event

TADTable.OnUpdateError Event
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Fires if an exception is generated when updates are applied to a database.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use the OnUpdateError event handler to respond to exceptions raised while applying immediate or cached updates to a database.

ASender is the dataset to which updates are applied.

AException is a pointer to a EADException object from which an application can extract an error message and the actual cause of the error condition. The OnUpdateError handler can use this information to determine how to respond to the error condition. In most cases AException object will be of class EADDBEngineException or even one of it DBMS specific subclasses.

ARow is a DatS row object, repesenting erroneous record in dataset. This record is also current record in ASender.

ARequest indicates whether the error occurred while inserting, deleting, or modifying a record.

AAction indicates the action to take when the OnUpdateError handler exits. On entry into the handler, AAction is always set to eaDefault, which leads to uaFail, if not changed. If OnUpdateError can handle or correct the error, set AAction to uaRetry before exiting the error handler. Or consider other options.

The error handler can use the OldValue and NewValue properties TField to evaluate error conditions and set NewValue to a new value to reapply. In this case, set AAction to uaRetry before exiting.

The code in an OnUpdateError handler must not call any methods that make a different record the current one !

Syntax
property OnUpdateError: TADUpdateErrorEvent;
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord

Example
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;
What do you think about this topic? Send feedback!


TADTable.OnUpdateRecord Event

TADTable.OnUpdateRecord Event
TADTable Class TADTable Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Occurs when record update is applying to a database.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use an OnUpdateRecord event handler to process immediate or cached updates that cannot be correctly or easily handled:

  • using FireDAC automatic SQL update command generation;
  • by a single table adapter component;
  • by a single update component.

This event is useful for applications that require:

  • additional control over parameters and macros substitution in update components;
  • multi SQL statement updates, when DBMS does not support batches or blocks;
  • non-SQL updates posting;
  • etc

ASender is the dataset to which updates are applied.

ARequest indicates whether the current update is the insertion, deletion or modification of a record.

AAction indicates the action taken by the OnUpdateRecord handler before it exits. On entry into the handler, AAction is always set to eaDefault. If OnUpdateRecord is successful, it should set AAction to eaApplied before exiting.

AAction value | Description
eaFail | Mark the update as failed and return an error.
eaSkip | Skip current update and do not mark it as applied.
eaRetry | Retry the current operation.
eaApplied | Mark current update as applied.
eaDefault | Take default action. For successful update it is eaApplied, for failed update it is eaFail.
eaExitSuccess | Stop to process the cached updates, return success.
eaExitFailure | Stop to process the cached updates, return failure.

The OnUpdateRecord event handler code should read the dataset field values, including TField.NewValue, OldValue and CurValue. There:

  • NewValue is the new field value before posting updates.
  • OldValue is the original field value, as it was after record fetching or after last updates applying.
  • CurValue is the current field value, the same as Value property.

Note, the OnUpdateRecord handler code must not call the methods that change the current dataset position.

Syntax
property OnUpdateRecord: TADUpdateRecordEvent;
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError

Example 1
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;
Example 2

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main
What do you think about this topic? Send feedback!


TADTable.ResourceOptions Property

TADTable.ResourceOptions Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

The set of options to control resources usage.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The ResourceOptions property is the set of properties, controlling the resources usage by the dataset. These properties will inherit its values from ResourceOptions of connection object.

Syntax
property ResourceOptions: TADBottomResourceOptions;
See Also

Setting Options, TADBottomResourceOptions

What do you think about this topic? Send feedback!


TADTable.SchemaAdapter Property

TADTable.SchemaAdapter Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

Use SchemaAdapter property to set a reference to the TADSchemaAdapter object to enable Centralized Cashed Updates mode. The schema adapter object will be used as a central change log share by few datasets.

To enable propagation of master dataset changes to a detail dataset set FetchOptions.DetailCascade to True for a detail dataset. Also both master and detail datasets must point to the same TADSchemaAdapter object.

Syntax
property SchemaAdapter: TADCustomSchemaAdapter;
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade

Example
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;
What do you think about this topic? Send feedback!


TADTable.SchemaName Property

TADTable.SchemaName Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Limits the table names to the schema.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

Specify the SchemaName property value to limit the set of schemas to the single value.

Syntax
property SchemaName: String;
See Also

Object Names, CatalogName, TableName

What do you think about this topic? Send feedback!


TADTable.TableName Property

TADTable.TableName Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Gets / sets table name to open.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The TableName property value together with CatalogName and SchemaName forms the full table name. FireDAC will build SELECT statement to fetch data from specified table.

Syntax
property TableName: String;
See Also

Browsing Table, Object Names, CatalogName, SchemaName

What do you think about this topic? Send feedback!


TADTable.Transaction Property

TADTable.Transaction Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

Gets / sets reference to transaction object.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The Transaction property allows to associate dataset with explicit transaction object. If it is not specified, then dataset will be associated with connection default transaction.

The specified transaction object will be used only for Prepare, Open, ExecSQL, ExecProc, Execute methods. For commands, generated to apply changes to database, FireDAC will use UpdateTransaction, if it is specified, otherwise - Transaction.

Currently explicit transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property Transaction: TADCustomTransaction;
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction

What do you think about this topic? Send feedback!


TADTable.UpdateObject Property

TADTable.UpdateObject Property
TADTable Class TADTable Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Specifies the update object component used to post updates by dataset.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Use UpdateObject to specify the TADUpdateSQL component to use in an application that must be able to post updates in a non-standard way.

The FireDAC has build in updates command generator, which using multiple information sources is able to generate SQL update commands for most of scenarios. In some cases, such as a query made against multiple tables, which may require multi-statement update, FireDAC cannot generate SQL update commands. In these cases, UpdateObject can be used to specify a TADUpdateSQL component that allows to specify custom SQL commands for each update posting case, like a insert / update / delete.

As alternative to update object usage, you can consider to use OnUpdateRecord event. It gives more options, but requires manual coding of posting updates. Also, in OnUpdateRecord handler you can use multiple update objects. See demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.

Syntax
property UpdateObject: TADCustomUpdateObject;
See Also

OnUpdateRecord, TADUpdateSQL

Example 1
ADUpdateSQL1.InsertSQL.Text := 'insert into mytab values (:new_id, :new_name)';
ADQuery1.UpdateObject := ADUpdateSQL1;
ADQuery1.Append;
ADQuery1['id'] := 100;
ADQuery1['name'] := 'qwe';
ADQuery1.Post;
Example 2

Demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.

What do you think about this topic? Send feedback!


TADTable.UpdateOptions Property

TADTable.UpdateOptions Property
TADTable Class TADTable Members uADCompClient Namespace published See Also Send Feedback

The set of options to control updates posting.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, published, See Also
Description

The UpdateOptions property is the set of properties, controlling the posting updates from the dataset. These properties will inherit its values from UpdateOptions of connection object.

Syntax
property UpdateOptions: TADBottomUpdateOptions;
See Also

Setting Options, TADBottomUpdateOptions

What do you think about this topic? Send feedback!


TADTable.UpdateTransaction Property

TADTable.UpdateTransaction Property
TADTable Class TADTable Members uADCompClient Namespace Example published See Also Send Feedback

Gets / sets reference to transaction object.

Group

published

Links
TADTable Class, TADTable Members, uADCompClient Namespace, Example, published, See Also
Description

The UpdateTransaction property allows to associate dataset internal update commands with explicit transaction object. If it is not specified, then dataset update commands will be associated with connection default update transaction. If it is not specified, then - with dataset Transaction.

For Prepare, Open, ExecSQL, ExecProc, Execute methods will be used Transaction objects.

Currently explicit update transaction object assignment is supported only for Interbase / Firebird servers.

Syntax
property UpdateTransaction: TADCustomTransaction;
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction

Example
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction
What do you think about this topic? Send feedback!


TADTransaction Class

TADTransaction Class
published TADTransaction Members Classes See Also Send Feedback

The class is responsible for connection transaction management.

Group

Classes

Class Hierarchy
  uADCompClient_TADTransactionuADCompClient_TADTransaction
File

uADCompClient

Links
published, TADTransaction Members, Classes, See Also
Description

Use TADTransaction to manage transactions in a connection to a DBMS.

The component, at first, is target to Interbase / Firebird client application developers.

Syntax
TADTransaction = class(TADCustomTransaction);
See Also

Managing Transactions, TADCustomTransaction, TADCustomConnection

What do you think about this topic? Send feedback!


TADTransaction Members

TADTransaction Members
Events TADTransaction Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADTransaction.

Events
Event | Description
AfterCommit | Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
Class

TADTransaction Class

Methods
Method | Description
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.
Properties
Property | Description
Active | Indicates whether a database transaction is in progress or not.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
DataSetCount | Returns the number of datasets associated with this transaction.
DataSets | Returns the dataset associated with this transaction by it index.
Options | The set of options controlling transactions behaviour.
TransactionIntf | Returns IADPhysTransaction interface.
Links
Events, TADTransaction Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
Events TADTransaction Class Legend Properties Send Feedback

The published members of the TADTransaction class are listed here.

Events
Event | Description
AfterCommit | Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
Class

TADTransaction Class

Properties
Property | Description
Connection | Specifies the connection component that actually forms the connection to the DBMS.
Options | The set of options controlling transactions behaviour.
Links
Events, TADTransaction Class, Legend, Properties
What do you think about this topic? Send feedback!


TADTransaction.AfterCommit Event

TADTransaction.AfterCommit Event
TADTransaction Class TADTransaction Members uADCompClient Namespace published See Also Send Feedback

Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.

Group

published

Links
TADTransaction Class, TADTransaction Members, uADCompClient Namespace, published, See Also
Syntax
property AfterCommit: TNotifyEvent;
See Also

BeforeCommit

What do you think about this topic? Send feedback!


TADTransaction.AfterRollback Event

TADTransaction.AfterRollback Event
TADTransaction Class TADTransaction Members uADCompClient Namespace published See Also Send Feedback

Fires after transaction is rolled back.

Group

published

Links
TADTransaction Class, TADTransaction Members, uADCompClient Namespace, published, See Also
Description

The AfterRollback event fires after the Rollback method is executed and the transaction is rolled back. In case of a nested transaction in AfterRollback event handler the transaction is not yet rolled back in full, but nesting level is decremented.

Syntax
property AfterRollback: TNotifyEvent;
See Also

BeforeRollback

What do you think about this topic? Send feedback!


TADTransaction.AfterStartTransaction Event

TADTransaction.AfterStartTransaction Event
TADTransaction Class TADTransaction Members uADCompClient Namespace published See Also Send Feedback

Fires after transaction is started.

Group

published

Links
TADTransaction Class, TADTransaction Members, uADCompClient Namespace, published, See Also
Description

The AfterStartTransaction event fires after the StartTransaction method is executed and the transaction is started. In case of a nested transaction in AfterStartTransaction event handler the transaction is not just started, but nesting level is incremented.

Syntax
property AfterStartTransaction: TNotifyEvent;
See Also

BeforeStartTransaction

What do you think about this topic? Send feedback!


TADTransaction.BeforeCommit Event

TADTransaction.BeforeCommit Event
TADTransaction Class TADTransaction Members uADCompClient Namespace published See Also Send Feedback

Fires before transaction will be committed.

Group

published

Links
TADTransaction Class, TADTransaction Members, uADCompClient Namespace, published, See Also
Description

The BeforeCommit event fires before the Commit method will be executed and the transaction will be committed.

Syntax
property BeforeCommit: TNotifyEvent;
See Also

AfterCommit

What do you think about this topic? Send feedback!


TADTransaction.BeforeRollback Event

TADTransaction.BeforeRollback Event
TADTransaction Class TADTransaction Members uADCompClient Namespace published See Also Send Feedback

Fires before transaction will be rolled back.

Group

published

Links
TADTransaction Class, TADTransaction Members, uADCompClient Namespace, published, See Also
Description

The BeforeRollback event fires before the Rollback method will be executed and the transaction will be rolled back.

Syntax
property BeforeRollback: TNotifyEvent;
See Also

AfterRollback

What do you think about this topic? Send feedback!


TADTransaction.BeforeStartTransaction Event

TADTransaction.BeforeStartTransaction Event
TADTransaction Class TADTransaction Members uADCompClient Namespace published See Also Send Feedback

Fires before transaction will be started.

Group

published

Links
TADTransaction Class, TADTransaction Members, uADCompClient Namespace, published, See Also
Description

The BeforeStartTransaction event fires before the StartTransaction method will be executed and the transaction will be started.

Syntax
property BeforeStartTransaction: TNotifyEvent;
See Also

AfterStartTransaction

What do you think about this topic? Send feedback!


TADTransaction.Connection Property

TADTransaction.Connection Property
TADTransaction Class TADTransaction Members uADCompClient Namespace published See Also Send Feedback

Specifies the connection component that actually forms the connection to the DBMS.

Group

published

Links
TADTransaction Class, TADTransaction Members, uADCompClient Namespace, published, See Also
Description

Set Connection to the connection component that establishes a connection to the DBMS. If to change Connection property value, while transaction is active, an exception will be raised.

Syntax
property Connection: TADCustomConnection;
See Also

Active

What do you think about this topic? Send feedback!


TADTransaction.Options Property

TADTransaction.Options Property
TADTransaction Class TADTransaction Members uADCompClient Namespace Example published See Also Send Feedback

The set of options controlling transactions behaviour.

Group

published

Links
TADTransaction Class, TADTransaction Members, uADCompClient Namespace, Example, published, See Also
Description

The Options property returns reference to object, consisting of the set of options, controlling transactions behavior. Changing options will not take immediate effect, it is deferred until first transaction control statement.

Syntax
property Options: TADTxOptions;
See Also

StartTransaction, Commit, Rollback

Example
ADTransaction1.Options.ReadOnly := True;
ADTransaction1.StartTransaction;
What do you think about this topic? Send feedback!


TADUpdateSQL Class

TADUpdateSQL Class
public published TADUpdateSQL Members Classes See Also Send Feedback

TADUpdateSQL applies updates on behalf of queries or stored procedures that can't post updates directly.

Group

Classes

Class Hierarchy
  uADCompClient_TADUpdateSQLuADCompClient_TADUpdateSQL
File

uADCompClient

Links
public, published, TADUpdateSQL Members, Classes, See Also
Description

Use a TADUpdateSQL object to provide SQL statements used to post updates from TADQuery, TADStoredProc or TADTable components.

The TADUpdateSQL allows to override the SQL update commands automatically generated by the datasets, but not to execute the SQL commands and not to post changes to a DB. The usage of TADUpdateSQL is optional in case of TADQuery and TADTable. Because they are capable to automatically generate the SQL commands to post updates from a dataset to a DB. And the usage is mandatory for TADStoredProc.

To specify SQL commands at design-time use the TADUpdateSQL design-time editor, by double clicking a component. To specify SQL commands at run-time use the ModifySQL, InsertSQL, DeleteSQL and other properties. To specify additional parameter or macro values for specific update SQL use the Commands property.

Syntax
TADUpdateSQL = class(TADCustomUpdateObject);
See Also

Overriding Posting Updates, TADQuery, TADStoredProc, TADTable, TADCustomUpdateObject, TADAdaptedDataSet.UpdateObject

What do you think about this topic? Send feedback!


TADUpdateSQL Members

TADUpdateSQL Members
TADUpdateSQL Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADUpdateSQL.

Class

TADUpdateSQL Class

Methods
Method | Description
Apply | Applies record update request to DB for current record in DataSet.
Properties
Property | Description
Commands | Returns reference to internal command object, that will handle update request.
Connection | Gets / sets the connection object.
ConnectionName | Gets / sets the connection name.
DataSet | Identifies the dataset on which change log update object will operate.
DeleteSQL | Specifies a SQL statement to use when applying a deletion of a record.
FetchRowSQL | Specifies a SQL statement to use to refetch a single record.
InsertSQL | Specifies a SQL statement to use when applying an insertion of a record.
LockSQL | Specifies the SQL statement to use when locking a record.
ModifySQL | Specifies the SQL statement to use when applying an update of a record.
SQL | Gets / sets a specified SQL statement used when applying updates to DB.
UnlockSQL | Specifies the SQL statement to use when unlocking a record.
Links
TADUpdateSQL Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADUpdateSQL Class Legend Methods Properties Send Feedback

The public members of the TADUpdateSQL class are listed here.

Class

TADUpdateSQL Class

Methods
Method | Description
Apply | Applies record update request to DB for current record in DataSet.
Properties
Property | Description
Commands | Returns reference to internal command object, that will handle update request.
SQL | Gets / sets a specified SQL statement used when applying updates to DB.
Links
TADUpdateSQL Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADUpdateSQL.Commands Property

TADUpdateSQL.Commands Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace Example public See Also Send Feedback

Returns reference to internal command object, that will handle update request.

Group

public

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, Example, public, See Also
Description

The Commands indexed property returns a reference to the internal TADCustomCommand objects, that will handle the update requests, specified by the ARequest index. Use this reference to setup the command properties not accessible through the TADUpdateSQL interface. For example, Params or Macros.

Syntax
property Commands [ARequest: TADUpdateRequest]: TADCustomCommand;
See Also

TADCustomCommand, TADCustomCommand.Params, TADCustomCommand.Macros, SQL

Example
ADUpdateSQL1.InsertSQL := 'insert into !tab (workstation_time, id, name) values (:workstation_time, :new_id, :new_name)';
ADUpdateSQL1.Commands[arInsert].ParamByName('workstation_time').AsDateTime := Now();
ADUpdateSQL1.Commands[arInsert].MacroByName('tab').AsRaw := 'mytab';
What do you think about this topic? Send feedback!


TADUpdateSQL.SQL Property

TADUpdateSQL.SQL Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace public See Also Send Feedback

Gets / sets a specified SQL statement used when applying updates to DB.

Group

public

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, public, See Also
Description

Returns the SQL statement in the one of XxxSQL properties, depending on the setting of the ARequest index.

Syntax
property SQL [ARequest: TADUpdateRequest]: TStrings;
See Also

Commands, InsertSQL, ModifySQL, DeleteSQL, LockSQL, UnlockSQL, FetchRowSQL

What do you think about this topic? Send feedback!


TADUpdateSQL.Apply Method

TADUpdateSQL.Apply Method
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace Example 1 Example 2 public See Also Send Feedback

Applies record update request to DB for current record in DataSet.

Group

public

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
ARequest: TADUpdateRequest | A record update request.
var AAction: TADErrorAction | A completion status.
AOptions: TADUpdateRowOptions | An additional request options.
Description

Call Apply to apply changes of current DataSet record to database.

Standard implementation - TADUpdateSQL - sets parameters for a SQL statement and executes it to update a record. ARequest indicates the update kind, so for TADUpdateSQL specifies which SQL statement to execute. If appropriate SQL statement is not specified, then FireDAC will generate default one, as it is doing when TADAdaptedDataSet.UpdateObject is not specified.

Apply is primarily intended for manually executing update statements from an OnUpdateRecord event handler. There event handler ARequest, AAction and AOptions argument values must be assigned to Apply method corresponding arguments.

ARequest can be one of the following values:

Value | Meaning | TADUpdateSQL SQL property
arInsert | Insert record to database. | InsertSQL
arUpdate | Update record in database. | ModifySQL
arDelete | Delete record from database. | DeleteSQL
arLock | Lock record in database. | LockSQL
arUnlock | Release record lock in database. | UnlockSQL
arFetchRow | Refetch record from database. | FetchRowSQL
arUpdateHBlobs | Update Oracle BLOB/CLOB values in database. | -
arFetchGenerators | Fetch generator values to put into record. | -

AAction returns Apply method completion status, specifying what action should take the calling code. Normally this status is used by FireDAC code. When Apply method is called from OnUpdateRecord event handler, then assign AAction event handler argument to the AAction Apply method argument. Otherwise use eaDefault as initial value.

AOptions specifies additional options. When Apply method is called from OnUpdateRecord event handler, then assign AOptions event handler argument to the AOptions Apply method argument. Otherwise use [] as a value.

Syntax
procedure Apply(ARequest: TADUpdateRequest; var AAction: TADErrorAction; AOptions: TADUpdateRowOptions); override;
See Also

Overriding Posting Updates, TADUpdateSQL, TADAdaptedDataSet.UpdateObject

Example 1
procedure TfrmCachedUpdates.qrProductsUpdateRecord(ASender: TDataSet;
  ARequest: TADUpdateRequest; var AAction: TADErrorAction;
  AOptions: TADUpdateRowOptions);
begin
  usProducts.ConnectionName := qrProducts.ConnectionName;
  usProducts.DataSet := qrProducts;
  usProducts.Apply(ARequest, AAction, AOptions);

  usCategories.ConnectionName := qrProducts.ConnectionName;
  usCategories.DataSet := qrProducts;
  usCategories.Apply(ARequest, AAction, AOptions);

  AAction := eaApplied;
end;
Example 2

See FireDAC\Samples\Comp Layer\TADUpdateSQL\Main demo application.

What do you think about this topic? Send feedback!


published

published
TADUpdateSQL Class Legend Properties Send Feedback

The published members of the TADUpdateSQL class are listed here.

Class

TADUpdateSQL Class

Properties
Property | Description
Connection | Gets / sets the connection object.
ConnectionName | Gets / sets the connection name.
DeleteSQL | Specifies a SQL statement to use when applying a deletion of a record.
FetchRowSQL | Specifies a SQL statement to use to refetch a single record.
InsertSQL | Specifies a SQL statement to use when applying an insertion of a record.
LockSQL | Specifies the SQL statement to use when locking a record.
ModifySQL | Specifies the SQL statement to use when applying an update of a record.
UnlockSQL | Specifies the SQL statement to use when unlocking a record.
Links
TADUpdateSQL Class, Legend, Properties
What do you think about this topic? Send feedback!


TADUpdateSQL.Connection Property

TADUpdateSQL.Connection Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace published See Also Send Feedback

Gets / sets the connection object.

Group

published

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, published, See Also
Description

The Connection property value points to the connection object, which will be assigned to all internal update commands. If the connection is the same as used by DataSet, then leave Connection property empty.

Alternatively may be specified the ConnectionName property value.

Syntax
property Connection: TADCustomConnection;
See Also

ConnectionName, Commands

What do you think about this topic? Send feedback!


TADUpdateSQL.ConnectionName Property

TADUpdateSQL.ConnectionName Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace published See Also Send Feedback

Gets / sets the connection name.

Group

published

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, published, See Also
Description

The ConnectionName property value is the name of a connection, which will be used by all internal update commands. If the connection name is the same as used by DataSet, then leave ConnectionName property empty.

Alternatively may be specified the Connection property value.

Syntax
property ConnectionName: String;
See Also

Connection, Commands

What do you think about this topic? Send feedback!


TADUpdateSQL.DeleteSQL Property

TADUpdateSQL.DeleteSQL Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace Example published See Also Send Feedback

Specifies a SQL statement to use when applying a deletion of a record.

Group

published

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, Example, published, See Also
Description

Set DeleteSQL to a SQL statement to use when applying a record deletion to a database.

To submit to a command a dataset original field value, use the :OLD_<field name> parameter name. Statements can use additional parameters and macros. To get access to the parameters or macros collection use Commands property.

To create a DELETE statement at design time, use the UpdateSQL editor to create statements. For that double click on TADUpdateSQL component. Also, you can use stored procedure call or other SQL command to apply deletion.

See the Commands property for details of how to use macros or additional parameters in the command text.

Syntax
property DeleteSQL: TStrings;
See Also

Commands, InsertSQL, ModifySQL, LockSQL, UnlockSQL, FetchRowSQL

Example
ADUpdateSQL1.DeleteSQL := 'DELETE FROM ADDEMO."Shippers" WHERE SHIPPERID = :OLD_SHIPPERID';
What do you think about this topic? Send feedback!


TADUpdateSQL.FetchRowSQL Property

TADUpdateSQL.FetchRowSQL Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace Example published See Also Send Feedback

Specifies a SQL statement to use to refetch a single record.

Group

published

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, Example, published, See Also
Description

Set FetchRowSQL to a SQL statement to use when refetching single record from a database.

To submit a dataset original field value, use the :OLD_<field name> parameter name. Statement can use additional parameters and macros. To get access to the parameters or macros collection use Commands property.

If statement returns record field values using parameters, then use the :NEW_<field name> or :<field name> parameter name and set parameter type to ptInputOutput / ptOutput. If statement produces a result set, then it fields must have the same names as the dataset fields.

If UpdateOptions.RefreshMode is rmAll, then FetchRowSQL command will be executed automatically after posting a new record or changes to existing one to a database. In this case WHERE phrase must use :NEW_<field name> parameter names.

To create a SELECT statement at design time, use the UpdateSQL editor to create statements. For that double click on TADUpdateSQL component. Also, you can use stored procedure call or other SQL command to apply record fetching.

See the Commands property for details of how to use macros or additional parameters in the command text.

Syntax
property FetchRowSQL: TStrings;
See Also

Commands, InsertSQL, ModifySQL, LockSQL, UnlockSQL, DeleteSQL, TADUpdateOptions.RefreshMode

Example
ADUpdateSQL1.FetchRowSQL := 'SELECT SHIPPERID, COMPANYNAME, PHONE FROM ADDEMO."Shippers" ' +
  'WHERE SHIPPERID = :OLD_SHIPPERID';
What do you think about this topic? Send feedback!


TADUpdateSQL.InsertSQL Property

TADUpdateSQL.InsertSQL Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace Example 1 Example 2 published See Also Send Feedback

Specifies a SQL statement to use when applying an insertion of a record.

Group

published

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, Example 1, Example 2, published, See Also
Description

Set InsertSQL to a SQL statement to use when applying a record insertion to a database.

To submit to a command a new field value, use the :NEW_<field name> or :<field name> parameter name.Statements can use additional parameters and macros. To get access to the parameters or macros collection use Commands property.

If statement fetches new record field values (identity or modified in trigger) using parameters, then to put parameter values into record, use the :NEW_<field name> or :<field name> parameter name and set parameter types to ptOuput. If statement will produce recordset, then it fields must have the same names as in dataset.

To create an INSERT statement at design time, use the UpdateSQL editor to create statements. For that double click on TADUpdateSQL component. Also, you can use stored procedure call or other SQL command to apply insertion.

See the Commands property for details of how to use macros or additional parameters in the command text.

Syntax
property InsertSQL: TStrings;
See Also

Commands, ModifySQL, DeleteSQL, LockSQL, UnlockSQL, FetchRowSQL

Example 1
// SQL Server sample
ADUpdateSQL1.InsertSQL := 'INSERT INTO [Shippers] (COMPANYNAME, PHONE) ' +
  'VALUES (:NEW_COMPANYNAME, :NEW_PHONE); SELECT SCOPE_IDENTITY() AS SHIPPERID';
Example 2
// Oracle sample
ADUpdateSQL1.InsertSQL := 'INSERT INTO ADDEMO."Shippers" (COMPANYNAME, PHONE) ' +
  'VALUES (:NEW_COMPANYNAME, :NEW_PHONE) RETURNING SHIPPERID INTO :NEW_SHIPPERID';
ADUpdateSQL1.Commands[arInsert].ParamByName('NEW_SHIPPERID').ParamType := ptOutput;
What do you think about this topic? Send feedback!


TADUpdateSQL.LockSQL Property

TADUpdateSQL.LockSQL Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace published See Also Send Feedback

Specifies the SQL statement to use when locking a record.

Group

published

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, published, See Also
Description

Set LockSQL to the SQL statement to use when locking single record in a database. Library uses the statement if UpdateOptions.LockMode is pessimistic or optimistic.

To submit to a command a dataset original field value, use the :OLD_<field name> parameter name. Statements can use additional parameters and macros. To get access to the parameters or macros collection use Commands property.

To create a SELECT [FOR UPDATE] statement at design time, use the UpdateSQL editor to create statements. For that double click on TADUpdateSQL component. Also, you can use stored procedure call or other SQL command to lock record.

See the Commands property for details of how to use macros or additional parameters in the command text.

Syntax
property LockSQL: TStrings;
See Also

Commands, ModifySQL, DeleteSQL, InsertSQL, UnlockSQL, FetchRowSQL

What do you think about this topic? Send feedback!


TADUpdateSQL.ModifySQL Property

TADUpdateSQL.ModifySQL Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace Example published See Also Send Feedback

Specifies the SQL statement to use when applying an update of a record.

Group

published

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, Example, published, See Also
Description

Set UpdateSQL to the SQL statement to use when applying a record modification to a database.

To submit to a command a dataset original field value, use the :OLD_<field name> parameter name. To submit to a command a new field value, use the :NEW_<field name> or :<field name> parameter name. Statement can use additional parameters and macros. To get access to the parameters or macros collection use Commands property.

If statement fetches new record field values (identity or modified in trigger) using parameters, then to put parameter values into record, use the :NEW_<field name> or :<field name> parameter name and set parameter types to ptOuput. If statement produces result set, then it fields must have the same names as a dataset fields.

To create an UPDATE statement at design time, use the UpdateSQL editor to create statements. For that double click on TADUpdateSQL component. Also, you can use stored procedure call or other SQL command to apply modification.

See the Commands property for details of how to use macros or additional parameters in the command text.

Syntax
property ModifySQL: TStrings;
See Also

Commands, InsertSQL, DeleteSQL, LockSQL, UnlockSQL, FetchRowSQL

Example
ADUpdateSQL1.InsertSQL := 'UPDATE ADDEMO."Shippers" SET SHIPPERID = :NEW_SHIPPERID, ' +
  'COMPANYNAME = :NEW_COMPANYNAME, PHONE = :NEW_PHONE WHERE SHIPPERID = :OLD_SHIPPERID';
What do you think about this topic? Send feedback!


TADUpdateSQL.UnlockSQL Property

TADUpdateSQL.UnlockSQL Property
TADUpdateSQL Class TADUpdateSQL Members uADCompClient Namespace published See Also Send Feedback

Specifies the SQL statement to use when unlocking a record.

Group

published

Links
TADUpdateSQL Class, TADUpdateSQL Members, uADCompClient Namespace, published, See Also
Description

Set UnlockSQL to the SQL statement to use when unlocking single record in a database. Library uses the statement if UpdateOptions.LockMode is pessimistic or optimistic.

To submit to a command a dataset original field value, use the :OLD_<field name> parameter name. Statement can use additional parameters and macros. To get access to the parameters or macros collection use Commands property.

Most DBMS's unlock record after finishing transaction. So, FireDAC does not generate any SQL statement for record unlocking by default.

See the Commands property for details of how to use macros or additional parameters in the command text.

Syntax
property UnlockSQL: TStrings;
See Also

Commands, ModifySQL, DeleteSQL, InsertSQL, LockSQL, FetchRowSQL

What do you think about this topic? Send feedback!


Functions

Functions
Functions uADCompClient Namespace Legend Send Feedback

The following table lists functions in this documentation.

Functions
Function | Description
ADManager | Function returns reference to global TADCustomManager object.
ADSetConnectionClass | Sets the TADCustomConnection descendant class.
ADSetManagerClass | Set the TADCustomManager descendant class.
Namespace

uADCompClient Namespace

Links
Functions, uADCompClient Namespace, Legend
What do you think about this topic? Send feedback!


uADCompClient.ADManager Function

uADCompClient.ADManager Function
Example Functions See Also Send Feedback

Function returns reference to global TADCustomManager object.

Group

Functions

File

uADCompClient

Links
Example, Functions, See Also
Returns

TADCustomManager instance.

Description

The ADManager function returns reference to singleton object, representing default instance of TADCustomManager.

Syntax
function ADManager: TADCustomManager;
See Also

Multi Threading, TADCustomManager

Example
var
  oList: TStringList;
......
  oList := TStringList.Create;
  oList.Add('Server=127.0.0.1');
  oList.Add('Database=addemo');
  ADManager.AddConnectionDef('myconn', 'MySQL', oList);
What do you think about this topic? Send feedback!


uADCompClient.ADSetConnectionClass Function

uADCompClient.ADSetConnectionClass Function
Example Functions See Also Send Feedback

Sets the TADCustomConnection descendant class.

Group

Functions

File

uADCompClient

Links
Example, Functions, See Also
Parameters
Parameters | Description
AClass: TADCustomConnectionClass | The class reference.
Description

Sets the TADCustomConnection descendant class, that FireDAC will use to create internally managed connection objects.

Syntax
procedure ADSetConnectionClass(AClass: TADCustomConnectionClass);
See Also

TADCustomConnection, TADCustomConnection.ConnectionName

Example
ADSetConnectionClass(TMyConnection);
What do you think about this topic? Send feedback!


uADCompClient.ADSetManagerClass Function

uADCompClient.ADSetManagerClass Function
Example Functions See Also Send Feedback

Set the TADCustomManager descendant class.

Group

Functions

File

uADCompClient

Links
Example, Functions, See Also
Parameters
Parameters | Description
AClass: TADCustomManagerClass | The class reference.
Description

Sets the TADCustomManager descendant class, that FireDAC will use to create internally managed manager object.

Syntax
procedure ADSetManagerClass(AClass: TADCustomManagerClass);
See Also

TADCustomManager, ADManager

Example
ADSetManagerClass(TMyManager);
What do you think about this topic? Send feedback!


uADCompDataSet Namespace

uADCompDataSet Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains TADDataSet base dataset class and additional utility methods and classes.

Classes
Class | Description
TADAggregate | TADAggregate represents a maintained client aggregate value in an FireDAC dataset.
TADAggregates | TADAggregates is a collection of TADAggregate objects.
TADAutoIncField | TADAutoIncField represents integer auto incremental field in an FireDAC dataset.
TADBlobStream | TADBlobStream is a stream object giving access to BLOB / Memo fields.
TADDataSet | The TADDataSet is a direct TDataSet descendant, introducing base functionality for all FireDAC datasets.
TADIndex | TADIndex represents a maintained client view to records in an FireDAC dataset.
TADIndexes | TADIndexes is a collection of TADIndex objects.
TADMasterDataLink | TADMasterDataLink controlls master-detail link between two datasets.
TADSQLTimeIntervalField | TADSQLTimeIntervalField represents a time interval field in a dataset.
TADWideMemoField | TADWideMemoField represents a Unicode encoded memo field in a dataset.
TADXMLField | TADXMLField represents a Unicode encoded XML data field in a dataset.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADCompDataSet unit contains:

  • TADDataSet - base class for all FireDAC datasets;
  • TADIndex, TADIndexes - dataset view classes;
  • TADAggregate, TADAggregates - aggregate value classes;
  • TADWideMemoField - Unicode memo field;
  • TADAutoIncField - autoincremental field;
  • TADBlobStream - BLOB stream.
See Also

uADCompClient, uADCompScript

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADCompDataSet Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADAggregate | TADAggregate represents a maintained client aggregate value in an FireDAC dataset.
TADAggregates | TADAggregates is a collection of TADAggregate objects.
TADAutoIncField | TADAutoIncField represents integer auto incremental field in an FireDAC dataset.
TADBlobStream | TADBlobStream is a stream object giving access to BLOB / Memo fields.
TADDataSet | The TADDataSet is a direct TDataSet descendant, introducing base functionality for all FireDAC datasets.
TADIndex | TADIndex represents a maintained client view to records in an FireDAC dataset.
TADIndexes | TADIndexes is a collection of TADIndex objects.
TADMasterDataLink | TADMasterDataLink controlls master-detail link between two datasets.
TADSQLTimeIntervalField | TADSQLTimeIntervalField represents a time interval field in a dataset.
TADWideMemoField | TADWideMemoField represents a Unicode encoded memo field in a dataset.
TADXMLField | TADXMLField represents a Unicode encoded XML data field in a dataset.
Namespace

uADCompDataSet Namespace

Links
Classes, uADCompDataSet Namespace, Legend
What do you think about this topic? Send feedback!


TADAggregate Class

TADAggregate Class
public published TADAggregate Members Example 1 Example 2 Classes See Also Send Feedback

TADAggregate represents a maintained client aggregate value in an FireDAC dataset.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADAggregate
File

uADCompDataSet

Links
public, published, TADAggregate Members, Example 1, Example 2, Classes, See Also
Description

Use TADAggregate to create and maintain calculated client aggreated value.

TADAggregate are collected into TADAggregates collection. The set of TADAggregate may be created as at design time, as at run time.

Expression property specifies the formula. GroupingLevel defines the set of records on which value will be calculated. The value will be calculated if Active is True and TADDataSet.AggregatesActive is True.

If you want to display aggregated value using data-aware controls, then use TAggregatedField instead of TADAggregate.

Syntax
TADAggregate = class(TCollectionItem);
See Also

Calculated and Aggregated Fields, TAggregatedField, TADAggregates, TADDataSet, TADDataSet.Aggregates, TADDataSet.AggregatesActive

Example 1
ADQuery1.AggregatesActive := True;
ADQuery1.Open;

with ADQuery1.Aggregates.Add do begin
  Name := 'AvgSalary';
  Expression := 'Avg(Salary)';
  Active := True;

  if InUse then
    Label1.Caption := VarToStr(Value)
  else
    Label1.Caption := '<not accessible>';
end;
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.

What do you think about this topic? Send feedback!


TADAggregate Members

TADAggregate Members
TADAggregate Class Legend Properties Send Feedback

The following tables list the members exposed by TADAggregate.

Class

TADAggregate Class

Properties
Property | Description
Active | Controls when aggregated value must be calculated.
ActualActive | Returns True, if aggregated value is really calculated.
DataSet | Returns the reference to containing dataset.
DataType | Returns the data type of aggregated value.
Expression | Specifies the expression to be calculated.
GroupingLevel | Specifies the set of records in the group.
IndexName | Specifies the index name, for which aggregated value applies.
InUse | Indicates whether the aggregate value is currently available.
Name | Specifies the name of an aggregated value.
Value | Returns the calculated value of the aggregate expression.
Links
TADAggregate Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADAggregate Class Legend Properties Send Feedback

The public members of the TADAggregate class are listed here.

Class

TADAggregate Class

Properties
Property | Description
ActualActive | Returns True, if aggregated value is really calculated.
DataSet | Returns the reference to containing dataset.
DataType | Returns the data type of aggregated value.
InUse | Indicates whether the aggregate value is currently available.
Value | Returns the calculated value of the aggregate expression.
Links
TADAggregate Class, Legend, Properties
What do you think about this topic? Send feedback!


TADAggregate.ActualActive Property

TADAggregate.ActualActive Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace public See Also Send Feedback

Returns True, if aggregated value is really calculated.

Group

public

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, public, See Also
Description

Use ActualActive to see if FireDAC is maintaining this aggregated value. In general, the value is maintained if:

  • Expression is not empty;
  • Active is True;
  • dataset is active;
  • dataset AggregatesActive is True;
  • IndexName is empty or current dataset index has IndexName name;

Use InUse property to detect is aggregated value accessable or not.

Syntax
property ActualActive: Boolean;
See Also

Active, Expression, InUse, TADDataSet.AggregatesActive

What do you think about this topic? Send feedback!


TADAggregate.DataSet Property

TADAggregate.DataSet Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace public See Also Send Feedback

Returns the reference to containing dataset.

Group

public

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, public, See Also
Description

Use the DataSet property to get reference to dataset, containing this aggregated value.

Syntax
property DataSet: TADDataSet;
See Also

TADDataSet

What do you think about this topic? Send feedback!


TADAggregate.DataType Property

TADAggregate.DataType Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace public See Also Send Feedback

Returns the data type of aggregated value.

Group

public

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, public, See Also
Description

Use the DataType property to get data type of value returned by aggregated expression.

Syntax
property DataType: TADDataType;
See Also

TADDataType

What do you think about this topic? Send feedback!


TADAggregate.InUse Property

TADAggregate.InUse Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace Example public See Also Send Feedback

Indicates whether the aggregate value is currently available.

Group

public

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, Example, public, See Also
Description

Read InUse to determine whether the Value method returns an aggregated value.

When InUse is False, the value is not accessible and Value returns Null.

When InUse is True, the aggregate is maintained so that it calculates the formula specified by Expression for the current set of records, including any edits to records in the current group. The value is accessible and Value returns meaningful value.

Syntax
property InUse: Boolean;
See Also

Active, Expression, Value

Example
if ADQuery1.Aggregates[0].InUse then
  Label1.Caption := VarToStr(ADQuery1.Aggregates[0].Value)
else
  Label1.Caption := '<not accessible>';
What do you think about this topic? Send feedback!


TADAggregate.Value Property

TADAggregate.Value Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace public Send Feedback

Returns the calculated value of the aggregate expression.

Group

public

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, public
Description

Use the Value property to get the value of the aggregate expression for current dataset record.

The value is maintained if ActualActive is True and is accessible if InUse is True. The value is calculated for all records in the current group specified by GroupingLevel and is the same for all records in the group.

Syntax
property Value: Variant;
What do you think about this topic? Send feedback!


published

published
TADAggregate Class Legend Properties Send Feedback

The published members of the TADAggregate class are listed here.

Class

TADAggregate Class

Properties
Property | Description
Active | Controls when aggregated value must be calculated.
Expression | Specifies the expression to be calculated.
GroupingLevel | Specifies the set of records in the group.
IndexName | Specifies the index name, for which aggregated value applies.
Name | Specifies the name of an aggregated value.
Links
TADAggregate Class, Legend, Properties
What do you think about this topic? Send feedback!


TADAggregate.Active Property

TADAggregate.Active Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace published See Also Send Feedback

Controls when aggregated value must be calculated.

Group

published

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, published, See Also
Description

Set Active property value to True to activate aggregated value calculation. By default it is False.

All aggregated values will be calculated when TADDataSet.AggregatesActive is True.

Really, aggregated value will be calculated only when ActualActive returns True.

Syntax
property Active: Boolean;
See Also

ActualValue, TADDataSet.AggregatesActive

What do you think about this topic? Send feedback!


TADAggregate.Expression Property

TADAggregate.Expression Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace Example 1 Example 2 published See Also Send Feedback

Specifies the expression to be calculated.

Group

published

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, Example 1, Example 2, published, See Also
Description

Use the Expression property to specify a formula text. The formula must contain aggregating functions, otherwise exception will be raised. The following aggregating functions are supported:

Function | Description
SUM | Summarize the argument values.
MIN | Returns the minimal argument value.
MAX | Returns the maximal argument value.
AVG | Computes the average value of argument, which is the total of all values, divided by the count of all not-NULL values.
COUNT | Returns the count of all not-NULL argument values, if argument is specified. Otherwise the count of all records.
TFIRST | Returns the first argument value.
TLAST | Returns the last argument value.

The aggregating functions operates on field values or on expressions built from field values, constants and scalar function calls, using the standard FireDAC expression syntax. But few restrictions are applied:

  • You can create expressions by using operators on aggregated values with other aggregated values or constants.
  • You can't combine aggregated values with field values, because such expressions are ambiguous - there is no indication of which record should supply the field value.
  • You can't nest aggregating functions.

The expression will be automatically evaluated by FireDAC and the result will be assigned to the Value property. All calculations are performed for current group of the records. Use GroupingLevel to specify grouping.

Syntax
property Expression: String;
See Also

GroupingLevel, Value

Example 1
// count number of records with Discount > 0
ADQuery1.Aggregates[0].Expression := 'COUNT(IIF(Discount > 0, 1, NULL))';

// OK
ADQuery1.Aggregates[0].Expression := 'COUNT(*) * 5';
// INVALID - cannot combine aggregating function with field
ADQuery1.Aggregates[0].Expression := 'AVG(Discount) * Amount';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.

What do you think about this topic? Send feedback!


TADAggregate.GroupingLevel Property

TADAggregate.GroupingLevel Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace Example published See Also Send Feedback

Specifies the set of records in the group.

Group

published

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, Example, published, See Also
Description

Use GroupingLevel to define to set of records in group. The aggregated value calculation is performed for each group of records separately.

The GroupingLevel is the number of indexed field. This number is the subset of all indexed fields in the current dataset index. All records in the group has the same value of these first GroupingLevel indexed fields. The 0 means - all dataset records.

Syntax
property GroupingLevel: Integer;
See Also

Expression, IndexName, TADDataSet.IndexName, TADDataSet.IndexFieldNames

Example
ADQuery1.IndexFieldNames : = 'ORDER_NO;PART_NO';
ADQuery1.AgregatesActive := True;
// calculate number of rows in each order
ADQuery1.Aggregates[0].Expression := 'COUNT(*)';
ADQuery1.Aggregates[0].GroupingLevel := 1;
ADQuery1.Aggregates[0].Active := True;
What do you think about this topic? Send feedback!


TADAggregate.IndexName Property

TADAggregate.IndexName Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace published See Also Send Feedback

Specifies the index name, for which aggregated value applies.

Group

published

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, published, See Also
Description

Use IndexName to specify a name of the index. When this index is active, then aggregated value is calculating.

Syntax
property IndexName: String;
See Also

TADDataSet.IndexName, TADDataSet.IndexFieldNames, GroupingLevel

What do you think about this topic? Send feedback!


TADAggregate.Name Property

TADAggregate.Name Property
TADAggregate Class TADAggregate Members uADCompDataSet Namespace published See Also Send Feedback

Specifies the name of an aggregated value.

Group

published

Links
TADAggregate Class, TADAggregate Members, uADCompDataSet Namespace, published, See Also
Description

Use Name to specify the name of an aggregated value. This name is used to display item at design time and to find item in a collection.

Syntax
property Name: String;
See Also

TADAggregates.FindAggregate, TADAggregates.AggregateByName

What do you think about this topic? Send feedback!


TADAggregates Class

TADAggregates Class
public TADAggregates Members Classes See Also Send Feedback

TADAggregates is a collection of TADAggregate objects.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADAggregates
File

uADCompDataSet

Links
public, TADAggregates Members, Classes, See Also
Description

TADAggregates is a list of all aggregated values, maintained by dataset. A single TADAggregate object represents a single maintained aggregated value. The aggregate values are maintained and calculated by dataset automatically, if:

  • TADAggregate.Active is True and value is really active (see TADAggregate.ActualActive);
  • TADDataSet.AggregatesActive is True.

The list does not include counterparts of TAggregatedField fields.

Syntax
TADAggregates = class(TCollection);
See Also

Calculated and Aggregated Fields, TADAggregate, TADDataSet, TADDataSet.AggregatesActive

What do you think about this topic? Send feedback!


TADAggregates Members

TADAggregates Members
TADAggregates Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADAggregates.

Class

TADAggregates Class

Methods
Method | Description
Add | Appends new TADAggregate object to a collection.
AggregateByName | Find TADAggregate object by its name and raises exception if it is not found.
FindAggregate | Find TADAggregate object by its name.
Properties
Property | Description
Items | Returns TADAggregate object by it index.
Links
TADAggregates Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADAggregates Class Legend Methods Properties Send Feedback

The public members of the TADAggregates class are listed here.

Class

TADAggregates Class

Methods
Method | Description
Add | Appends new TADAggregate object to a collection.
AggregateByName | Find TADAggregate object by its name and raises exception if it is not found.
FindAggregate | Find TADAggregate object by its name.
Properties
Property | Description
Items | Returns TADAggregate object by it index.
Links
TADAggregates Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADAggregates.Items Property

TADAggregates.Items Property
TADAggregates Class TADAggregates Members uADCompDataSet Namespace public See Also Send Feedback

Returns TADAggregate object by it index.

Group

public

Links
TADAggregates Class, TADAggregates Members, uADCompDataSet Namespace, public, See Also
Description

Use Items indexed property to get TADAggregate object by it index.

The property is default one, so you does not need to write ADQuery1.Aggregates.Items[i], just ADQuery1.Aggregates[i].

Syntax
property Items [AIndex: Integer]: TADAggregate;
See Also

TADAggregate, TCollection.Count

What do you think about this topic? Send feedback!


TADAggregates.Add Method

TADAggregates.Add Method
TADAggregates Class TADAggregates Members uADCompDataSet Namespace Example public See Also Send Feedback

Appends new TADAggregate object to a collection.

Group

public

Links
TADAggregates Class, TADAggregates Members, uADCompDataSet Namespace, Example, public, See Also
Description

Call Add method to add new empty TADAggregate object to a collection.

Syntax
function Add: TADAggregate;
See Also

Items, TCollection.Count

Example
with ADQuery1.Aggregates.Add do begin
  Name := 'a1';
  Expression := 'count(*)';
  Active := True;
end;
What do you think about this topic? Send feedback!


TADAggregates.AggregateByName Method

TADAggregates.AggregateByName Method
TADAggregates Class TADAggregates Members uADCompDataSet Namespace Example public See Also Send Feedback

Find TADAggregate object by its name and raises exception if it is not found.

Group

public

Links
TADAggregates Class, TADAggregates Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AName: String | A name of the aggregate object to find.
Description

Use AggregateByName method to find aggregate value by its name. If object is not found, then AggregateByName raises exception.

Syntax
function AggregateByName(const AName: String): TADAggregate;
See Also

TADAggregate.Name, FindAggregate, Items

Example
Label1.Caption := VarToStr(ADQuery1.Aggregates.AggregateByName('a1').Value);
What do you think about this topic? Send feedback!


TADAggregates.FindAggregate Method

TADAggregates.FindAggregate Method
TADAggregates Class TADAggregates Members uADCompDataSet Namespace Example public See Also Send Feedback

Find TADAggregate object by its name.

Group

public

Links
TADAggregates Class, TADAggregates Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AName: String | A name of the aggregate object to find.
Description

Use FindAggregate method to find aggregate value by its name. If object is not found, then FindAggregate returns nil.

Syntax
function FindAggregate(const AName: String): TADAggregate;
See Also

TADAggregate.Name, AggregateByName, Items

Example
var
  oAgg: TADAggregate;
...
oAgg := ADQuery1.Aggregates.FindAggregate('a1');
if oAgg <> nil then
  Label1.Caption := VarToStr(oAgg.Value);
What do you think about this topic? Send feedback!


TADAutoIncField Class

TADAutoIncField Class
published TADAutoIncField Members Classes See Also Send Feedback

TADAutoIncField represents integer auto incremental field in an FireDAC dataset.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADAutoIncField
File

uADCompDataSet

Links
published, TADAutoIncField Members, Classes, See Also
Description

Use TADAutoIncField to control client and server side auto incremental fields.

If FireDAC recognizes resultset column as representing an auto incremental field, then it will automatically create TADAutoIncField for this column. Otherwise, you can manually create TADAutoIncField for integer column at design time using Dataset Editor.

Set ClientAutoIncrement property to True (default value) and dataset will generate auto incrementing value for each new record. This is at first usefull in CachedUpdates = True mode.

Set ServerAutoIncrement property to True (default value) and dataset will not require value for this column and will not include it into updates. But will refresh after posting new record to a DBMS.

Set GeneratorName property to the name of sequence / generator and dataset will automatically fetch next value and assign it to dataset new record column.

Syntax
TADAutoIncField = class(TAutoIncField);
See Also

Auto-Incremental Fields, TADUpdateOptions.GeneratorName, TADUpdateOptions.FetchGeneratorsPoint, TADUpdateOptions.RefreshMode

What do you think about this topic? Send feedback!


TADAutoIncField Members

TADAutoIncField Members
TADAutoIncField Class Legend Properties Send Feedback

The following tables list the members exposed by TADAutoIncField.

Class

TADAutoIncField Class

Properties
Property | Description
AutoIncrementSeed | Specifies initial value for client side auto incrementing value.
AutoIncrementStep | Specifies incrementing step for client side auto incrementing value.
ClientAutoIncrement | Specifies when dataset need to generate auto incremental value for new record column.
GeneratorName | Specifies name of a sequence / generator to the field.
IdentityInsert | Enables to explicitly assign values to the auto incremental column.
ServerAutoIncrement | Specifies when DBMS generates auto incremental value for new record column.
Links
TADAutoIncField Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADAutoIncField Class Legend Properties Send Feedback

The published members of the TADAutoIncField class are listed here.

Class

TADAutoIncField Class

Properties
Property | Description
AutoIncrementSeed | Specifies initial value for client side auto incrementing value.
AutoIncrementStep | Specifies incrementing step for client side auto incrementing value.
ClientAutoIncrement | Specifies when dataset need to generate auto incremental value for new record column.
GeneratorName | Specifies name of a sequence / generator to the field.
IdentityInsert | Enables to explicitly assign values to the auto incremental column.
ServerAutoIncrement | Specifies when DBMS generates auto incremental value for new record column.
Links
TADAutoIncField Class, Legend, Properties
What do you think about this topic? Send feedback!


TADAutoIncField.AutoIncrementSeed Property

TADAutoIncField.AutoIncrementSeed Property
TADAutoIncField Class TADAutoIncField Members uADCompDataSet Namespace Example published See Also Send Feedback

Specifies initial value for client side auto incrementing value.

Group

published

Links
TADAutoIncField Class, TADAutoIncField Members, uADCompDataSet Namespace, Example, published, See Also
Description

Set AutoIncrementSeed to value, which will be the first auto generated value for new record column.

FireDAC recognizes negative auto incremental values, as explicitly generated by dataset at client side. Default value is -1.

The value of AutoIncrementSeed property may be changed only if dataset is inactive. After dataset is closed, the internal auto incremental value generator is reset to AutoIncrementSeed value.

Syntax
property AutoIncrementSeed: Integer;
See Also

ClientAutoIncrement, AutoIncrementStep

Example
TADAutoIncfield(ADQuery1.FieldByName('ID')).AutoIncrementSeed := -1000;
What do you think about this topic? Send feedback!


TADAutoIncField.AutoIncrementStep Property

TADAutoIncField.AutoIncrementStep Property
TADAutoIncField Class TADAutoIncField Members uADCompDataSet Namespace Example published See Also Send Feedback

Specifies incrementing step for client side auto incrementing value.

Group

published

Links
TADAutoIncField Class, TADAutoIncField Members, uADCompDataSet Namespace, Example, published, See Also
Description

Set AutoIncrementStep to value, to which will be the auto generated value incremented for new record column.

FireDAC recognizes negative auto incremental values, as explicitly generated by dataset at client side. Default value is -1.

The value of AutoIncrementStep property may be changed only if dataset is inactive. After dataset is closed, the internal auto incremental value generator is reset to AutoIncrementSeed value.

Syntax
property AutoIncrementStep: Integer;
See Also

ClientAutoIncrement, AutoIncrementSeed

Example

TADAutoIncfield(ADQuery1.FieldByName('ID')).AutoIncrementStep := -1;

What do you think about this topic? Send feedback!


TADAutoIncField.ClientAutoIncrement Property

TADAutoIncField.ClientAutoIncrement Property
TADAutoIncField Class TADAutoIncField Members uADCompDataSet Namespace Example published See Also Send Feedback

Specifies when dataset need to generate auto incremental value for new record column.

Group

published

Links
TADAutoIncField Class, TADAutoIncField Members, uADCompDataSet Namespace, Example, published, See Also
Description

Set ClientAutoIncrement property to True (default value) and dataset will generate auto incrementing value for new record column.

The dataset uses internal auto increment value generator. The initial value is equal to AutoIncrementSeed. The value is incrementing for new record by AutoIncrementStep. After dataset is closed, the internal auto increment value generator is reset to AutoIncrementSeed.

This may be usefull in CachedUpdates = True mode.

Syntax
property ClientAutoIncrement: Boolean;
See Also

Auto-Incremental Fields, ServerAutoIncrement

Example
ADQuery1.CachedUpdates := True;
ADQuery1.Open;
ADQuery1.Append;
....
ADQuery1.Post;
// TADAutoIncField(ADQuery1.Fields[0]).Value -> -1
ADQuery1.Append;
....
ADQuery1.Post;
// TADAutoIncField(ADQuery1.Fields[0]).Value -> -2
ADQuery1.Append;
....
ADQuery1.Post;
// TADAutoIncField(ADQuery1.Fields[0]).Value -> -3
ADQuery1.ApplyUpdates;
What do you think about this topic? Send feedback!


TADAutoIncField.GeneratorName Property

TADAutoIncField.GeneratorName Property
TADAutoIncField Class TADAutoIncField Members uADCompDataSet Namespace Example published See Also Send Feedback

Specifies name of a sequence / generator to the field.

Group

published

Links
TADAutoIncField Class, TADAutoIncField Members, uADCompDataSet Namespace, Example, published, See Also
Description

Set GeneratorName property to a name of a sequence / generator and dataset will automatically fetch a next value and assign it to a dataset new record column.

If GeneratorName is not specified, then dataset takes it value from UpdateOptions.GeneratorName. Property UpdateOptions.FetchGeneratorsPoint controls when a value will be assigned. See it description for more details.

Syntax
property GeneratorName: String;
See Also

Auto-Incremental Fields, Object Names, TADUpdateOptions.GeneratorName, TADUpdateOptions.FetchGeneratorsPoint

Example
TADAutoIncField(ADQuery1.Fields[0]).GeneratorName := 'GEN_ID';
What do you think about this topic? Send feedback!


TADAutoIncField.IdentityInsert Property

TADAutoIncField.IdentityInsert Property
TADAutoIncField Class TADAutoIncField Members uADCompDataSet Namespace Example published See Also Send Feedback

Enables to explicitly assign values to the auto incremental column.

Group

published

Links
TADAutoIncField Class, TADAutoIncField Members, uADCompDataSet Namespace, Example, published, See Also
Description

Set IdentityInsert property to True to enable explicit assignment of a value to the auto incremental column. By default it is False. Note, that not all DBMS's support assignment of a value to the identity column.

When a DBMS supports sequences or generators, and application uses client side field value filling from a sequence, then it is required to set IdentityInsert to True.

Syntax
property IdentityInsert: Boolean;
See Also

Auto-Incremental Fields, TADDataMove

Example
TADAutoIncField(ADQuery1.Fields[0]).IdentityInsert := True;
ADQuery1.Append;
ADQuery1.Fields[0].Value := 123;
ADQuery1.Post;
What do you think about this topic? Send feedback!


TADAutoIncField.ServerAutoIncrement Property

TADAutoIncField.ServerAutoIncrement Property
TADAutoIncField Class TADAutoIncField Members uADCompDataSet Namespace published See Also Send Feedback

Specifies when DBMS generates auto incremental value for new record column.

Group

published

Links
TADAutoIncField Class, TADAutoIncField Members, uADCompDataSet Namespace, published, See Also
Description

Set ServerAutoIncrement property to True (default value) and dataset:

  • does not require value for column (Required = False);
  • does not include column into updates (pfInUpdate not in ProviderFlags);
  • refreshes column values after posting new record to a database (AutoGenerateValue = arAutoInc).

Best result will be achieved if to set ClientAutoIncrement to True.

By default it is not possible to explicitly assign value to field with ServerAutoIncrement = True. If you need to explicitly assign value, then set IdentityInsert to True.

Syntax
property ServerAutoIncrement: Boolean;
See Also

Auto-Incremental Fields, IdentityInsert, ClientAutoIncrement

What do you think about this topic? Send feedback!


TADBlobStream Class

TADBlobStream Class
public TADBlobStream Members Example 1 Example 2 Example 3 Classes See Also Send Feedback

TADBlobStream is a stream object giving access to BLOB / Memo fields.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADBlobStream
File

uADCompDataSet

Links
public, TADBlobStream Members, Example 1, Example 2, Example 3, Classes, See Also
Description

Use TADBlobStream to read or modify the value of BLOB field. The BLOB field is a field of one of the following data types:

  • ftBLOB (LONG RAW, bytea, IMAGE, etc);
  • ftMemo (LONG, TEXT, etc);
  • ftWideMemo / ftFmtMemo (NCLOB, NTEXT, etc);
  • ftOraBLOB (BLOB);
  • ftOraClob (CLOB).

To create TADBlobStream use TADDataSet.CreateBlobStream method or just create TADBlobStream object explicitly using Create constructor.

To modify content of BLOB field, dataset must be in dsEdit / dsInsert mode and field must be ReadOnly = False.

Syntax
TADBlobStream = class(TMemoryStream);
See Also

TADDataSet.CreateBlobStream

Example 1

The demo shows how to load BLOB field value from external file

ADQuery1.Append;
// assign other fields
....
// load BLOB field value
oStr := TADBlobStream.Create(ADQuery1.FieldByName('PHOTO'), bmWrite);
try
  oStr.LoadFromFile('c:\aaa.jpg');
finally
  oStr.Free;
end;
ADQuery1.Post;
Example 2

The demo shows how to save BLOB field value into external file

// save BLOB field value
oStr := TADBlobStream.Create(ADQuery1.FieldByName('PHOTO'), bmRead);
try
  oStr.SaveToFile('c:\aaa.jpg');
finally
  oStr.Free;
end;
Example 3

See FireDAC\Samples\Comp Layer\TADQuery\Blobs demo for details.

What do you think about this topic? Send feedback!


TADBlobStream Members

TADBlobStream Members
TADBlobStream Class Legend Methods Send Feedback

The following tables list the members exposed by TADBlobStream.

Class

TADBlobStream Class

Methods
Method | Description
Create | Creates new TADBlobStream object.
Truncate | Truncates BLOB value to zero length.
Links
TADBlobStream Class, Legend, Methods
What do you think about this topic? Send feedback!


public

public
TADBlobStream Class Legend Methods Send Feedback

The public members of the TADBlobStream class are listed here.

Class

TADBlobStream Class

Methods
Method | Description
Create | Creates new TADBlobStream object.
Truncate | Truncates BLOB value to zero length.
Links
TADBlobStream Class, Legend, Methods
What do you think about this topic? Send feedback!


TADBlobStream.Create Constructor

TADBlobStream.Create Constructor
TADBlobStream Class TADBlobStream Members uADCompDataSet Namespace public Send Feedback

Creates new TADBlobStream object.

Group

public

Links
TADBlobStream Class, TADBlobStream Members, uADCompDataSet Namespace, public
Parameters
Parameters | Description
AField: TField | A BLOB field to open.
AMode: TBlobStreamMode | A open mode.
Description

Use Create constructor to explicitly create new TADBlobStream object.

Specify AField field to read from / writ to data. AMode controls access mode to BLOB field value:

Mode | Description
bmRead | Opens BLOB field for reading.
bmWrite | Opens BLOB field for writing. After open BLOB field value will be truncated to zero length.
bmReadWrite | Opens BLOB field for reading and writing.

To open BLOB field value in bmWrite or bmReadWrite mode, dataset must be in dsEdit / dsInsert mode and field must be ReadOnly = False.

The stream object must be destroyed using Free method after usage and not later when dataset will be closed. If BLOB field value was opened in bmWrite or bmReadWrite mode, then object must be destroyed before Post method call.

Syntax
constructor Create(AField: TField; AMode: TBlobStreamMode);
What do you think about this topic? Send feedback!


TADBlobStream.Truncate Method

TADBlobStream.Truncate Method
TADBlobStream Class TADBlobStream Members uADCompDataSet Namespace public See Also Send Feedback

Truncates BLOB value to zero length.

Group

public

Links
TADBlobStream Class, TADBlobStream Members, uADCompDataSet Namespace, public, See Also
Description

Call Truncate method to truncate BLOB field value to zero length.

Syntax
procedure Truncate;
See Also

Create

What do you think about this topic? Send feedback!


TADDataSet Class

TADDataSet Class
public protected TADDataSet Members Classes See Also Send Feedback

The TADDataSet is a direct TDataSet descendant, introducing base functionality for all FireDAC datasets.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADDataSet
File

uADCompDataSet

Links
public, protected, TADDataSet Members, Classes, See Also
Description

The TADDataSet is a direct TDataSet descendant that holds data in memory in a table-like internal data storage consisting of rows (records) and columns (fields).

The TADDatSTable is the class representing a table of records. The TADDataSet stores all records in a single table, if it does not have nested datasets, array-type fields and other complex-type fields. You can get reference to table using TADDataSet.Table property.

The TADDatSTable object may have few TADDatSView objects - data views. A data view does not store records, but provides access to TADDatSTable records. For each view may defined records sort order, few record filters and few aggregate values. TADDataSet automatically creates data views, basing on their property values and method calls, like a Indexes, Filter, FilterChanges, ranges, etc. You can get reference to current view using TADDataSet.DefaultView property.

Also TADDatSTable has a change log. It contains a list of changed, deleted and new record references. The list is ordered by the moment of time, when a change is happened. If record was changed twice or more, log contains information for last change only.

For options description, please, look at uADStanOption description.

Syntax
TADDataSet = class(TDataSet, IUnknown, IADDataSetReference, IADStanOptions, IADPhysLocalQueryAdapter);
See Also

TADAdaptedDataSet, TADDatSTable, TADDatSView, TADDatSRow, uADStanOption

What do you think about this topic? Send feedback!


TADDataSet Members

TADDataSet Members
Events TADDataSet Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADDataSet.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADDataSet Class

Methods
Method | Description
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.
Links
Events, TADDataSet Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
Events TADDataSet Class Legend Methods Properties Send Feedback

The public members of the TADDataSet class are listed here.

Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.
Class

TADDataSet Class

Methods
Method | Description
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.
Links
Events, TADDataSet Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADDataSet.ActiveStoredUsage Property

TADDataSet.ActiveStoredUsage Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Controls how to use Active property value saved to DFM.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The ActiveStoredUsage property controls how to use Active property value saved to DFM. Include:

  • auDesignTime, to use property value at design time;
  • auRunTime, to use property value at run time.
Syntax
property ActiveStoredUsage: TADStoredActivationUsage;
See Also

TDataSet.Active

What do you think about this topic? Send feedback!


TADDataSet.AfterApplyUpdates Event

TADDataSet.AfterApplyUpdates Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires after cached updates are applied to DB.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The AfterApplyUpdates event fires after cached updates are applied to DB as result of ApplyUpdates method call.

Syntax
property AfterApplyUpdates: TADAfterApplyUpdatesEvent;
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates

What do you think about this topic? Send feedback!


TADDataSet.AfterExecute Event

TADDataSet.AfterExecute Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires after SQL command execution is finished.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The AfterExecute event fires after SQL command execution is finished as result of Execute method call.

Syntax
property AfterExecute: TADDataSetEvent;
See Also

TADDataSetEvent, Execute, BeforeExecute

What do you think about this topic? Send feedback!


TADDataSet.AfterGetRecord Event

TADDataSet.AfterGetRecord Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires after fetching next rowset one time for each fetched record.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The AfterGetRecord event fires after dataset fetched next rowset as result of navigation methods calls. The event fires one time for each fetched record. For example, fetching occurs automatically inside of Next, Last, Locate methods. Inside of an event handler application may read dataset fields to get fetched record field values.

Syntax
property AfterGetRecord: TADDataSetEvent;
See Also

AfterGetRecords

What do you think about this topic? Send feedback!


TADDataSet.AfterGetRecords Event

TADDataSet.AfterGetRecords Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires after fetching next rowset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The AfterGetRecords event fires after dataset fetched next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property AfterGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord

What do you think about this topic? Send feedback!


TADDataSet.AfterRowRequest Event

TADDataSet.AfterRowRequest Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires after fetching record.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The AfterRowRequest event fires after dataset fetched current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property AfterRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest

What do you think about this topic? Send feedback!


TADDataSet.Aggregates Property

TADDataSet.Aggregates Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

The collection of client side aggregates, defined for dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Description

Use Aggregates to define client side aggregating formulas, that will be automatically maintained and calculated for group of or for all records of dataset.

All records in the group of records has the same field values for defined set of fields. Aggregates performing calculation for group of records must be associated with one of the indexes. These aggregate expressions will be calculated only is associated index is current and active.

Adding aggregate field does not add TADAggregate object to Aggregates collection. That are two alternative ways - to use aggregate fields or to use Aggregates.

DataSet will automatically maintain and calculate Aggregates values when dataset is fetching the data or application edits the data, if AggregatesActive is True. If application needs to perform large updates to dataset and aggregate values are not needed while updating, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

When aggregates are maintained, the Value method of every active aggregate object returns a value that reflects the current data in the dataset. When users edit the data in the dataset, these values are recalculated to reflect the user's changes.

The expressions in Aggregates must contain aggregating functions, like a SUM, COUNT. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Aggregates: TADAggregates;
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch

Example 1
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.

What do you think about this topic? Send feedback!


TADDataSet.AggregatesActive Property

TADDataSet.AggregatesActive Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Controls automatic calculation of aggregate values.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use AggregatesActive to get / set the flag controlling automatic maintenance and calculation of dataset aggregate values.

When AggregatesActive is False (the default), the dataset does not maintain aggregates. This allows the dataset to perform large updates to the dataset or fetch big volumes of data without overhead of calculating aggregate values, which happens at fetching or data editing. When AggregatesActive is True, the dataset calculates and maintains all aggregate values specified by the Aggregates property that are compatible with the current index.

To selectively enable and disable aggregates rather than turning them all on or off at once, use the Active property of individual TADAggregate objects. These objects are available through the Aggregates property.

If application needs to perform batch updates to dataset, then set AggregatesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property AggregatesActive: Boolean;
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch

Example
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;
What do you think about this topic? Send feedback!


TADDataSet.BeforeApplyUpdates Event

TADDataSet.BeforeApplyUpdates Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires before cached updates are applied to DB.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The BeforeApplyUpdates event fires before cached updates are applied to database as result of ApplyUpdates method call.

Syntax
property BeforeApplyUpdates: TADDataSetEvent;
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates

What do you think about this topic? Send feedback!


TADDataSet.BeforeExecute Event

TADDataSet.BeforeExecute Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires before SQL command execution is started.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The BeforeExecute event fires before SQL command execution is started as result of Execute method call.

Syntax
property BeforeExecute: TADDataSetEvent;
See Also

TADDataSetEvent, Execute, AfterExecute

What do you think about this topic? Send feedback!


TADDataSet.BeforeGetRecords Event

TADDataSet.BeforeGetRecords Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires before fetching next rowset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The BeforeGetRecords event fires before dataset will fetch next rowset as result of navigation methods calls. For example, fetching occurs automatically inside of Next, Last, Locate methods.

Syntax
property BeforeGetRecords: TADDataSetEvent;
See Also

TADDataSetEvent, AfterGetRecords

What do you think about this topic? Send feedback!


TADDataSet.BeforeRowRequest Event

TADDataSet.BeforeRowRequest Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires before fetching record.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The BeforeRowRequest event fires before dataset will fetch current record as result of RefreshRecord, FetchBlobs or FetchDetails method calls.

Syntax
property BeforeRowRequest: TADDataSetEvent;
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest

What do you think about this topic? Send feedback!


TADDataSet.CachedUpdates Property

TADDataSet.CachedUpdates Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Specifies whether dataset will log changes to the data without immediate applying of them to the database.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

CachedUpdates enables (True) or disables (False) the logging of data changes (Insert/Post, Edit/Post, Delete) without immediate applying of them to the database.

An application must explicitly apply changes from change log to the database, using ApplyUpdates method. All changes will be written in comparably small amount of time in single transaction. The main benefits of enabling cached updates are:

  • fewer transactions and shorter transaction times;
  • minimization of network traffic;
  • simplified implementation of undo / redo functionality for dataset;
  • ability to implement application offline mode or briefcase model.

The potential drawbacks of enabling cached updates are:

  • other applications can access and change the actual data on the server while users are editing local copies of the data, resulting in an update conflict when cached updates are applied to the database;
  • other applications cannot access data changes made by an application until its cached updates are applied to the database.

Note, to change CachedUpdate property value for TADTable, it must be inactive.

Syntax
property CachedUpdates: Boolean;
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates

Example
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;
What do you think about this topic? Send feedback!


TADDataSet.ChangeCount Property

TADDataSet.ChangeCount Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Gets the number of changes in the change log.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Description

Use ChangeCount to determine how many modifications are in the datasets change log. ChangeCount:

  • increases when the data is edited (eg Edit / Post);
  • decreses when changes are undone (eg UndoLastChange);
  • sets to zero after commiting (CommitUpdates) or canceling all updates (CancelUpdates).
Syntax
property ChangeCount: Integer;
See Also

Caching Updates, CachedUpdates, UndoLastChange, CancelUpdates, CommitUpdates, ApplyUpdates

Example 1
procedure TForm1.ADQuery1AfterPost(DataSet: TDataSet);
begin
  if TADDataSet(DataSet).ChangeCount = 0 then
    StatusBar1.SimpleText := 'no changes'
  else
    StatusBar1.SimpleText := Format('%d changed rows', [TADDataSet(DataSet).ChangeCount]);
end;
Example 2

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.

What do you think about this topic? Send feedback!


TADDataSet.CloneSource Property

TADDataSet.CloneSource Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Gets the dataset (if any) with which this dataset shares data.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Use CloneSource to access another dataset that shares its internal data storage with this one. CloneSource is set by the CloneCursor method when the datasets are linked. If the dataset has not called CloneCursor to share the data storage of another dataset, CloneSource is nil.

Syntax
property CloneSource: TADDataSet;
See Also

CloneCursor

What do you think about this topic? Send feedback!


TADDataSet.Constraints Property

TADDataSet.Constraints Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Specifies record-level client constraints that must be met when editing the data.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use Constraints to maintain record-level constraints for the dataset.

Record-level constraints force business ruless limiting few fields in a single record. This constraints are checked at end of data editing (Post / AppendRecord / InsertRecord). Constraints, limiting single field are field constraints and must specified at TField.CustomConstraint or TField.ImportedConstraint.

The Constraints checking is performed when ConstraintsEnabled is True. If application needs to perform large updates to the dataset and application can guarantee the data consistancy, then set ConstraintsEnabled to False before updates, and return to original value after updates. The constraints are not checked at data fetching.

The expressions in Constraints must be predicates, evaluating to Boolean value. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • Client dataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write constraint expressions.

Syntax
property Constraints;
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint

Example
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;
What do you think about this topic? Send feedback!


TADDataSet.ConstraintsEnabled Property

TADDataSet.ConstraintsEnabled Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Specifies whether the dataset perform constraint checking.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use ConstraintsEnabled to get / set the flag controlling automatic record-level constraints enforcement.

When ConstraintsEnabled is False (the default), the dataset does not check Constraints. This allows the dataset to perform the large data updates without overhead of checking constraints. When ConstraintsEnabled is True, the dataset checks Constraints at at end of data editing (Post / AppendRecord / InsertRecord).

If application needs to perform batch updates to dataset, then set ConstraintsEnabled to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property ConstraintsEnabled: Boolean;
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired

Example
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;
What do you think about this topic? Send feedback!


TADDataSet.Data Property

TADDataSet.Data Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Represents the data of the dataset, allowing to copy full data of one dataset into another.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

The Data property represents the dataset's internal in-memory data storage. Using this property application can copy current structure and data of one FireDAC dataset to another FireDAC dataset.

The property value is reference to IADDataSet interface. It is reference counted and application does not need explicitly to free it. If application keeps the interface reference using a variable or a field, then reference must be released before dataset will be closed.

The dataset must be inactive to set this property value, otherwise exception will be raised. After its setting, the Self dataset:

  • has a structure of an original dataset, excluding Indexes, IndexDefs, Filter, etc;
  • has a copy of an original dataset data, including all row versions and states (inserted, deleted, updated, unchanged);
  • has CachedUpdates = True, if an original dataset has unapplied changed;
  • is open.
Syntax
property Data: IADDataSetReference;
See Also

Delta, FilteredData, CopyDataSet, CachedUpdates

Example
ADQuery1.SQL.Text := 'select * from orders; select * from customers';

ADQuery1.Open;
ADQuery1.FetchAll;
// assign orders records to ADMemTable1
ADMemTable1.Data := ADQuery1.Data;

ADQuery1.NextRecordSet;
ADQuery1.FetchAll;
// assign customers records to ADMemTable2
ADMemTable2.Data := ADQuery1.Data;
What do you think about this topic? Send feedback!


TADDataSet.DatSManager Property

TADDataSet.DatSManager Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns the reference to the internal data storage manager.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The DatSManager property value is the reference to the internal data storage manager.

Syntax
property DatSManager: TADDatSManager;
See Also

Table, View, SourceView, AttachTable

What do you think about this topic? Send feedback!


TADDataSet.Delta Property

TADDataSet.Delta Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Represents the changed records of the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

The Delta property value represents the set of changed records in the dataset. The set may be assigned to other datasetsData property. The delta may be not empty only when CachedUpdates is True.

The property value is reference to IADDataSet interface. It is reference counted and application does not need explicitly to free it. If application keeps the interface reference using a variable or a field, then reference must be released before dataset will be closed.

In case you are processing the dataset Delta using TADMemTable as:

ADMemTable1.Data := ADQuery1.Delta;

Make sure the filter changes property reflects the records (modified, inserted or deleted) you want to process:

ADMemTable1.FilterChanges := [rtModified, rtInserted, rtDeleted];
Syntax
property Delta: IADDataSetReference;
See Also

Data, FilteredData, FilterChanges

Example
// copy to ADMemTable1 all ADQuery1 changed records and their versions
ADMemTable1.FilterChanges := [rtModified, rtInserted, rtDeleted];
ADMemTable1.Data := ADQuery1.Delta;
What do you think about this topic? Send feedback!


TADDataSet.DetailFields Property

TADDataSet.DetailFields Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use DetailFields property value to specify semicolon separated list of the detail dataset field names, used to establish a master-detail relationship with this dataset.

The DetailFields property is useful only for parameter based master-detail setup. For range based setup the indexed fields are used as the detail field list. When DetailFields is not specified explicitly, then field names matching to query parameter names will be used as DetailFields value.

The DetailFields will be used only to assign specified field values when a new record is inserted into detail dataset. The mechanism used to filter the detail dataset records does not use DetailFields.

Syntax
property DetailFields: String;
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName

Example
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';
What do you think about this topic? Send feedback!


TADDataSet.FilterChanges Property

TADDataSet.FilterChanges Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Specifies what kinds of changed records must be "visible" in the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

The FilterChanges property allows to get / set changed records kinds, which must be accessible through navigation interface of dataset ("visible" in dataset):

Kind | Meaning
rtModified | Records changed after fetching or last CommitUpdates / CancelUpdates.
rtInserted | New records, not yet posted to DB and added after dataset open or after last CommitUpdates.
rtDeleted | Deleted records, not yet deleted from DB and deleted after dataset open or after last CommitUpdates.
rtUnmodified | Unchanged records.
rtHasErrors | Records having associated errors after ApplyUpdates. To get an error object use RowError property.
Syntax
property FilterChanges: TADUpdateRecordTypes;
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus

Example
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];
What do you think about this topic? Send feedback!


TADDataSet.FilteredData Property

TADDataSet.FilteredData Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Represents the currently "visible" data of the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

The FilteredData property value represents the set of records accessible through navigation interface of the dataset ("visible" in the dataset). This set is formed by applying of filters, ranges, indexes, etc. The set may be assigned to other datasets Data property.

The property value is reference to IADDataSet interface. It is reference counted and application does not need explicitly to free it. If application keeps the interface reference using a variable or a field, then reference must be released before one of following events occurs:

  • close dataset;
  • change Filter / FilterChanges / FilterOptions / OnFilterRecord / Filtered property values;
  • change IndexName / IndexFieldNames / Indexes property values;
  • change current ranges.
Syntax
property FilteredData: IADDataSetReference;
See Also

Delta, Data, Filter, OnFilterRecord, IndexName, IndexFieldNames, Indexes

Example
ADQuery1.Filter := 'upper(name) like ''D%''';
ADQuery1.Filtered := True;
// copy to ADMemTable1 all ADQuery1 visible (where name starts from D) records
ADMemTable1.Data := ADQuery1.FilteredData;
What do you think about this topic? Send feedback!


TADDataSet.GroupingLevel Property

TADDataSet.GroupingLevel Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns the depth of grouping support provided by the current index.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Read GroupingLevel to determine the maximum level group for which grouping support is available. The datasets provide grouping support by GetGroupState method. It indicates where the current record falls within a group.

A group is defined as the set of records that have the same value on each of a set of fields. A level 0 group is the set of all records in the dataset. A level 1 group is the set of records with the same value on the first field of the index. A level 2 group is the set of records with the same values on each of the first two fields of the index. A level n group is the set of records with the same values on each of the first n fields of the index.

By default, GroupingLevel is the default grouping level of the current index or the maximum grouping level of a maintained aggregate on the current index, whichever is greater. GroupingLevel can never be greater than IndexFieldCount.

Syntax
property GroupingLevel: Integer;
See Also

GetGroupState, IndexFieldCount

What do you think about this topic? Send feedback!


TADDataSet.IndexDefs Property

TADDataSet.IndexDefs Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns indexes definition for the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Use IndexDefs property to read or maintain indexes definitions.

The dataset also has Indexes collection. Application should use either IndexDefs, either Indexes, but not both in the same time. We suggest to use Indexes, as it is more flexible. IndexDefs property at first is needed for compatibility with other software using TDataSet, where IndexDefs is really defined.

The TADTable will automatically fill IndexDefs by database indexes, if fiMeta in FetchOptions.Items.

Syntax
property IndexDefs: TIndexDefs;
See Also

Sorting Records, Indexes, TADFetchOptions.Items

What do you think about this topic? Send feedback!


TADDataSet.Indexes Property

TADDataSet.Indexes Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Lists all client indexes that apply to the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Description

Use Indexes to define client side data views on the dataset records. Indexes are a collection of the TADIndex objects, each of them defines optional:

  • Sorting by fields (Fields, CaseInsFields, DescFields, Options).
  • Sorting by expression (Expression, Options).
  • Records filter (Filter, FilterOptions).
  • Records distinction flag (Distinct).

The individual indexes are not just the sort and filter definitions. FireDAC maintains a consistent view on the data for each active index, while application fetches data or edits data. That creates additional overhead, but allows to switch between indexes without delays.

To make a view current, set it Selected property to True or dataset IndexName property to the view name. Note, the view must have Active = True to be maintained.

Dataset maintains Indexes views, when IndexesActive is True. When an application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Setting IndexFieldNames does not add a TADIndex object to Indexes collection. Defining IndexDefs before dataset opening, will clear Indexes and fill them using IndexDefs information. So, there are two alternative ways - use IndexDefs or use Indexes. We suggest to use Indexes, as it is more flexible.

Some of the navigation methods, like a Locate / Lookup / SetRange are using indexes to optimize their operations.

The sorting and filter expressions in Indexes supports syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).
Syntax
property Indexes: TADIndexes;
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch

Example 1
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.

What do you think about this topic? Send feedback!


TADDataSet.IndexesActive Property

TADDataSet.IndexesActive Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Controls automatic maintenance of Index'es.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use IndexesActive to indicate whether the dataset should maintain the data views, defined by the Indexes collection.

When IndexesActive is False, the dataset does not maintain the data views. That avoids the overhead of updating views, while data is fetched or is edited. When IndexesActive is True (by default), the dataset maintains the data views.

When indexes are maintained, each of them may be current index, selected by TADIndex.Selected or by IndexName properties.

To selectively enable and disable data views rather than turning them all on or off at once, use the Active property of individual TADIndex objects. These objects are available through the Indexes property.

If application needs to perform batch updates to dataset, then set IndexesActive to False before updates, and return to original value after updates. Also see BeginBatch / EndBatch methods.

Syntax
property IndexesActive: Boolean;
See Also

Sorting Records, Indexes, BeginBatch, EndBatch

Example
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;
What do you think about this topic? Send feedback!


TADDataSet.IndexFieldCount Property

TADDataSet.IndexFieldCount Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns the number of fields that make up the current index.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Use IndexFieldCount to determine how many fields are used by the current index for the dataset.

The property has the meaning only for non-expressional indexes.

Syntax
property IndexFieldCount: Integer;
See Also

IndexFieldNames, IndexName

What do you think about this topic? Send feedback!


TADDataSet.IndexFieldNames Property

TADDataSet.IndexFieldNames Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Lists the field names to use as an index.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use IndexFieldNames as an alternative method of specifying the current index to use for a dataset.

Specify the name of each field on which to index the dataset, separating names with semicolons. Ordering of field names is significant. Optionally specify the postfix for any of fields in form "field[:[D][A][N]]", where:

- 'D' - use descending sorting on this field;

- 'A' - use ascending sorting on this field;

- 'N' - use case-insensitive sorting on this field.

Use IndexFieldNames to create sort orders on the fly. The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.

Syntax
property IndexFieldNames: String;
See Also

Sorting Records, Indexes, IndexName

Example
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';
What do you think about this topic? Send feedback!


TADDataSet.IndexFields Property

TADDataSet.IndexFields Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns the fields that make up the current index.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

IndexFields is a zero-based array of TField objects, each of which corresponds to a field in the current index.

Index parameter is an ordinal value indicating the position of a field in the index.

To set dataset ordering use the IndexFieldNames or IndexName properties to order datasets on the fly at runtime.

The property has the meaning only for non-expressional indexes.

Syntax
property IndexFields [AIndex: Integer]: TField;
See Also

IndexFieldNames, IndexName, IndexFieldCount

What do you think about this topic? Send feedback!


TADDataSet.IndexName Property

TADDataSet.IndexName Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Gets / sets the current index for the dataset by its name.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use IndexName to specify the current index for the dataset.

If IndexName is empty, the dataset's sort order is based on the IndexFieldNames property or on its default ordering as it is in dataset. If IndexName contains a name of valid index from Indexes collection, then that index is used to determine data view (including sort order) of records.

IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.

Syntax
property IndexName: String;
See Also

Sorting Records, Indexes, IndexFieldNames

Example
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';
What do you think about this topic? Send feedback!


TADDataSet.KeyExclusive Property

TADDataSet.KeyExclusive Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Controls the exclusion of upper and lower boundaries for a range.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Use KeyExclusive to get / set the flag controlling should a range include or exclude the records that exactly match starting and ending values range values. By default, KeyExclusive is False, meaning that exact matching values are included.

To restrict a range to those records that are greater than the specified starting value and less than the specified ending value, set KeyExclusive to True. Setting of KeyExclusive is possible only in dsSetKeyMode.

The property has the meaning only for non-expressional indexes.

Syntax
property KeyExclusive: Boolean;
See Also

Filtering Records, FindNearest, GotoNearest, SetRange, SetRangeEnd, SetRangeStart

What do you think about this topic? Send feedback!


TADDataSet.KeyFieldCount Property

TADDataSet.KeyFieldCount Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Controls the number of indexed field values to use for key search or range setup.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Description

Use KeyFieldCount to get / set the number of indexed field values to use for key searching or ranges setup. The default value - all indexed fields.

The KeyFieldCount must be less than or equal to the number of indexed fields - IndexFieldCount. If specified, then FireDAC will use the first KeyFieldCount indexed fields for searching, instead of IndexFieldCount fields. Setting of KeyFieldCount is possible only in dsSetKeyMode.

The property has the meaning only for non-expressional indexes.

Syntax
property KeyFieldCount: Integer;
See Also

Filtering Records, FindKey, FindNearest, GotoKey, GotoNearest

Example 1
ADQuery1.IndexFieldNames := 'EmployeeID;CustomerID;SellDate';
ADQuery1.SetKey;
ADQuery1.KeyFieldCount := 2;
ADQuery1.FieldByName('EmployeeID').AsInteger := 100;
ADQuery1.FieldByName('CustomerID').AsInteger := 200;
ADQuery1.GotoKey;
Example 2
ADQuery1.IndexFieldNames := 'EmployeeID;CustomerID;SellDate';
ADQuery1.SetRangeStart;
ADQuery1.KeyFieldCount := 1;
ADQuery1.FieldByName('EmployeeID').AsInteger := 100;
ADQuery1.SetRangeEnd;
ADQuery1.KeyFieldCount := 1;
ADQuery1.FieldByName('EmployeeID').AsInteger := 100;
ADQuery1.ApplyRange;
What do you think about this topic? Send feedback!


TADDataSet.MasterFields Property

TADDataSet.MasterFields Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use MasterFields property value to specify semicolon separated list of the master dataset field names, used to establish a master-detail relationship with this dataset.

Specify MasterFields property value after assigning MasterSource property value. The mechanism used to filter this detail dataset records depends on the dataset class:

  • TADQuery and TADStoredProc will match master fields to this query / procedure parameters by their names. When the master dataset current record is changed, then this dataset parameters will get values from the corresponding MasterFields.
  • TADMemTable will match master fields to this dataset indexed fields by their positions. When the master dataset current record is changed, then a range will be applied to this dataset, where starting and ending range values are equal to the corresponding MasterFields field values. The application must have a current active index. The indexed fields will be the detail dataset fields used to establish mater-detail.
Syntax
property MasterFields: String;
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName

Example
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
What do you think about this topic? Send feedback!


TADDataSet.MasterLink Property

TADDataSet.MasterLink Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns data link object servicing connection with master dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The MasterLink property returns a reference to TADMasterLink object, which services master-detail link.

Syntax
property MasterLink: TADMasterDataLink;
See Also

Master-Detail Relationship

What do you think about this topic? Send feedback!


TADDataSet.MasterSource Property

TADDataSet.MasterSource Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Gets / sets a master data source, used to establish a master-detail relationship with this dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Description

Use MasterSource to specify the data source linked to a dataset, which will be used as master dataset in master-detail relationship between this and specified datasets.

Additionally application must specify MasterFields property value. See MasterFields property description for additional information.

Syntax
property MasterSource: TDataSource;
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName

Example 1
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
Example 2

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.

What do you think about this topic? Send feedback!


TADDataSet.OnMasterSetValues Event

TADDataSet.OnMasterSetValues Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fires after a detailed dataset has set detailed query parameters.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Use the OnMasterSetValues event handler to override parameter values supplied to detail dataset from the master dataset. Also, because BeforeOpen and AfterOpen events do not fire for a detail dataset, the OnMasterSetValues may be used instead of them.

Syntax
property OnMasterSetValues: TADDataSetEvent;
See Also

Master-Detail Relationship, MasterSource, MasterFields

What do you think about this topic? Send feedback!


TADDataSet.OnReconcileError Event

TADDataSet.OnReconcileError Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Fires when a dataset needs to reconcile an update to a record that cannot not be applied.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use the OnReconcileError event handler to respond to error conditions that arise when the ApplyUpdates method was applying changes to the records to the database. The OnReconcileError event handler is called by Reconcile method.

As part of Reconcile call the dataset will loop through all records with associated exception objects. And for each such record will call the OnReconcileError event handler. The event handler gets:

  • E - reference to the exception object. See Handling Errors topics for how to work with exception objects.
  • UpdateKind - the update kind of the current record. It may be one of the values: rsInserted, rsDeleted, rsModified, rsUnchanged.

After handling error the event handler should set Action argument. The default value is raMerge. The possible values are:

Action | Description
raSkip | Just skip current record.
raAbort | Just quit from Reconcile call.
raMerge | Clear the current record error state, make current record changes the new initial state of this record. IOW, merge changes into dataset records cache.
raCorrect | Clear current record error state. IOW, mark the record as correctly applied.
raCancel | Cancel current record changes.
raRefresh | Cancel current record changes and reread the record values from the database.

The event handler may analyze the original and current field values, by reading TField.OldValue and NewValue properties. Application may also update the current field value, set Action to raCorrect, and later call ApplyUdpates again.

Syntax
property OnReconcileError: TADReconcileErrorEvent;
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError

Example
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;
What do you think about this topic? Send feedback!


TADDataSet.OnUpdateError Event

TADDataSet.OnUpdateError Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Fires if an exception is generated when updates are applied to a database.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use the OnUpdateError event handler to respond to exceptions raised while applying immediate or cached updates to a database.

ASender is the dataset to which updates are applied.

AException is a pointer to a EADException object from which an application can extract an error message and the actual cause of the error condition. The OnUpdateError handler can use this information to determine how to respond to the error condition. In most cases AException object will be of class EADDBEngineException or even one of it DBMS specific subclasses.

ARow is a DatS row object, repesenting erroneous record in dataset. This record is also current record in ASender.

ARequest indicates whether the error occurred while inserting, deleting, or modifying a record.

AAction indicates the action to take when the OnUpdateError handler exits. On entry into the handler, AAction is always set to eaDefault, which leads to uaFail, if not changed. If OnUpdateError can handle or correct the error, set AAction to uaRetry before exiting the error handler. Or consider other options.

The error handler can use the OldValue and NewValue properties TField to evaluate error conditions and set NewValue to a new value to reapply. In this case, set AAction to uaRetry before exiting.

The code in an OnUpdateError handler must not call any methods that make a different record the current one !

Syntax
property OnUpdateError: TADUpdateErrorEvent;
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord

Example
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;
What do you think about this topic? Send feedback!


TADDataSet.OnUpdateRecord Event

TADDataSet.OnUpdateRecord Event
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Occurs when record update is applying to a database.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Description

Use an OnUpdateRecord event handler to process immediate or cached updates that cannot be correctly or easily handled:

  • using FireDAC automatic SQL update command generation;
  • by a single table adapter component;
  • by a single update component.

This event is useful for applications that require:

  • additional control over parameters and macros substitution in update components;
  • multi SQL statement updates, when DBMS does not support batches or blocks;
  • non-SQL updates posting;
  • etc

ASender is the dataset to which updates are applied.

ARequest indicates whether the current update is the insertion, deletion or modification of a record.

AAction indicates the action taken by the OnUpdateRecord handler before it exits. On entry into the handler, AAction is always set to eaDefault. If OnUpdateRecord is successful, it should set AAction to eaApplied before exiting.

AAction value | Description
eaFail | Mark the update as failed and return an error.
eaSkip | Skip current update and do not mark it as applied.
eaRetry | Retry the current operation.
eaApplied | Mark current update as applied.
eaDefault | Take default action. For successful update it is eaApplied, for failed update it is eaFail.
eaExitSuccess | Stop to process the cached updates, return success.
eaExitFailure | Stop to process the cached updates, return failure.

The OnUpdateRecord event handler code should read the dataset field values, including TField.NewValue, OldValue and CurValue. There:

  • NewValue is the new field value before posting updates.
  • OldValue is the original field value, as it was after record fetching or after last updates applying.
  • CurValue is the current field value, the same as Value property.

Note, the OnUpdateRecord handler code must not call the methods that change the current dataset position.

Syntax
property OnUpdateRecord: TADUpdateRecordEvent;
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError

Example 1
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;
Example 2

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main
What do you think about this topic? Send feedback!


TADDataSet.ParentDataSet Property

TADDataSet.ParentDataSet Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns the reference to parent dataset, if this one is nested.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The ParentDataSet property returns reference to parent dataset, if this dataset is nested.

Syntax
property ParentDataSet: TADDataSet;
See Also

DB.TDataSetField

What do you think about this topic? Send feedback!


TADDataSet.RowError Property

TADDataSet.RowError Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Returns an exception object associated with the current dataset record.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use the RowError property to get an exception object associated with the current dataset record. If record does not have an error, then the value will be nil. The property is useful when CachedUpdates=True. It may be used together with FilterChanges and rtHasErrors.

Syntax
property RowError: EADException;
See Also

Caching Updates, CachedUpdates, FilterChanges

Example
var
  oErr: EADException;
...
if ADQuery1.ApplyUpdate > 0 then begin
  ADQuery1.FilterChanges := [rtModified, rtInserted, rtDeleted, rtHasErrors];
  ADQuery1.First;
  while not ADQuery1.Eof do begin
    oErr := ADQuery1.RowError;
    // process exception object
    ADQuery1.Next;
  end;
  ADQuery1.FilterChanges := [rtUnmodified, rtModified, rtInserted];
end;
What do you think about this topic? Send feedback!


TADDataSet.SavePoint Property

TADDataSet.SavePoint Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Gets / sets the change log version number.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Description

Use SavePoint to get the change log current version number. And later revert change log to the specified version number.

SavePoint may be used only in CachedUpdates mode. SavePoint's may be usefull for applications that use:

  • undo functionality. Although there is no standard ability to implement redo.
  • in-memory transactions.

Datasets can't return to a SavePoint once the change log has been backed out to a prior state. This includes:

  • undoing changes by setting SavePoint to a previously saved value;
  • backing out too many changes using the RevertRecord method;
  • clearing the change log using CancelUpdates or CommitUpdates.

Trying to set SavePoint to a state that is no longer available in the change log raises an exception.

Syntax
property SavePoint: Integer;
See Also

CachedUpdates, ChangeCount, UndoLastChange, RevertRecord, CancelUpdates

Example 1
var
  iSavePoint: Integer;
....
  // remember changes log state
  iSavePoint := ADMemTable1.SavePoint;
  try
    ADMemTable1.AppendRecord(....);
    ADMemTable1.AppendRecord(....);
    ADMemTable1.AppendRecord(....);
    ...
    ADMemTable1.Delete;
    // mark changes as persistent and clear change log
    ADMemTable1.CommitUpdates;
  except
    // in case of exception, undo changes
    ADMemTable1.SavePoint := iSavePoint;
    raise;
  end;
Example 2

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.

What do you think about this topic? Send feedback!


TADDataSet.SourceEOF Property

TADDataSet.SourceEOF Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Specifies if no more records to fetch from current cursor.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The SourceEOF property returns True, if there is no more records to fetch from current cursor.

Syntax
property SourceEOF: Boolean;
See Also

Next, FetchAll

What do you think about this topic? Send feedback!


TADDataSet.SourceView Property

TADDataSet.SourceView Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

The reference to DatS view object, by which rows the dataset is navigating.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

The SourceView property returns reference to TADDatSView object. The dataset is navigating on this view rows. The view is build by FireDAC automatically as result of applying of filters, indexes and ranges. The view will be destroyed after dataset closing.

Syntax
property SourceView: TADDatSView;
See Also

Table, View, uADDatSManager.TADDatSView

Example
var
  i, iVal, iMax: Integer;
....
// searching the maximum value of ID integer field, without navigating through dataset
iMax := 0;
for i := 0 to ADQuery1.SourceView.Rows.Count - 1 do
  if ADQuery1.SourceView.Rows[i].GetData('id', @iVal) and (iVal > iMax) then
    iMax := iVal;
What do you think about this topic? Send feedback!


TADDataSet.Table Property

TADDataSet.Table Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

The reference to DatS table object, actually representing the internal data storage.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

The Table property returns reference to TADDatSTable object. It is the internal data storage containing all dataset rows.

FireDAC creates table for each dataset automatically at Open. TADCustomMemTable allows to attach to existing table before Open call, using AttachTable method. If table was automatically created, then it will be destroyed after dataset closing.

As result of applying of filters, indexes and ranges, FireDAC builds views for this table object. All dataset navigation methods does not work with table, but with SourceView view object.

Syntax
property Table: TADDatSTable;
See Also

View, SourceView, AttachTable, TADCustomMemTable

Example
var
  i: Integer;
....
// delete all rows, where ID = 100, without navigating through dataset
for i := ADQuery1.Table.Rows.Count - 1 downto 0 do
  if ADQuery1.Table.Rows[i].GetData('id') = 100 then
    ADQuery1.Table.Rows[i].Delete;
ADQuery1.Resync([]);
What do you think about this topic? Send feedback!


TADDataSet.UpdatesPending Property

TADDataSet.UpdatesPending Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Indicates whether the changes log is not empty.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Examine UpdatesPending to check the status of the changes log. If UpdatesPending is true, then there are edited, deleted, or inserted records to apply to the database. If UpdatesPending is false, there are no records in the changes log.

Syntax
property UpdatesPending: Boolean;
See Also

Caching Updates, CachedUpdates, ChangeCount, ApplyUpdates, CommitUpdates, CancelUpdates

What do you think about this topic? Send feedback!


TADDataSet.View Property

TADDataSet.View Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

The reference to base DatS view object.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The View property returns reference to TADDatSView object. It is the base view object, specified as second argument to AttachTable method call. As result of applying of filters, indexes and ranges, FireDAC builds views above of this view object.

Syntax
property View: TADDatSView;
See Also

Table, SourceView, AttachTable, TADCustomMemTable

What do you think about this topic? Send feedback!


TADDataSet.AddIndex Method

TADDataSet.AddIndex Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Creates a new client index for the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
const AName: string | A name of the new index.
const AFields: string | A semicolon-delimited list of the fields to include in the index.
const AExpression: string | A sorting expression.
AOptions: TADSortOptions | A set of additional options for index.
const ADescFields: string = '' | A semicolon-delimited list of field names. Use ADescFields instead of an AOptions value that includes soDescending to create an index that is in ascending order on some fields and descending order on others. All fields named in ADescFields are sorted in descending order.
const ACaseInsFields: string = '' | A semicolon-delimited list of field names. Use ACaseInsFields instead of an AOptions value that includes soNoCase to create an index that is case-insensitive on some fields and case-sensitive on others. All fields named in ACaseInsFields are sorted without regard to case.
ADistinct: Boolean = False | A True, if you need to get only records with the distinct AFields / AExpression values. A False, if all records. False is the default value.
Description

Call AddIndex to create a new index for the client dataset.

The method corresponds to manual adding of new index to Indexes property and setting properties of new index. If index with AName name already exists, then exception will be raised. AField and AExpression properties are mutually exclusive. The new index will be active, but not current.

Syntax
procedure AddIndex(const AName: string; const AFields: string; const AExpression: string; AOptions: TADSortOptions; const ADescFields: string = ''; const ACaseInsFields: string = ''; ADistinct: Boolean = False);
See Also

Indexes

What do you think about this topic? Send feedback!


TADDataSet.ApplyMaster Method

TADDataSet.ApplyMaster Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Applies a master-detail relation to this detail dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Use the ApplyMaster method to synchronize this detail dataset with the current master record.

This method is useful, when DisableControls was called for the master dataset. Or scrolling is disabled by the MasterLink.DisableScroll.

Syntax
procedure ApplyMaster;
See Also

Master-Detail Relationship, TDataSet.DisableControls, TADMasterLink.DisableScroll, TADMasterLink.Synchronize

What do you think about this topic? Send feedback!


TADDataSet.ApplyRange Method

TADDataSet.ApplyRange Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Applies a range to the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use ApplyRange to actually filter dataset records using range values specified with SetRangeStart and SetRangeEnd, or EditRangeStart and EditRangeEnd method calls.

When a range is in effect, only those records that fall within the range are available to the application for navigating, viewing and editing. After a call to ApplyRange, the cursor is left on the first record in the range.

Syntax
procedure ApplyRange;
See Also

Filtering Records, CancelRange, EditRangeEnd, EditRangeStart, SetRange, SetRangeEnd, SetRangeStart, IsRanged

Example
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRangeStart;
ADQuery1['CUST_NO'] := '100';
ADQuery1.SetRangeEnd;
ADQuery1['CUST_NO'] := '200';
ADQuery1.ApplyRange;
What do you think about this topic? Send feedback!


TADDataSet.ApplyUpdates Method

TADDataSet.ApplyUpdates Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Applies changes for all records in the dataset change log to the database.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
AMaxErrors: Integer = -1 | A maximum number of allowed errors. Default value is -1.
Returns

The number of errors is encountered.

Description

Use ApplyUpdates to apply changes for all records in the dataset change journal to the database.

This method is useful when CachedUpdates = True mode. The ApplyUpdates call performs the steps:

  1. Fires a BeforeApplyUpdates event.
  2. Calls the data adapter to generate / use SQL update commands for each row and post changes to the database.
  3. Fires an AfterApplyUpdates event.
  4. Calls the dataset's Reconcile method to reconcile any records that has errors in step 2.
  5. If there were no errors, then calls CommitUpdates for the TADCustomMemTable descendants. For the TADRdbmsDataSet descendants (TADQuery, TADStoredProc, TADTable, etc), application should call Reconcile and CommitUpdates explicitly.

AMaxErrors indicates the maximum number of errors that the FireDAC should allow before prematurely stopping the update operation. Set AMaxErrors to –1 to indicate that there is no limit to the number of errors, or to 0 to indicate that no error is allowed.

ApplyUpdates returns the number of errors it encountered. Based on this return value and the setting of AMaxErrors, successfully applied records are removed from the dataset's change log. If the update process is aborted before all updates are applied, any unapplied updates remain in the change log.

ApplyUpdates does not raise exception. Instead application should review erroneous records using Reconcile and OnReconcileError event handler, or FilterChanges and RowError properties. Read "Reviewing errors" at Caching Updates for more details.

All changes are applied in the dataset modifications order. First modification (insert / update / delete) will be applied first, last modification will be applied last.

Syntax
function ApplyUpdates(AMaxErrors: Integer = -1): Integer;
See Also

Caching Updates, CachedUpdates, CancelUpdates, CommitUpdates, RowError, FilterChanges, Reconcile, UpdatesPending

Example 1
procedure TForm1.btnApplyClick(ASender: TObject);
begin
  if ADStoredProc1.UpdatesPending then
    ADStoredProc1.ApplyUpdates;
end;
Example 2

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.

What do you think about this topic? Send feedback!


TADDataSet.AttachTable Method

TADDataSet.AttachTable Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Attaches dataset to existing DatS table and optionaly view.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
ATable: TADDatSTable | A DatS table, storing data.
AView: TADDatSView | A DatS view, representing rows.
Description

Use the AttachTable method to attach dataset to existing DatS table and optionally view to navigate, visualize and edit their data using standard TDataSet interface. Call dataset Open method to activate dataset after attaching to DatS objects. Before call theyr structure must be filled in. To detach specified DatS objects from dataset, call AttachTable with nils.

The application is responsible for creation and destruction of specified table and view.

This method has meaning for TADCustomMemTable descendants only. And it is used internally only for other FireDAC datasets.

Syntax
procedure AttachTable(ATable: TADDatSTable; AView: TADDatSView); virtual;
See Also

Table, View, SourceView

Example
var
  oTab: TADDatSTable;
...
  oTab := TADDatSTable.Create;
  oTab.Columns.Add('id', dtInt32);
  oTab.Columns.Add('name').Size := 13;
  oTab.Columns.Add('cnt', dtInt16);
  oTab.Columns.Add('price', dtCurrency);
  ADMemTable1.Attach(oTab, nil);
  ADMemTable1.Open;
  // working with ADMemTable1
  ADMemTable1.AttachTable(nil, nil);
  oTab.Free;
What do you think about this topic? Send feedback!


TADDataSet.BeginBatch Method

TADDataSet.BeginBatch Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Optimizes dataset functionality for batch updates.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
AWithDelete: Boolean = False | True if after call application will also delete records.
Description

Use BeginBatch method to disable resources consuming operations and setup dataset to perform maximum fast updates. The BeginBatch call disables:

  • dataware controls updatings;
  • constraints updating;
  • aggregates maintaining;
  • wait cursor showing;
  • similar resources consuming processing in DatS objects, which is not controlled through dataset API;

If batch algorithm calls Delete method, then set AWithDelete to True. BeginBatch calls cannot be nested, although FireDAC will not raise exception on consequent calls. After finishing updates call EndBatch.

Syntax
procedure BeginBatch(AWithDelete: Boolean = False);
See Also

EndBatch

Example
ADQuery1.BeginBatch;
try
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ......
finally
  ADQuery1.EndBatch;
end;
What do you think about this topic? Send feedback!


TADDataSet.CancelRange Method

TADDataSet.CancelRange Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Cancels range for the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Use CancelRange to remove a range currently applied to a dataset.

Canceling a range re-enables access to all records in the dataset, excluding ones, that may be:

  • filtered out by Filtered / OnFilterRecord / FilterChanges;
  • filtered out by Indexes with Filter expression specified.
Syntax
procedure CancelRange;
See Also

Filtering Records, ApplyRange, EditRangeEnd, EditRangeStart, SetRange, SetRangeEnd, SetRangeStart, IsRanged

What do you think about this topic? Send feedback!


TADDataSet.CancelUpdates Method

TADDataSet.CancelUpdates Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Removes all records from the change log and restores the dataset rows to its prior editing state.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use CancelUpdates to remove all records from the change log, while the dataset is in CachedUpdates = True mode, and restore the dataset records to the state they was in when the dataset was opened, cached updates were last enabled, or updates were last successfully applied to the database.

When a dataset is closed, or the CachedUpdates property is set to false, CancelUpdates is called automatically.

Note, to undo changes to a single record, call RevertRecord.

Syntax
procedure CancelUpdates;
See Also

Caching Updates, ApplyUpdates, CachedUpdates, CommitUpdates, UndoLastChange, SavePoint

Example

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.

What do you think about this topic? Send feedback!


TADDataSet.CloneCursor Method

TADDataSet.CloneCursor Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Shares the data belonging to another dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
ASource: TADDataSet | A source dataset to clone.
AReset: Boolean = False | A flag to reset properties for this dataset.
AKeepSettings: Boolean = False | A flag to keep current setting for this dataset.
Description

Use CloneCursor to share the data belonging to another dataset with this dataset. After calling CloneCursor, the internal data storage is physically the same and shared for this dataset and for a ASource dataset.

ASource references to a dataset whose data will be shared with this one.

AReset and AKeepSettings determine how to set the values of the following properties and events:

  • Filter, Filtered, FilterOptions, OnFilterRecord and FilterChanges;
  • IndexName, IndexFieldNames;
  • MasterSource and MasterFields;
  • ReadOnly.

If AReset and AKeepSettings are both False, the values of the properties listed above are all set to match the source dataset.

If AReset is True, the properties listed above are all set to the default values.

If AReset is False and AKeepSettings is True, the properties listed above are not changed. In this case, the application must ensure that existing indexes, filters, and so on are compatible with the cloned data.

CloneCursor does not clone:

  • persistent fields;
  • adapter / update object;
  • event handlers, excluding OnFilterRecord.
Syntax
procedure CloneCursor(ASource: TADDataSet; AReset: Boolean = False; AKeepSettings: Boolean = False); virtual;
See Also

Data

Example 1
ADMemTable1.CloneCursor(ADQuery1, True, False);
ADMemTable1.Locate(...);
ADMemTable1.Edit;
...
Example 2

See FireDAC\Samples\Comp Layer\TADMemTable\CloneCursor sample for details.

What do you think about this topic? Send feedback!


TADDataSet.CommitUpdates Method

TADDataSet.CommitUpdates Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Clears the changes log and marks all records as not modified.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Call CommitUpdates to clear the dataset changes log, working in CachedUpdates = True mode, after both a successful call to ApplyUpdates and a database component's Commit method. And marks all dataset record as unchanged.

Applications that use a connection component's ApplyUpdates method to apply and commit pending updates for all datasets associated with the database component do not need to call CommitUpdates.

Syntax
procedure CommitUpdates;
See Also

CachedUpdates, UpdatesPending, OnUpdateError, OnUpdateRecord, ApplyUpdates, CancelUpdates

What do you think about this topic? Send feedback!


TADDataSet.CopyDataSet Method

TADDataSet.CopyDataSet Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Copies records from source dataset to this dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
ASource: TDataset | A source dataset.
AOptions: TADCopyDataSetOptions = [coRestart, coAppend] | A copy options. The default value is [coRestart, coAppend].
Description

Use the CopyDataSet method to copy the records from an ASource dataset to this dataset.

The method performs steps:

  • copies ASource dataset structure into Self dataset, if coStructure is in AOptions, and:
    • copies ASource dataset indexes setup into Self dataset, if coIndexesCopy is in AOptions. Or resets Self indexes setup, if coIndexesReset is in AOptions;
    • copies ASource dataset aggregates setup into Self dataset, if coAggregatesCopy is in AOptions. Or resets Self aggregates setup, if coAggregatesReset is in AOptions;
    • copies ASource dataset constraints setup into Self dataset, if coConstraintsCopy is in AOptions. Or resets Self constraints setup, if coConstraintsReset is in AOptions;
  • opens Self dataset, if it is inactive;
  • sets a ASource to a beginning, if soRestart is in AOptions;
  • for each record in ASource do:
    • if coEdit is in AOptions, then locate corresponding record in Self dataset, using primary key field values;
    • if coAppend is in AOptions, then append new record to Self dataset;
    • copies all fields, which names exists in both datasets and which are modifiable. If ASource field is not found in this dataset, then it will be skipped. It is important that fields with the same name in both datasets must be compatible by data types. The CopyDataSet method does not verify, that fields are assignment compatible.
    • post the record change and select next record in ASource.

Use coRefresh instead of coEdit to change records only in a local cache. And do not post changes to a database. This option may be used to refresh this dataset using records from ASource dataset.

This method is similar to assigning to Data property. The differences are:

  • CopyDataSet can copy from non-FireDAC dataset. Data property allows to copy data only from an FireDAC dataset.
  • CopyDataSet works through TDataSet API, firing appropriate events. Data property works through DatS API, no events are fired.
  • CopyDataSet copies only current field values. Data property copies all record field versions and preserves row state (inserted, deleted, updated or unchanged).
  • Assigning to Data is much faster, than CopyDataSet.
Syntax
procedure CopyDataSet(ASource: TDataset; AOptions: TADCopyDataSetOptions = [coRestart, coAppend]);
See Also

CopyRecord, Data, TADDataMove

Example
// copies dataset structure and all records
ADMemTable1.CopyDataSet(Query1, [coStructure, coRestart, coAppend]);

// refreshed dataset data using records from ADQuery2 dataset. If a record is not found, then it will be appended
ADQuery1.CopyDataSet(ADQuery2, [coRestart, coRefresh, coAppend]);
What do you think about this topic? Send feedback!


TADDataSet.CopyRecord Method

TADDataSet.CopyRecord Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Copies all record fields from source dataset to the Self dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
ASource: TDataset | A source dataset.
Description

Use CopyRecord method to copy the current record field values from an ASource dataset to the Self dataset. The method copies all fields, for which the following requirements are met:

  • the names exists in both datasets;
  • a field in the Self dataset is not calculated;
  • a field in the Self dataset is not read-only.

It is important that fields with the same name in both datasets must be compatible by data types. The CopyRecord method does not verify, that fields are assignment compatible.

Syntax
procedure CopyRecord(ASource: TDataset);
See Also

CopyDataSet, Data, TADDataMove

What do you think about this topic? Send feedback!


TADDataSet.CreateDataSet Method

TADDataSet.CreateDataSet Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Creates new empty internal data storage for dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use CreateDataSet at runtime to create a empty internal data storage for dataset and activate dataset.

After call application may populate dataset by data and optionally save data to the external file. Optionally dataset may be created setting Active to True.

If the FieldDefs property contains items, then these values are used to create field definitions. Otherwise the Fields property is used. One or both of these properties must contain values in order to create a dataset. If neither property is set, CreateDataSet raises an exception.

The method is not applicable for all FireDAC datasets, but for TADCustomMemTable.

Syntax
procedure CreateDataSet;
See Also

TDataSet.FieldDefs, TDataSet.Fields, TADCustomMemTable

Example
with ADMemTable1 do begin
  FieldDefs.Add('ID', ftAutoInc);
  FieldDefs.Add('Code', ftString, 10);
  FieldDefs.Add('Name', ftString, 50);
  CreateDataSet;
  // here dataset is active, has 3 fields and is empty
end;
What do you think about this topic? Send feedback!


TADDataSet.CreateExpression Method

TADDataSet.CreateExpression Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Creates expression evaluator for dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AExpr: String | A expression to evaluate.
AOptions: TADExpressionOptions = [] | An evaluator options.
Returns

The evaluator interface reference.

Description

Use CreateExpression method to translate string, containing expression, into binary representation and create expression evaluator. The expression may contain field names from this dataset. To create evaluator, dataset must be active.

The method returns evaluator, which may be used few times to effectively evaluate specified expression, by calling its Evaluate method. The evaluator is associated with current record. After position is changed, application must adjust evaluator:

  oEval.DataSource.Position := ADMemTable1.GetRow;

The evaluator is reference counted interface. You does not need to free it explicitly. All references to evaluator must be released before dataset will be closed.

The expressions cannot contain aggregating functions, like a SUM, COUNT. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write expressions.

Syntax
function CreateExpression(const AExpr: String; AOptions: TADExpressionOptions = []): IADStanExpressionEvaluator;
See Also

Writing Expressions, GetRow, Aggregates, Constraints, Indexes

Example
var
  oEval: IADStanExpressionEvaluator;
...
oEval := ADMemTable1.CreateExpresison('(sal + comm) * tax / 100');
Label1.Caption := oEval.Evaluate;
...
ADMemTable1.Next;
oEval.DataSource.Position := ADMemTable1.GetRow;
Label1.Caption := oEval.Evaluate;
...
oEval := nil;
ADMemTable1.Close;
What do you think about this topic? Send feedback!


TADDataSet.DeleteIndex Method

TADDataSet.DeleteIndex Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Deletes an client index for the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
const AName: string | An index name.
Description

Call DeleteIndex to remove an client index for a dataset from Indexes property.

AName is the name of the index to delete. If index is not found in Indexes, then exception will be riased.

Syntax
procedure DeleteIndex(const AName: string);
See Also

Indexes, AddIndex, DeleteIndexes

What do you think about this topic? Send feedback!


TADDataSet.DeleteIndexes Method

TADDataSet.DeleteIndexes Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Deletes all client indexes for the dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Call DeleteIndexes to remove all client indexes for a dataset from Indexes property.

Syntax
procedure DeleteIndexes;
See Also

Indexes, AddIndex, DeleteIndex

What do you think about this topic? Send feedback!


TADDataSet.DisableConstraints Method

TADDataSet.DisableConstraints Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Disables the enforcement of the client constraints.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use DisableConstraints to turn off an enforcement of the client constraints that are in Constraints property (record constraints) or are assigned to the dataset fields (field constraints).

Calling DisableConstraints increments an internal counter. As long as this reference count is greater than zero, constraints are disabled for the dataset. To prevent accidental disabling of constraints, always group a call to DisableConstraints with a call to EnableConstraints.

If application needs to perform batch updates to dataset, then consider to use BeginBatch / EndBatch methods.

Syntax
procedure DisableConstraints;
See Also

EnableConstraints, Constraints, ConstraintsEnabled, UpdateConstraints

Example
ADQuery1.DisableConstraints;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.EnableConstraints;
end;
What do you think about this topic? Send feedback!


TADDataSet.Disconnect Method

TADDataSet.Disconnect Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public Send Feedback

Use Disconnect method to release DBMS resources, used by this dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public
Parameters
Parameters | Description
AAbortJob: Boolean = False | If True, then method will abort current operation.
Description

The Disconnect method optionally abort current operation and releases DBMS resources, used by this dataset. After the call dataset is in dsInactive state. And descendants will have Prepared = False.

Syntax
procedure Disconnect(AAbortJob: Boolean = False); virtual;
Example
ADQuery1.SQL.Text := 'select * from [Order Details]';
ADQuery1.Prepare := True;
ADQuery1.Active := True;
ADQuery1.Disconnect;
// Active = False and Prepare = False
What do you think about this topic? Send feedback!


TADDataSet.EditKey Method

TADDataSet.EditKey Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Enables modification of the search key buffer.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use EditKey to put the dataset into dsSetKey state, preserving the current contents of the search key buffer.

After call the application can modify indexed fields. To iterate through them use IndexFieldCount and IndexFields properties. Optionally may be edited value of KeyFieldCount and/or KeyExclusive properties.

Syntax
procedure EditKey;
See Also

Finding a Record, IndexFields, FindKey, GotoKey, GotoNearest, SetKey, TDataSet.State, KeyFieldCount, KeyExclusive

Example
ADQuery1.IndexFieldNames := 'CUSTOMER_ID;ORDER_DATE';
...
ADQuery1.EditKey;
ADQuery1.FieldByName('ORDER_DATE').AsDateTime := EncodeDate(2008, 5, 2);
if not ADQuery1.GotoKey then
  ShowMesage('Order is not found');
What do you think about this topic? Send feedback!


TADDataSet.EditRangeEnd Method

TADDataSet.EditRangeEnd Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Enables changing the ending value for an existing range.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Call EditRangeEnd to bring the dataset to the dsSetKey state and change the ending value for an existing range.

After call the application can modify indexed fields. To iterate through them use IndexFieldCount and IndexFields properties. Optionally may be edited value of KeyFieldCount and/or KeyExclusive properties.

After assigning a new ending value, call ApplyRange to activate the modified range.

Syntax
procedure EditRangeEnd;
See Also

Filtering Records, ApplyRange, CancelRange, EditRangeStart, IndexFieldNames, IndexName, KeyExclusive, SetRange, SetRangeEnd, SetRangeStart

Example
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRangeStart;
ADQuery1['CUST_NO'] := 100;
ADQuery1.SetRangeEnd;
ADQuery1['CUST_NO'] := 200;
ADQuery1.ApplyRange;
......
ADQuery1.EditRangeEnd;
ADQuery1['CUST_NO'] := ADQuery1['CUST_NO'] - 1;
ADQuery1.ApplyRange;
What do you think about this topic? Send feedback!


TADDataSet.EditRangeStart Method

TADDataSet.EditRangeStart Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Enables changing the starting value for an existing range.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Call EditRangeStart to bring dataset to the dsSetKey state and change the starting value for an existing range.

After call the application can modify indexed fields. To iterate through them use IndexFieldCount and IndexFields properties. Optionally may be edited value of KeyFieldCount and/or KeyExclusive properties.

After assigning a new ending value, call ApplyRange to activate the modified range.

Syntax
procedure EditRangeStart;
See Also

Filtering Records, ApplyRange, CancelRange, EditRangeEnd, IndexFieldNames, IndexName, KeyExclusive, SetRange, SetRangeEnd, SetRangeStart

Example
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRangeStart;
ADQuery1['CUST_NO'] := 100;
ADQuery1.SetRangeEnd;
ADQuery1['CUST_NO'] := 200;
ADQuery1.ApplyRange;
......
ADQuery1.EditRangeStart;
ADQuery1['CUST_NO'] := ADQuery1['CUST_NO'] + 1;
ADQuery1.ApplyRange;
What do you think about this topic? Send feedback!


TADDataSet.EmptyDataSet Method

TADDataSet.EmptyDataSet Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Removes all records from the dataset internal data storage.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Call EmptyDataSet to empty the dataset by removing all records from internal data storage and changes log.

Syntax
procedure EmptyDataSet;
See Also

Table, TDataSet.Delete

What do you think about this topic? Send feedback!


TADDataSet.EnableConstraints Method

TADDataSet.EnableConstraints Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Reenables enforcement of the client constraints when records are posted.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Call EnableConstraints to turn on the client constraints previously disabled by a call to DisableConstraints.

Calling EnableConstraints decrements a reference count. When this reference count is zero constraints are enabled for the dataset. To prevent accidental disabling of constraints, always follow a call to DisableConstraints with a matching call to EnableConstraints.

Syntax
procedure EnableConstraints;
See Also

DisableConstraints, Constraints, ConstraintsEnabled, UpdateConstraints

Example
ADQuery1.DisableConstraints;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.EnableConstraints;
end;
What do you think about this topic? Send feedback!


TADDataSet.EndBatch Method

TADDataSet.EndBatch Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Restores normal dataset functionality after batch updates.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use EndBatch method to reenable dataset processing as it was before BeginBatch call.

Syntax
procedure EndBatch;
See Also

BeginBatch

Example
ADQuery1.BeginBatch;
try
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ......
finally
  ADQuery1.EndBatch;
end;
What do you think about this topic? Send feedback!


TADDataSet.Execute Method

TADDataSet.Execute Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Executes an SQL command.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
ATimes: Integer = 0 | A parameters array size.
AOffset: Integer = 0 | A offset in parameters array.
Description

Call Execute to execute a SQL statement currently assigned to descendant class properties:

  • TADCustomQuery.SQL;
  • TADCustomStoredProc.StoredProcName;
  • TADCustomMemTable.Adapter.SelectCommand.CommandText. Or command assigned to TADCustomCommand.CommandText of command object. Which is assigned to TADCustomTableAdapter.SelectCommand. And adapter object is assigned to TADAdaptedDataSet.Adapter.

Use Execute to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, CREATE TABLE, CALL, BEGIN .. END, etc). For SELECT statements and others, returning cursors, call Open instead of Execute.

Execute prepares the SQL statement for execution, if it has not already been prepared. To speed performance, an application should ordinarily call Prepare method before calling Execute for the first time.

Use ResourceOptions.CmdExecMode to control asynchronous execution mode. And ResourceOptions.CmdExecTimeout to set maximum command execution time. After that time command execution will be canceled and exception raised.

To cancel command execution use AbortJob.

Before command execution the BeforeExecute event is fired. If server will return command execution error, then FireDAC raises an exception. It may be analyzed in OnError event. After command execution is finished, any output parameters are put into Params property and AfterExecute event is fired.

If ATimes is equal to zero or one, then command is executing in standard mode, otherwise in Array DML mode. See Array DML article for details. By default ATimes and AOffset are equal to 0. ATimes specifies parameters array size. AOffset specifies from which row index in parameters array Array DML command execution should be started. ATimes must be less or equal to Params.ArraySize, otherwise exeception will be raised.

After command execution application may check RowsAffected property value to see how much database records were affected by last command execution.

Syntax
procedure Execute(ATimes: Integer = 0; AOffset: Integer = 0); virtual;
See Also

Executing Command, Array DML, TADCustomQuery.SQL, TADCustomQuery.ExecSQL, TADCustomStoredProc.StoredProcName, TADCustomStoredProc.ExecProc, TADAdaptedDataSet.AbortJob, TADCustomMemTable.Adapter, TADRdbmsDataSet.Prepare, TADRdbmsDataSet.OnError, BeforeExecute, AfterExecute

Example 1
var
  i: Integer;
....
ADQuery1.SQL.Text := 'insert into mytab values (:p1, :p2)';
ADQuery1.Params.ArraySize := 10;
for i := 0 to ADQuery1.Params.ArraySize - 1 do begin
  ADQuery1.Params[0].AsIntegers[i] := i;
  ADQuery1.Params[1].AsStrings[i] := 'qwe';
end;
ADQuery1.Execute(ADQuery1.Params.ArraySize, 0);
Example 2

See demos for details:

  • FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\Batch;
  • FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\BatchErrorHandling.
What do you think about this topic? Send feedback!


TADDataSet.FetchAgain Method

TADDataSet.FetchAgain Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Allows to fetch additional records.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Call FetchAgain method to reset "all-data-fetched" flag - SourceEOF. This is useful for TADCustomMemTable linked to table adapter and allows to fetch few result sets with the same structure into single dataset. After calling FetchAgain TADCustomTableAdapter.SelectCommand must be re-executed with different parameter values.

The similar thing may be performed for TADCustomQuery or TADCustomStoredProc, for example. Just must be reexecuted internal command object TADAdaptedDataSet.Command.

Syntax
procedure FetchAgain;
See Also

FetchAll, TDataSet.Open, TADCustomCommand, TADCustomTableAdapter

Example
// set SQL command
ADCommand1.CommandText := 'select * from orders where customerid = :cid';
// link command to table adapter
ADTableAdapter1.SelectCommand := ADCommand1;
// link table adapter to memtable
ADMemTable1.Adapter := ADTableAdapter1;

// set SQL command parameter value, then execute command and fetch all records
ADCommand1.Params[0].AsInteger := 100;
ADMemTable1.Open;
ADMemTable1.FetchAll;

// reset SourceEOF flag, reexecute command by hands and fetch all records
ADMemTable1.FetchAgain;
ADCommand1.Close;
ADCommand1.Params[0].AsInteger := 200;
ADCommand1.Open;
ADMemTable1.FetchAll;

// here we will have in memtable orders for customers with ID=100 and ID=200
What do you think about this topic? Send feedback!


TADDataSet.FetchAll Method

TADDataSet.FetchAll Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Retrieves all records from the current resultset and stores them into internal DatS table.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Call FetchAll to retrieve all not yet fetched records from current resultset. Calling FetchAll allows:

  • to release server resources faster, because FetchAll implicitly closes DBMS cursor. That does not deactivate dataset.
  • to release Call Level Interface result set buffer, allowing to execute next command and get result set. That is applicable for some DBMS's, like a SQL Server and MySQL.

If to set FetchOptions.Mode to fmAll, then dataset automatically calls FetchAll on Open call.

Syntax
procedure FetchAll;
See Also

TADFetchOptions.Mode, TDataSet.Open

What do you think about this topic? Send feedback!


TADDataSet.FetchBlobs Method

TADDataSet.FetchBlobs Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Retrieves BLOB field values from database for current record.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Call FetchBlobs to retrieve BLOB field values from a database for current dataset record, when these values are not provided automatically. BLOB field values are automatically fetched together with other record fields, if fiBlobs is included into FetchOptions.Items, otherwise - not.

Syntax
procedure FetchBlobs;
See Also

TADFetchOptions.Items

Example
ADQuery1.FetchOptions.Items := ADQuery1.FetchOptions.Items - [fiBlobs];
ADQuery1.Open;
....
ADQuery1.FetchBlobs;
oStr := ADQuery1.CreateBlobStream(ADQuery1.FieldByName('image'), bmRead);
try
  // process image
finally
  oStr.Free;
end;
What do you think about this topic? Send feedback!


TADDataSet.FetchDetails Method

TADDataSet.FetchDetails Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Retrieves nested datasets from database for current record.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
ADataSetField: TDataSetField = nil | A field, whos nested dataset to fetch.
Description

Call FetchDetails to retrieve nested datasets from a database for current dataset record, when these dataset are not provided automatically. Nested dataset are automatically fetched together with other record fields, if fiDetails is included into FetchOptions.Items, otherwise - not.

If ADataSetField is specified, then FireDAC fetches nested dataset only for these field. Otherwise - all nested datasets.

Syntax
procedure FetchDetails(ADataSetField: TDataSetField = nil);
See Also

TADFetchOptions.Items

What do you think about this topic? Send feedback!


TADDataSet.FetchNext Method

TADDataSet.FetchNext Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

A shortcut to the GetNextPacket method.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Use the FetchNext method to fetch the next rowset from the DBMS. See GetNextPacket method description for more details.

Syntax
function FetchNext: Integer;
See Also

GetNextPacket

What do you think about this topic? Send feedback!


TADDataSet.FindKey Method

TADDataSet.FindKey Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Searches for a record containing specified index field values.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AKeyValues: array of const | An open array of values to search.
Returns

True, if key is found. Otherwise - False.

Description

Use FindKey to search for the record in an indexed dataset, using specified index field values.

AKeyValues is an open array containing field values, called a key. Each value in the key can be a literal, a variable or nil. If the number of values passed in AKeyValues is less than the number of columns in the index used for the search, the missing values are assumed to be NULL.

If a search is successful, FindKey positions the cursor on the matching record and returns True. Otherwise the cursor is not moved, and FindKey returns False.

Syntax
function FindKey(const AKeyValues: array of const): Boolean;
See Also

Finding a Record, FindNearest, GotoKey, GotoNearest, IndexName, IndexFieldNames, Locate

Example
ADQuery1.IndexFieldNames := 'F1;F2';
if not ADQuery1.FindKey([100, 'qwe']) then
  ShowMessage('100;qwe is not found');
What do you think about this topic? Send feedback!


TADDataSet.FindNearest Method

TADDataSet.FindNearest Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Searches for a record containing specified index field values.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AKeyValues: array of const | An open array of values to search.
Description

Use FindNearest to search for the record in an indexed dataset, using specified index field values.

AKeyValues is an open array containing field values, called a key. Each value in the key can be a literal, a variable or nil. If the number of values passed in AKeyValues is less than the number of columns in the index used for the search, the missing values are assumed to be NULL.

If a search is successful, FindNearest positions the cursor on the matching record and returns True. Otherwise, positions the cursor on the record that is greater than specified key.

Syntax
procedure FindNearest(const AKeyValues: array of const);
See Also

Finding a Record, FindKey, GotoKey, GotoNearest, IndexName, IndexFieldNames, Locate

Example
ADQuery1.IndexFieldNames := 'F1;F2';
ADQuery1.FindNearest([100, 'qwe']);
What do you think about this topic? Send feedback!


TADDataSet.FindParam Method

TADDataSet.FindParam Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Finds the parameter in Params property by a given name.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
const AValue: string | A parameter name to find.
Returns

Parameter, if found, Otherwise - nil.

Description

Use FindParam to find a parameter by a AValue name in the Params collection.

If a parameter is not found, FindParam returns nil values.

Syntax
function FindParam(const AValue: string): TADParam;
See Also

Params, ParamByName

What do you think about this topic? Send feedback!


TADDataSet.GetColumnField Method

TADDataSet.GetColumnField Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns field corresponding to DatS column.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
AColumn: TADDatSColumn | A DatS column.
Returns

A field, if column is found. Otherwise - nil.

Description

Use GetColumnField to get field object, corresponding to specified DatS column. A column must belong to dataset internal DatS table. If column is not found, then method returns nil.

Syntax
function GetColumnField(AColumn: TADDatSColumn): TField;
See Also

GetFieldColumn

What do you think about this topic? Send feedback!


TADDataSet.GetDetailLinkFields Method

TADDataSet.GetDetailLinkFields Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Lists the field objects that link this dataset as a detail of a master dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
AMasterFields: TADFieldList | A list of master fields.
ADetailFields: TADFieldList | A list of detail fields.
Description

GetDetailLinkFields fills the two lists with field objects that define a master-detail relationship between this dataset and master dataset. The AMasterFields list is filled with fields from the master dataset, whose values must be equal to the values of the fields in the ADetailFields list. The ADetailFields list is filled with fields from this dataset.

Syntax
procedure GetDetailLinkFields(AMasterFields: TADFieldList; ADetailFields: TADFieldList); override;
See Also

Master-Detail Relationship

What do you think about this topic? Send feedback!


TADDataSet.GetFieldColumn Method

TADDataSet.GetFieldColumn Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns DatS column corresponding to field.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
AField: TField | A field.
Returns

A column, if field is found. Otherwise - nil.

Description

Use GetFieldColumn to get DatS column object, corresponding to specified field. If field is not found, then method returns nil.

Syntax
function GetFieldColumn(AField: TField): TADDatSColumn; overload;
See Also

Master-Detail Relationship, GetColumnField

What do you think about this topic? Send feedback!


TADDataSet.GetGroupState Method

TADDataSet.GetGroupState Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Indicates where the current record sits within a specified group of records.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
ALevel: Integer | A grouping level.
Returns

The set of position markers.

Description

Call GetGroupState to determine where the current record falls in the group of records specified by the ALevel parameter.

ALevel identifies a group by its grouping level on the current index. Grouping level 1 is the set of records with the same value on the first field in the index. Grouping level 2 is the set of records with the same values on the first two fields in the index, and so on.

GetGroupState returns one of the following values:

Value
Meaning
[gbMiddle]
The current record is neither the first nor the last in the group.
[gbFirst]
The current record is the first in the group, which contains at least two records.
[gbLast]
The current record is the last in the group, which contains at least two records.
[gbFirst,gbLast]
The current record is the only record in the group.
[]
  • ALevel specifies a grouping level greater, than the GroupingLevel property.
  • dataset is in one of the states [dsInactive, dsOpening, dsInsert, dsSetKey]
  • AggregatesActive = False
  • IndexName is empty
Syntax
function GetGroupState(ALevel: Integer): TGroupPosInds;
See Also

GroupingLevel, IndexName, AggregatesActive

What do you think about this topic? Send feedback!


TADDataSet.GetIndexNames Method

TADDataSet.GetIndexNames Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Fills the list by client index names.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
AList: TStrings | A list to fill.
Description

Call GetIndexNames to fill AList by client index names.

Syntax
procedure GetIndexNames(AList: TStrings);
See Also

IndexDefs, Indexes

What do you think about this topic? Send feedback!


TADDataSet.GetNextPacket Method

TADDataSet.GetNextPacket Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Fetches the next rowset from the DBMS.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Returns

The number of fetched records.

Description

Call GetNextPacket to fetch the next rowset from a DBMS cursor.

To specify the maximum number of records to return in a rowset, set the FetchOptions.RowsetSize property before calling GetNextPacket. A rowset is appended to those records already stored in the internal data storage.

GetNextPacket returns the number of records fetched. If the return value is less than FetchOptions.RowsetSize, the dataset has already received all available records from the DBMS cursor.

Use GetNextPacket for manual fetching mode, when FetchOptions.Mode = fmManual.

Syntax
function GetNextPacket: Integer;
See Also

TDataSet.Open, TADFetchOptions.Mode, TADFetchOptions.RowsetSize

Example
ADQuery1.FetchOptions.Mode := dmManual;
ADQuery1.SQL.Text := 'select * from mytab';
ADQuery1.Open;
// here RecordCount = 0
ADQuery1.GetNextPacket;
// here RecordCount <= FetchOptions.RowsetSize
What do you think about this topic? Send feedback!


TADDataSet.GetParentRow Method

TADDataSet.GetParentRow Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns parent row of this nested dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Returns

The DatS row or nil.

Description

Call GetParentRow method to get reference to parent row for this nested dataset.

Syntax
function GetParentRow: TADDatSRow;
See Also

ParentDataSet

What do you think about this topic? Send feedback!


TADDataSet.GetRow Method

TADDataSet.GetRow Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Returns DatS row.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
ABuffer: PADBuffer = C_NIL | A dataset record buffer or nil (default).
AForceBufferRead: Boolean = False | Set to False (default).
Returns

A DatS row.

Description

Call GetRow method to get DatS row object for specified dataset record buffer or for current record.

If ABuffer specified, then FireDAC takes assocciated row object from it. Otherwise it uses TDataSet.ActiveBuffer value, which corresponds to current position in dataset.

Syntax
function GetRow(ABuffer: PADBuffer = C_NIL; AForceBufferRead: Boolean = False): TADDatSRow;
See Also

TADDatSRow, TDataSet.ActiveBuffer

Example
var
  oRow: TADDatSRow;
.....
oRow := ADQuery1.GetRow;
// cancel all changes for this row
oRow.RejectChanges;
What do you think about this topic? Send feedback!


TADDataSet.GotoCurrent Method

TADDataSet.GotoCurrent Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Sets the current record in this dataset the same as the current record in another, cloned dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
ADataSet: TADDataSet | A dataset to synchronize with.
Description

Use GotoCurrent to position the cursor on the same record that is current in the specified dataset.

ADataSet is the cloned dataset whose cursor position will be used to position on the record in this dataset. GotoCurrent is only useful for synchronizing two cloned datasets that use separate data sources to view and edit the same data.

Syntax
procedure GotoCurrent(ADataSet: TADDataSet);
See Also

CloneCursor

What do you think about this topic? Send feedback!


TADDataSet.GotoKey Method

TADDataSet.GotoKey Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Searches for a record, using values in the key buffer.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Returns

True, if key is found. Otherwise - False.

Description

Use GotoKey to search for a record, using values assigned to the indexed fields after previous call of SetKey / EditKey.

Before call dataset must be in dsSetKey state. If GotoKey finds a record, it makes it current record in the dataset and returns True. Otherwise the current position remains unchanged, and GotoKey returns False.

Syntax
function GotoKey: Boolean;
See Also

Finding a Record, FindKey, FindNearest, GotoNearest, SetKey, Locate

Example
ADQuery1.IndexFieldNames := 'CUSTOMER_ID;ORDER_DATE';
ADQuery1.SetKey;
ADQuery1.FieldByName('CUSTOMER_ID').AsInteger := 100;
ADQuery1.FieldByName('ORDER_DATE').AsDateTime := EncodeDate(2008, 5, 1);
if not ADQuery1.GotoKey then
  ShowMesage('Order is not found');
What do you think about this topic? Send feedback!


TADDataSet.GotoNearest Method

TADDataSet.GotoNearest Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Searches for a closest record, using values in the key buffer.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use GotoNearest to search for a record, using values assigned to the indexed fields after previous call of SetKey / EditKey.

Before call dataset must be in dsSetKey state. If GotoNearest finds a record, it makes it current record in the dataset. Otherwise the first record with greater values, than the specified values, becomes current record in the dataset.

Syntax
procedure GotoNearest;
See Also

Finding a Record, FindKey, FindNearest, GotoKey, SetKey, Locate

Example
ADQuery1.IndexFieldNames := 'CUSTOMER_ID;ORDER_DATE';
ADQuery1.SetKey;
ADQuery1.FieldByName('CUSTOMER_ID').AsInteger := 100;
ADQuery1.FieldByName('ORDER_DATE').AsDateTime := EncodeDate(2008, 5, 1);
ADQuery1.GotoNearest;
What do you think about this topic? Send feedback!


TADDataSet.IsIndexed Method

TADDataSet.IsIndexed Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns True, if dataset has current client index.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Returns

True, if indexed.

Description

Use IsIndexed to determine, if this dataset has current client index set by IndexFieldNames or IndexName properties.

Syntax
function IsIndexed: Boolean;
See Also

IndexFieldNames, IndexName

What do you think about this topic? Send feedback!


TADDataSet.IsLinked Method

TADDataSet.IsLinked Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns True, if dataset is linked to another dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Returns

True, if is linked.

Description

Use IsLinked to determine, if this dataset is nested dataset or detail dataset.

Syntax
function IsLinked: Boolean;
See Also

Master-Detail Relationship, MasterSource, ParentDataSet

What do you think about this topic? Send feedback!


TADDataSet.IsRanged Method

TADDataSet.IsRanged Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns True, whether the dataset records are limited by a range.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The IsRanged property returns True, if dataset has range applied using ApplyRange call. When a range is in effect, only those records that fall within the range are available to the application for viewing and editing.

Syntax
function IsRanged: Boolean;
See Also

Filtering Records, ApplyRange, CancelRange

What do you think about this topic? Send feedback!


TADDataSet.LoadFromFile Method

TADDataSet.LoadFromFile Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Loads a dataset's data from a file.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AFileName: String = '' | A file name to load.
AFormat: TADStorageFormat = sfAuto | A file format. Default value is sfAuto.
Description

Use LoadFromFile to populate the dataset with data stored in an external file. The data is not moved to a database, but just loaded into a dataset in-memory storage.

AFileName is the name of the file containing the data to load. If file does not exists, then exception is raised.

AFormat is the file format:

  • sfXML - file is well formed standalone XML file;
  • sfBinary - file is binary file with custom FireDAC format;
  • sfAuto - format is determined by AFileName extention: ".XML" - XML file, ".ADB" / ".BIN" / ".DAT" - binary file. If AFileName does not have an extention, then format is determined by ResourceOptions.DefaultStoreExt if it is specified, otherwise by ResourceOptions.DefaultStoreFormat.

As option, you can specify ResourceOptions.PersistentFileName and call Open, then dataset data is loaded from specified file. And at Close will be saved back, if data was modified.

AFileName must contain data saved to a file by a previous call to this or another client dataset's SaveToFile method. After call dataset is active.

LoadFromFile tries to load from the file the items specified by the ResourceOptions.StoreItems. If the file was written with different StoreItems value, then exception will be raised likes this:

[FireDAC][Stan]-712 Cannot read [Relationlist] object
Syntax
procedure LoadFromFile(const AFileName: String = ''; AFormat: TADStorageFormat = sfAuto);
See Also

LoadFromStream, SaveToFile, TADResourceOptions.DefaultStoreExt, TADResourceOptions.DefaultStoreFormat, TADBottomResourceOptions.PersistentFileName

Example
ADQuery1.Open('select * from customers');
ADQuery1.FetchAll;
ADQuery1.SaveToFile('c:\customers.xml', sfAuto);
....
ADMemTable1.LoadFromFile('c:\customers.xml', sfAuto);
ADMemTable1.Locate('CUSTOMER_ID', [100], []);
What do you think about this topic? Send feedback!


TADDataSet.LoadFromFileAtOpen Method

TADDataSet.LoadFromFileAtOpen Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns True, if dataset content will be loaded from file at Open.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Returns

True, if content will be loaded from file at Open.

Description

Use LoadFromFileAtOpen method to see, if dataset will execute command to get cursor and fetch records (False) or will load its content from data file (True). To automatically load content from data file, following must be true:

  • dataset must be not nested dataset;
  • ResourceOptions.Persistent = True;
  • File with name resolved from ResourceOptions.PersistentFileName must exist.
Syntax
function LoadFromFileAtOpen: Boolean;
See Also

TADBottomResourceOptions.PersistentFileName, TADTopResourceOptions.DefaultStoreFolder, TADResourceOptions.Persistent

What do you think about this topic? Send feedback!


TADDataSet.LoadFromStream Method

TADDataSet.LoadFromStream Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Loads a dataset's data from a stream.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
AStream: TStream | A stream to load.
AFormat: TADStorageFormat = sfAuto | A file format. Default value is sfAuto.
Description

Use LoadFromStream to populate the dataset with data stored in an external file. The data is not moved to a database, but just loaded into a dataset in-memory storage.

AStream is the reference to the stream, containing the data to load. The stream position must be at begining of the dataset data, otherwise loading will fail.

AFormat is the file format:

  • sfXML - stream contains a well formed standalone XML data;
  • sfBinary - stream contains a binary data with custom FireDAC format;
  • sfAuto - format is determined by ResourceOptions.DefaultStoreExt if it is specified, otherwise by ResourceOptions.DefaultStoreFormat.

LoadFromStream tries to load from the stream the items specified by the ResourceOptions.StoreItems. If the stream was written with different StoreItems value, then exception will be raised likes this:

[FireDAC][Stan]-712 Cannot read [Relationlist] object
Syntax
procedure LoadFromStream(AStream: TStream; AFormat: TADStorageFormat = sfAuto);
See Also

LoadFromFile, SaveToStream, TADResourceOptions.DefaultStoreExt, TADResourceOptions.DefaultStoreFormat, TADBottomResourceOptions.PersistentFileName

Example
var
  oStr: TStream;
....
oStr := ADQuery1.CreateBlobStream(ADQuery1.FieldByName('data'), bmRead);
try
  ADMemTable1.LoadFromStream(oStr, sfBinary);
finally
  oStr.Free;
end;
What do you think about this topic? Send feedback!


TADDataSet.Locate Method

TADDataSet.Locate Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Searches the dataset for a record with specified field values and makes it current.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
const AKeyFields: string | A list of fields to match.
const AKeyValues: Variant | A variant value / variant array of values to search.
AOptions: TLocateOptions = [] | A set of options for string values matching.
Returns

True if a matching record is found. Otherwise - False.

Description

Use Locate to search the dataset for a record with specified field values and make it current, if found.

AKeyFields is a semicolon separated list of field names on which to search.

AKeyValues is a Variant containing the values to match to the key fields. If AKeyFields contains a single field name, then AKeyValues is a simple value. If AKeyFields contains few field names, then AKeyValues is a variant array, where items correspond to the key fields.

AOptions is a set of search mode for string fields. If AOptions contains the loCaseInsensitive, then Locate ignores case when matching fields. If AOptions contains the loPartialKey, then the AKeyValues parameter can contain partial strings.

If matching record is found, then this record becomes current and Locate returns True.

To optimize record searching, application can setup client index. The index will be used by the Locate, if following conditions are met:

  • The index field list has as prefix AKeyFields fields;
  • The index is build with soNoCase option and AOptions includes loCaseInsensitive. Or index is build without soNoCase and AOptions does not include loCaseInsensitive.
  • The index is active and is current.
Syntax
function Locate(const AKeyFields: string; const AKeyValues: Variant; AOptions: TLocateOptions = []): Boolean; override;
See Also

Finding a Record, LocateEx, Lookup, LookupEx, Indexes, IndexFieldNames, IndexName

Example 1
CustTable.IndexFieldNames := 'ID';
if CustTable.Locate('ID', 1001, []) then
  CustTable.Delete
else
  ShowMessage('The customer with ID=1001 is not found');
Example 2
CustTable.Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '831-431-1000']), [loPartialKey]);
What do you think about this topic? Send feedback!


TADDataSet.LocateEx Method (string, TADDataSetLocateOptions, PInteger)

TADDataSet.LocateEx Method (string, TADDataSetLocateOptions, PInteger)
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AExpression: string | A predicate expression to search.
AOptions: TADDataSetLocateOptions = [] | A search modes.
ApRecordIndex: PInteger = nil | An optional pointer to variable, receiving record index. Is nil by default.
Returns

True, if record is found.

Description

Use LocateEx to search the dataset for a record meeting the predicate expression and make it current, if found.

AExpression is a string containing the predicate expression on which to search. The expression cannot contain aggregating functions, like a SUM, COUNT and must be the predicate evaluating to True or to False. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write expressions.

AOptions is a set that optionally specifies additional search modes:

Option
Description
lxoCaseInsensitive
If included, then the LocateEx ignores case when matching string values.
lxoPartialKey
If included, then the expression can specify incomplete strings for string values comparision.
lxoFromCurrent
If included, then the LocateEx starts searching from the next after current record in dataset, otherwise from beginning.
lxoBackward
If included, then the LocateEx searches for record in backward direction, otherwise in forward direction.
lxoCheckOnly
If included, then LocateEx will not:
  • change current position;
  • fire BeforeScroll / AfterScroll events;
  • finish editing mode, if it is.
lxoNoFetchAll
If included, then FetchAll will be not called. So, the search is performed in already fetched records.

If matching record is found, then this record becomes current if lxoCheckOnly is not specified, ApRecordIndex pointed variable receives index of found record if ApRecordIndex is specified, and LocateEx returns True.

The searching using this version of LocateEx cannot be optimized. For optimized searching use another version of LocateEx method. Note, that for TADTable in Live Data Window mode this LocateEx may be optimized by DBMS optimizer.

Syntax
function LocateEx(const AExpression: string; AOptions: TADDataSetLocateOptions = []; ApRecordIndex: PInteger = nil): Boolean; virtual; overload;
See Also

Finding a Record, Locate, Lookup, LookupEx

Example
procedure TForm1.BtnFindClick(ASender: TObject);
begin
  if not CustTable.LocateEx('name like ''P%D''', [lxoCaseInsensitive]) then
    ShowMessage('The customer with name starting from P and ending by D is not found');
end;

procedure TForm1.BtnNextClick(ASender: TObject);
begin
  if not CustTable.LocateEx('name like ''P%D''', [lxoCaseInsensitive, lxoFromCurrent]) then
    ShowMessage('The customer with name starting from P and ending by D is not found');
end;
What do you think about this topic? Send feedback!


TADDataSet.LocateEx Method (string, Variant, TADDataSetLocateOptions, PInteger)

TADDataSet.LocateEx Method (string, Variant, TADDataSetLocateOptions, PInteger)
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Searches the dataset for a specified record by its fields values and makes that record current or returns its index.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AKeyFields: string | A list of fields to match.
const AKeyValues: Variant | A variant value / variant array of values to search.
AOptions: TADDataSetLocateOptions = [] | A search modes.
ApRecordIndex: PInteger = nil | An optional pointer to variable, receiving record index. Is nil by default.
Returns

True, if record is found.

Description

Use LocateEx to search a dataset for a record with specified field values and make it current, if found.

AKeyFields is a semicolon-separated list of field names on which to search.

AKeyValues is a Variant containing the values to match to the key fields. If AKeyFields contains a single field name, then AKeyValues is a simple value. If AKeyFields contains few field names, then AKeyValues is a variant array, where items correspond to the key fields.

AOptions is a set that optionally specifies additional search modes:

Option
Description
lxoCaseInsensitive
If included, then the LocateEx ignores case when matching string values.
lxoPartialKey
If included, then the expression can specify incomplete strings for string values comparision.
lxoFromCurrent
If included, then the LocateEx starts searching from the next after current record in dataset, otherwise from beginning.
lxoBackward
If included, then the LocateEx searches for record in backward direction, otherwise in forward direction.
lxoCheckOnly
If included, then LocateEx will not:
  • change current position;
  • fire BeforeScroll / AfterScroll events;
  • finish editing mode, if it is.
lxoNoFetchAll
If included, then FetchAll will be not called. So, the search is performed in already fetched records.

If matching record is found, then this record becomes current if lxoCheckOnly is not specified, ApRecordIndex pointed variable receives index of found record if ApRecordIndex is specified, and LocateEx returns True.

To optimize record searching, application can setup client index. The index will be used by the LocateEx, if following conditions are met:

  • The index field list has as prefix AKeyFields fields;
  • The index is build with soNoCase option and AOptions includes lxoCaseInsensitive. Or index is build without soNoCase and AOptions does not include lxoCaseInsensitive.
  • The index is active and is current.
Syntax
function LocateEx(const AKeyFields: string; const AKeyValues: Variant; AOptions: TADDataSetLocateOptions = []; ApRecordIndex: PInteger = nil): Boolean; virtual; overload;
See Also

Finding a Record, Locate, Lookup, LookupEx, Indexes, IndexFieldNames, IndexName

Example
procedure TForm1.BtnFindClick(ASender: TObject);
begin
  if not CustTable.LocateEx('COMPANY', 'AMCO', [lxoCaseInsensitive]) then
    ShowMessage('The customer from AMCO company is not found');
end;

procedure TForm1.BtnNextClick(ASender: TObject);
begin
  if not CustTable.LocateEx('COMPANY', 'AMCO', [lxoCaseInsensitive, lxoFromCurrent]) then
    ShowMessage('The customer from AMCO company is not found');
end;
What do you think about this topic? Send feedback!


TADDataSet.Lookup Method

TADDataSet.Lookup Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Searches the dataset for a record with specified key field values and returns result field values.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AKeyFields: string | A list of fields to match.
const AKeyValues: Variant | A variant value / variant array of values to search.
const AResultFields: string | A list of fields which values to return.
Returns

If record is found, the values from the fields specified in AResultFields. Otherwise - Null.

Description

Use Lookup to search the dataset for a record with specified key field values and return result field values without changing the current position in the dataset.

AKeyFields is a semicolon separated list of field names on which to search.

AKeyValues is a Variant containing the values to match to the key fields. If AKeyFields contains a single field name, then AKeyValues is a simple value. If AKeyFields contains few field names, then AKeyValues is a variant array, where items correspond to the key fields.

AResultFields is a semicolon separated list of field names, which values to return. If record is found, Lookup returns a variant array containing the values from the fields specified in AResultFields. Otherwise - Null.

To optimize record searching, application can setup client index. The index will be used by the Lookup, if following conditions are met:

  • The index field list has as prefix AKeyFields fields;
  • The index is build without soNoCase option;
  • The index is active and is current.
Syntax
function Lookup(const AKeyFields: string; const AKeyValues: Variant; const AResultFields: string): Variant; override;
See Also

Finding a Record, LookupEx, Locate, LocateEx, Indexes, IndexFieldNames, IndexName

Example
procedure TForm1.Button1Click(Sender: TObject);
var
  V: Variant;
  C: Integer;
  A: String;
begin
  V := ADQuery1.Lookup('Company;State', VarArrayOf(['Blue Sports', 'OR']), 'CustNo;Addr1');
  if not VarIsNull(V) then begin
    C := V[0];
    A := V[1];
    ShowMessage(IntToStr(C) + #13#10 + A);
  end
  else
    ShowMessage('The record is not found !');
end;
What do you think about this topic? Send feedback!


TADDataSet.LookupEx Method (string, Variant, string, TADDataSetLocateOptions, PInteger)

TADDataSet.LookupEx Method (string, Variant, string, TADDataSetLocateOptions, PInteger)
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Searches the dataset for a record with specified key field values and returns result field values.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
const AKeyFields: string | A list of fields to match.
const AKeyValues: Variant | A variant value / variant array of values to search.
const AResultFields: string | A list of fields which values to return.
AOptions: TADDataSetLocateOptions = [] | A set of search modes.
ApRecordIndex: PInteger = nil | An optional pointer to variable, receiving record index. Is nil by default.
Returns

If record is found, the values from the fields specified in AResultFields. Otherwise - Null.

Description

Use Lookup to search the dataset for a record with specified key field values and return result field values without changing the current position in the dataset.

AKeyFields is a semicolon separated list of field names on which to search.

AKeyValues is a Variant containing the values to match to the key fields. If AKeyFields contains a single field name, then AKeyValues is a simple value. If AKeyFields contains few field names, then AKeyValues is a variant array, where items correspond to the key fields.

AResultFields is a semicolon separated list of field names, which values to return. If record is found, Lookup returns a variant array containing the values from the fields specified in AResultFields. Otherwise - Null.

AOptions is a set that optionally specifies additional search modes:

Option
Description
lxoCaseInsensitive
If included, then the LookupEx ignores case when matching string values.
lxoPartialKey
If included, then the AKeyValues can specify incomplete strings for string values comparision.
lxoFromCurrent
If included, then the LookupEx starts searching from the next after current record in dataset, otherwise from beginning.
lxoBackward
If included, then the LookupEx searches for record in backward direction, otherwise in forward direction.
lxoCheckOnly
If included, then LookupEx will not:
  • finish editing mode, if it is.
lxoNoFetchAll
If included, then FetchAll will be not called. So, the search is performed in already fetched records.

If matching record is found and ApRecordIndex is not nil, then pointed variable receives index of found record.

To optimize record searching, application can setup client index. The index will be used by the LookupEx, if following conditions are met:

  • The index field list has as prefix AKeyFields fields;
  • The index is build without soNoCase option;
  • The index is active and is current.
Syntax
function LookupEx(const AKeyFields: string; const AKeyValues: Variant; const AResultFields: string; AOptions: TADDataSetLocateOptions = []; ApRecordIndex: PInteger = nil): Variant; virtual; overload;
See Also

Finding a Record, Lookup, Locate, LocateEx, Indexes, IndexFieldNames, IndexName

What do you think about this topic? Send feedback!


TADDataSet.LookupEx Method (string, string, TADDataSetLocateOptions, PInteger)

TADDataSet.LookupEx Method (string, string, TADDataSetLocateOptions, PInteger)
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Searches the dataset for a record by predicate expression and returns result field values.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AExpression: string | A predicate expression to search.
const AResultFields: string | A list of fields which values to return.
AOptions: TADDataSetLocateOptions = [] | A set of search modes.
ApRecordIndex: PInteger = nil | An optional pointer to variable, receiving record index. Is nil by default.
Returns

If record is found, the values from the fields specified in AResultFields. Otherwise - Null.

Description

Use Lookup to search the dataset for a record for which specified predicate expression evaluates to True and return other field values from the found record.

AExpression is a string containing the predicate expression on which to search. The expression cannot contain aggregating functions, like a SUM, COUNT and must be the predicate evaluating to True or to False. FireDAC supports expression syntax compatible with:

  • BDE data access components;
  • TClientDataset;
  • Oracle 8 (not for 100%).

See Writing Expressions for details of how to write expressions.

AResultFields is a semicolon separated list of field names, which values to return. If record is found, Lookup returns a variant array containing the values from the fields specified in AResultFields. Otherwise - Null.

AOptions is a set that optionally specifies additional search modes:

Option
Description
lxoCaseInsensitive
If included, then the LookupEx ignores case when matching string values.
lxoPartialKey
If included, then the AKeyValues can specify incomplete strings for string values comparision.
lxoFromCurrent
If included, then the LookupEx starts searching from the next after current record in dataset, otherwise from beginning.
lxoBackward
If included, then the LookupEx searches for record in backward direction, otherwise in forward direction.
lxoCheckOnly
If included, then LookupEx will not:
  • finish editing mode, if it is.
lxoNoFetchAll
If included, then FetchAll will be not called. So, the search is performed in already fetched records.

If matching record is found and ApRecordIndex is not nil, then pointed variable receives index of found record.

The searching using this version of LookupEx cannot be optimized. For optimized searching use another version of LookupEx method.

Syntax
function LookupEx(const AExpression: string; const AResultFields: string; AOptions: TADDataSetLocateOptions = []; ApRecordIndex: PInteger = nil): Variant; virtual; overload;
See Also

Finding a Record, Lookup, Locate, LocateEx

Example
procedure TForm1.Button1Click(Sender: TObject);
var
  V: Variant;
  C: Integer;
  A: String;
begin
  V := ADQuery1.LookupEx('Company = ''Blue Sports'' and State = ''OR''', 'CustNo;Addr1', [lxoCaseInsensitive]);
  if not VarIsNull(V) then begin
    C := V[0];
    A := V[1];
    ShowMessage(IntToStr(C) + #13#10 + A);
  end
  else
    ShowMessage('The record is not found !');
end;
What do you think about this topic? Send feedback!


TADDataSet.Offline Method

TADDataSet.Offline Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Sets dataset to offline mode.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The Offline method call disconnects dataset from DBMS, but does not close it. After this call no more cursors will be accessible, as result the dataset will not fetch any more records from a cursor, SourceEOF will be True and a command will be unprepared.

If ResourceOptions.AutoFetchAll is True, then before entering into offline mode, dataset will fetch all remaining records from the current cursor. If it is False and not all records are fetched, then an exception will be raised. Application can fetch all dataset records explicitly by calling FetchAll method.

In most cases there is no need to call Offline method explicitly. It is implicitly used by the connection Offline method to set the connection and the all associated datasets to offline mode.

The Release method is similar to the Offline method, but it does not unprepare command.

Syntax
procedure Offline;
See Also

TADCustomConnection.Offline, FetchAll, Release

What do you think about this topic? Send feedback!


TADDataSet.OpenOrExecute Method

TADDataSet.OpenOrExecute Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Executes SQL command and optionally opens dataset.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Returns

True, if a command returned result set.

Description

Use OpenOrExecute method, if you does not know - will command return result set or not. The most common case for that is the execution of an ad hoc query.

The OpenOrExecute method executes SQL command. And if command returns any result set, then this method opens dataset. The method supplements Open and Execute / ExecSQL / ExecProc methods:

  • the Open method raises an exception "[FireDAC][Phys]-308. Command must return row set", if a command does not return result set, like a INSERT;
  • the Execute / ExecSQL / ExecProc methods raise an exception "[FireDAC][Phys]-310. Cannot execute command returning results set", if a command returns result set, like a SELECT.

At OpenOrExecute call a "[FireDAC][Phys]-308" may be raised, but it will be not propagated out of the method.

Syntax
function OpenOrExecute: Boolean;
See Also

TDataSet.Open, Execute, TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc

Example
ADQuery1.Disconnect(True);
ADQuery1.SQL.Assign(Memo1.Lines);
if ADQuery1.OpenOrExecute then begin
  PageControl1.ActivePage := DataGridPage;
  DataGridPage.TabVisible := True;
end
else
  DataGridPage.TabVisible := False;
What do you think about this topic? Send feedback!


TADDataSet.ParamByName Method

TADDataSet.ParamByName Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Searches parameter by its name.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
const AValue: string | A name of parameter.
Returns

Parameter, if it is found.

Description

Use ParamByName to find a parameter by its name in the Params collection.

AValue is the name of the parameter for which to retrieve information. If parameter with AValue name is not found, then exception is raised.

Syntax
function ParamByName(const AValue: string): TADParam;
See Also

FindParam

What do you think about this topic? Send feedback!


TADDataSet.Reconcile Method

TADDataSet.Reconcile Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Clears successfully updated records from the dataset's cache of changes.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

Reconcile is called by the ApplyUpdates method to update the dataset so that it reflects the result of an update. Reconcile is called after the dataset has attempted to apply all updates in the dataset's Delta property.

Results of updates applying are recorded in internal data storage, including error information for each record that could not be applied. Reconcile generates an OnReconcileError event for every record that was not successfully applied. Finally, Reconcile adjusts the Delta property so that it includes only those records that were not successfully applied. Any changes made in the OnReconcileError event are reflected in the new value of Delta.

Reconcile returns a value that indicates whether reconciling is successful. If True, Reconcile succeeded without error. If False, one or more errors could not be reconciled.

Alternatively an application may review erroneous records using FilterChanges and RowError properties. Read "Reviewing errors" at Caching Updates for more details.

Syntax
function Reconcile: Boolean;
See Also

Caching Updates, ApplyUpdates, RowError, FilterChanges, OnReconcileError

What do you think about this topic? Send feedback!


TADDataSet.RefreshRecord Method

TADDataSet.RefreshRecord Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Rereads field values of the current record from a data source.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
AClearRow: Boolean = True | When True, then the record fields will be initially erased.
Returns

True, if a record is refreshed. False, if a record is deleted from a dataset.

Description

Use RefreshRecord to discard all changes of the current record and reread it from a data source. A similar method, TDataSet.Refresh, replaces the entire contents of the dataset by re-executing SQL command.

To reread record the FireDAC will perform the sequence of steps:

  • If is assigned OnUpdateRecord event handler, then it will be called with ARequest = arFetchRow.
  • If event handler is not assigned or it returns AAction = eaDefault, then:
    • If is assigned TADAdaptedDataSet.UpdateObject and TADUpdateSQL.FetchRowSQL is not empty, then this SQL command will be executed.
    • Otherwise FireDAC will generate SELECT command rereading single row from database and will execute command.

If query to a data source will return no rows (probably a record is deleted), then when UpdateOptions.RefreshDelete is True a record will be removed from a dataset too, otherwise an exception will be raised. When AClearRow parameters is set to True (default value), then the record will be initially erased. Otherwise the read values will override the corresponding column values.

The method returns True, if a record is refreshed. And False, if it is deleted from a dataset.

Syntax
function RefreshRecord(AClearRow: Boolean = True): Boolean;
See Also

TDataSet.Refresh, OnUpdateRecord, TADAdaptedDataSet.UpdateObject, TADUpdateSQL.FetchRowSQL, TADUpdateOptions.RefreshDelete, Update Command Generation

Example
ADQuery1.UpdateObject := ADUpdateSQL;
// PL/SQL block calling packaged procedure returning customer data by its ID
ADUpdateSQL.FetchRowSQL.Text := 'begin cust_pack.read_cust_data(:new_name, :new_company, :new_state, :old_id); end;';
// always is required to setup output parameters
with ADUpdateSQL.Commands[arFetchRow] do begin
  Params[0].ParamType := ptOutput;
  Params[0].DataType := ftString;
  Params[1].ParamType := ptOutput;
  Params[1].DataType := ftString;
  Params[2].ParamType := ptOutput;
  Params[2].DataType := ftString;
end;
...
ADQuery1.RefreshRecord;
What do you think about this topic? Send feedback!


TADDataSet.RefreshUnknownRecord Method

TADDataSet.RefreshUnknownRecord Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Registers new record and optionally rereads it field values from a data source.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AValues: array of Variant | The values to assign to new record.
AReread: Boolean = True | If True, then new added record will be immediately refreshed.
ASetPos: Boolean = True | If True, then dataset will set current position to the new added record.
Description

Use RefreshUnknownRecord to register new record not yet fetched at internal data storage, assigns AValues to it columns and optionally rereads it field values from data source.

This method is useful, if you need to fetch record, not existing in internal data storage, but existing in database. For example, it was not fetched together with result set, but later it is known that new record is added to the database. And application needs to fetch this record.

FireDAC assigns not-Null values from AValues to corresponding record columns. Only those columns values will be used in WHERE phrase at fetching record. Most convenient is to specify key column values.

Syntax
procedure RefreshUnknownRecord(const AValues: array of Variant; AReread: Boolean = True; ASetPos: Boolean = True);
See Also

RefreshRecord, TDataSet.Refresh

Example
// Assign 101 to ID field, fetch record immediately and set current position to it.
ADQuery1.RefreshUnknownRecord([101], True, True);
What do you think about this topic? Send feedback!


TADDataSet.Release Method

TADDataSet.Release Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Releases all dataset cursors.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Description

The Release method call Releases all dataset cursors, but does not close it. After this call no more cursors will be accessible, as result the dataset will not fetch any more records from a cursor and SourceEOF will be True.

If ResourceOptions.AutoFetchAll is True, then before releasing cursors, dataset will fetch all remaining records from the current cursor. If it is False and not all records are fetched, then an exception will be raised. Application can fetch all dataset records explicitly by calling FetchAll method.

The Disconnect method is similar to the Release method, but it also unprepares a command.

Syntax
procedure Release;
See Also

FetchAll, Offline, Disconnect

What do you think about this topic? Send feedback!


TADDataSet.RevertRecord Method

TADDataSet.RevertRecord Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Undoes changes to the current record.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use RevertRecord to undo changes to the current record and remove it from the dataset changes log.

To undo the last edit made to a data set, call UndoLastChange. To cancel all pending modifications, call CancelUpdates. To undo all edits since an application-defined state, use the SavePoint property.

Syntax
procedure RevertRecord;
See Also

UndoLastChange, CancelUpdates, SavePoint

Example

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.

What do you think about this topic? Send feedback!


TADDataSet.SaveToFile Method

TADDataSet.SaveToFile Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Saves a dataset's data to a file.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AFileName: String = '' | An external file name.
AFormat: TADStorageFormat = sfAuto | A file format.
Description

Use SaveToFile to write a dataset's data to an external file for later use by this or other datasets.

AFileName is the name of the external file to save the data.

AFormat is the file format:

  • sfXML - file is well formed standalone XML file;
  • sfBinary - file is binary file with custom FireDAC format;
  • sfAuto - format is determined by AFileName extension: ".XML" - XML file, ".ADB" / ".BIN" / ".DAT" - binary file. If AFileName does not have an extension, then format is determined by ResourceOptions.DefaultStoreExt if it is specified, otherwise by ResourceOptions.DefaultStoreFormat.

As option, you can specify ResourceOptions.PersistentFileName before calling Open. Then data will be saved to file at Close, if data was modified or file does not exists.

If file exists and ResourceOptions.Backup = True, then original file extension will be changed to ResourceOptions.BackupExt and it will be saved to ResourceOptions.BackupFolder. And then will be written a new file.

SaveToFile stores into the file the items specified by the ResourceOptions.StoreItems.

Syntax
procedure SaveToFile(const AFileName: String = ''; AFormat: TADStorageFormat = sfAuto);
See Also

SaveToStream, TADResourceOptions.DefaultStoreExt, TADResourceOptions.DefaultStoreFormat, TADBottomResourceOptions.PersistentFileName

Example
ADQuery1.Open('select * from customers');
ADQuery1.FetchAll;
ADQuery1.SaveToFile('c:\customers.xml', sfAuto);
....
ADMemTable1.LoadFromFile('c:\customers.xml', sfAuto);
ADMemTable1.Locate('CUSTOMER_ID', [100], []);
What do you think about this topic? Send feedback!


TADDataSet.SaveToFileAtClose Method

TADDataSet.SaveToFileAtClose Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace public See Also Send Feedback

Returns True, if dataset content will be saved to file at Close.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, public, See Also
Returns

True, if dataset content will be saved.

Description

Call SaveFileAtClose method to see, if dataset will save its data to the external file at Close. To automatically save content to data file, following must be true:

  • dataset must be not nested dataset;
  • ResourceOptions.Persistent = True;
  • resolved ResourceOptions.PersistentFileName must be not empty;
  • file does not exists or dataset was changed science last saving or loading of data from file or opening.
Syntax
function SaveToFileAtClose: Boolean;
See Also

TADBottomResourceOptions.PersistentFileName, TADTopResourceOptions.DefaultStoreFolder, TADResourceOptions.Persistent

What do you think about this topic? Send feedback!


TADDataSet.SaveToStream Method

TADDataSet.SaveToStream Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Saves a dataset's data to a stream.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
AStream: TStream | A stream to write.
AFormat: TADStorageFormat = sfAuto | A file format.
Description

Call SaveToStream to save the dataset data to an external file.

AStream is the reference to the stream, to which the data to write. The dataset will start to write its data at current stream position.

AFormat is the file format:

  • sfXML - stream contains a well formed standalone XML data;
  • sfBinary - stream contains a binary data with custom FireDAC format;
  • sfAuto - format is determined by ResourceOptions.DefaultStoreExt if it is specified, otherwise by ResourceOptions.DefaultStoreFormat.

SaveToStream stores into the stream the items specified by the ResourceOptions.StoreItems.

Syntax
procedure SaveToStream(AStream: TStream; AFormat: TADStorageFormat = sfAuto);
See Also

SaveToFile, LoadFromStream, TADResourceOptions.DefaultStoreExt, TADResourceOptions.DefaultStoreFormat, TADBottomResourceOptions.PersistentFileName

Example
var
  oStr: TStream;
  ....
  ADQuery1.Edit;
  oStr := ADQuery1.CreateBlobStream(ADQuery1.FieldByName('data'), bmWrite);
  try
    ADMemTable1.SaveToStream(oStr, sfBinary);
  finally
    oStr.Free;
    ADQuery1.Post;
  end;
What do you think about this topic? Send feedback!


TADDataSet.SetFieldAttributes Method

TADDataSet.SetFieldAttributes Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Setups fields ProviderFlags.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use the SetFieldAttributes method to setup dataset fields ProviderFlags and some others properties. FireDAC datasets are doing that automatically, when:

  • dataset uses temporary fields;
  • programmer is adding persistent fields at design time.

When application is creating fields manually or using CreateFields method, then above properties will be not setup automatically. To setup them call SetFieldAttributes method after dataset opening.

Syntax
procedure SetFieldAttributes; overload;
See Also

TField.ProviderFlags, TDataSet.CreateFields

Example
ADQuery1.FieldDefs.Updated := False;
ADQuery1.FieldDefs.Update;
ADQuery1.CreateFields;
....
ADQuery1.Open;
ADQuery1.SetFieldAttributes;
What do you think about this topic? Send feedback!


TADDataSet.SetKey Method

TADDataSet.SetKey Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Starts the enter key values mode.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use SetKey to put the dataset into dsSetKey state, clear the current content of the search key buffer and enable to enter key field values.

Use EditKey to modify an existing key field values, without initially erasing them.

Syntax
procedure SetKey;
See Also

Finding a Record, EditKey, GotoKey, SetRange, SetRangeEnd, SetRangeStart, TDataSet.State, TDataSet.FieldByName, IndexName, IndexFieldNames, Indexes

Example
ADQuery1.IndexFieldNames := 'CUSTOMER_ID;ORDER_DATE';
ADQuery1.SetKey;
ADQuery1.FieldByName('CUSTOMER_ID').AsInteger := 100;
ADQuery1.FieldByName('ORDER_DATE').AsDateTime := EncodeDate(2008, 5, 1);
if not ADQuery1.GotoKey then
  ShowMesage('Order is not found');
What do you think about this topic? Send feedback!


TADDataSet.SetRange Method

TADDataSet.SetRange Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Sets the starting and ending values of a range, and applies it.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AStartValues: array of const | An open array of starting range values.
const AEndValues: array of const | An open array of ending range values.
AStartExclusive: Boolean = False | Exclude start range value. Default False.
AEndExclusive: Boolean = False | Exclude end range value. Default False.
Description

Use SetRange to specify the beginning and ending range values for the dataset and apply the range.

AStartValues sets starting range the indexed field values. AEndValues sets ending range the indexed fields values. SetRange performs the following steps:

  • puts the dataset into dsSetKey state;
  • erases any previously specified starting range values and ending range values;
  • sets the start and end range values;
  • applies the range to the dataset.

If the current dataset record is within new range, then it will be current after a call to SetRange. Otherwise the current position will be set to the first record in the range.

If either AStartValues or AEndValues has fewer elements than the number of fields in the current index, then the remaining entries are set to NULL.

Syntax
procedure SetRange(const AStartValues: array of const; const AEndValues: array of const; AStartExclusive: Boolean = False; AEndExclusive: Boolean = False);
See Also

Filtering Records, SetRangeEnd, SetRangeStart, ApplyRange, TDataSet.State, TDataSet.FieldByName, IndexName, IndexFieldNames, Indexes

Example
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRange([100], [200]);
What do you think about this topic? Send feedback!


TADDataSet.SetRangeEnd Method

TADDataSet.SetRangeEnd Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Sets the ending values of a range.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use SetRangeEnd to put the dataset into dsSetKey state and erase any previously specified ending range values.

After that application can assign ending range values to the dataset indexed fields.

Syntax
procedure SetRangeEnd;
See Also

Filtering Records, SetRangeStart, EditRangeStart, ApplyRange, IndexName, IndexFieldNames, Indexes, TDataSet.State, TDataSet.FieldByName

Example
ADQuery1.IndexFieldNames := 'CUST_NO';
...
ADQuery1.SetRangeEnd;
ADQuery1.FieldByName('CUST_NO').AsInteger := 200;
...
ADQuery1.ApplyRange;
What do you think about this topic? Send feedback!


TADDataSet.SetRangeStart Method

TADDataSet.SetRangeStart Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Sets the starting values of a range.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use SetRangeStart to put the dataset into dsSetKey state and erase any previously specified starting range values.

After that application can assign starting range values to the dataset indexed fields.

Syntax
procedure SetRangeStart;
See Also

Filtering Records, SetRangeEnd, EditRangeStart, ApplyRange, IndexName, IndexFieldNames, Indexes, TDataSet.State, TDataSet.FieldByName

Example
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRangeStart;
ADQuery1.FieldByName('CUST_NO').AsInteger := 100;
...
ADQuery1.ApplyRange;
What do you think about this topic? Send feedback!


TADDataSet.UndoLastChange Method

TADDataSet.UndoLastChange Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 public See Also Send Feedback

Undoes the last modification to the dataset records.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, public, See Also
Parameters
Parameters | Description
AFollowChange: Boolean | A flag controlling current position in dataset.
Returns

True, if a change was undone.

Description

Use UndoLastChange to undo the last modification to the dataset records and remove the change from the dataset change log.

The method is applicable to the datasets working in CachedUpdates = True mode.

If AFollowChange is True, then the current position in dataset is set to restored record. Otherwise the position remains unchanged.

To check if changed log is not empty read the UpdatesPending property value. If it is True, then there are changes to undo.

Syntax
function UndoLastChange(AFollowChange: Boolean): Boolean;
See Also

Caching Updates, UpdatesPending, RevertRecord, CancelUpdates, SavePoint

Example 1
procedure TForm1.btnUndoClick(ASender: TObject);
begin
  ADQuery1.UndoLastChange(True);
end;
Example 2

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.

What do you think about this topic? Send feedback!


TADDataSet.UpdateAttributes Method

TADDataSet.UpdateAttributes Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Actualize changes to the client default expressions and auto-incremental fields.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use UpdateAttributes method to actualize changes to the default expressions and auto-incremental fields made after dataset was activated.

The fields default expressions that are in TField.DefaultExpression property or auto-incremental fields that are TADAutoIncField properties, are actualized automatically at dataset Open call. The changes to these properties for an active dataset are not actualizing automatically.

Syntax
procedure UpdateAttributes;
See Also

Specifying Default Values, UpdateConstraints, TField.DefaultExpression, TADAutoIncField

Example
ADQuery1.FieldByName('ObjGUID').DefaultExpression := 'NEWGUID()';
ADQuery1.UpdateAttributes;
What do you think about this topic? Send feedback!


TADDataSet.UpdateConstraints Method

TADDataSet.UpdateConstraints Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Actualize changes to the client constraints.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use UpdateConstraints method to actualize changes to the constraints made after dataset was activated.

The client constraints that are in Constraints property (record constraints) or are assigned to the dataset fields (field constraints) are actualized automatically at dataset Open call. The constraint changes for an active dataset are not actualizing automatically.

Syntax
procedure UpdateConstraints;
See Also

DisableConstraints, EnableConstraints, Constraints, ConstraintsEnabled, UpdateAttributes

Example
with ADQuery1.FieldByName('age') do begin
  CustomConstraint := 'age >= 18';
  ConstraintErrorMessage := 'The age must be greater or equal to 18 years';
end;
ADQuery1.UpdateConstraints;
What do you think about this topic? Send feedback!


TADDataSet.UpdateStatus Method

TADDataSet.UpdateStatus Method
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example public See Also Send Feedback

Returns the modification status for current record.

Group

public

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, public, See Also
Returns

Record modification status.

Description

Use UpdateStatus method to get the modification status for the current dataset record. The function returns one of the following values:

Status | Description
usUnmodified | Record is in its original unmodified state.
usModified | Record is modified. Changes are not posted to database.
usDeleted | Record is deleted. Changes are not posted to database.
usInserted | Record is inserted. Changes are not posted to database.
Syntax
function UpdateStatus: TUpdateStatus; override;
See Also

Caching Updates, UndoLastChange, FilterChanges

Example
procedure TForm1.ADQuery1AfterScroll(DataSet: TDataSet);
begin
  case TADQuery(DataSet).UpdateStatus of
  usUnmodified: Label1.Caption := '';
  usModified: Label1.Caption := 'Modified';
  usDeleted: Label1.Caption := 'Deleted';
  usInserted: Label1.Caption := 'Inserted';
  end;
end;
What do you think about this topic? Send feedback!


protected

protected
TADDataSet Class Legend Properties Send Feedback

The protected members of the TADDataSet class are listed here.

Class

TADDataSet Class

Properties
Property | Description
FetchOptions | The set of options to control rows fetching.
FormatOptions | The set of options to control data representation.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ResourceOptions | The set of options to control resources usage.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
Links
TADDataSet Class, Legend, Properties
What do you think about this topic? Send feedback!


TADDataSet.FetchOptions Property

TADDataSet.FetchOptions Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace protected See Also Send Feedback

The set of options to control rows fetching.

Group

protected

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, protected, See Also
Description

The FetchOptions property is the set of properties, controlling the fetching of cursor rows. These properties will inherit its values from FetchOptions of connection object.

Syntax
property FetchOptions: TADFetchOptions;
See Also

Setting Options, TADFetchOptions

What do you think about this topic? Send feedback!


TADDataSet.FormatOptions Property

TADDataSet.FormatOptions Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace protected See Also Send Feedback

The set of options to control data representation.

Group

protected

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, protected, See Also
Description

The FormatOptions property is the set of properties, controlling the data type mapping, and some other aspects of data handling.

Syntax
property FormatOptions: TADFormatOptions;
See Also

Setting Options, TADFormatOptions, Params

What do you think about this topic? Send feedback!


TADDataSet.ParamCount Property

TADDataSet.ParamCount Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example protected See Also Send Feedback

Returns the current number of parameters in the command text.

Group

protected

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example, protected, See Also
Description

The ParamCount property value is the shortcut for Params.Count property.

If the ResourceOptions.ParamCreate property is True, ParamCount always corresponds to the number of actual parameters in the SQL statement.

Syntax
property ParamCount: Word;
See Also

Params, TADResourceOptions.ParamCreate

Example
var
  i: Integer;
...
Memo1.Lines.Clear;
for i := 0 to ADQuery1.ParamCount - 1 do
  Memo1.Lines.Add(ADQuery1.Params[i].Name);
What do you think about this topic? Send feedback!


TADDataSet.Params Property

TADDataSet.Params Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace Example 1 Example 2 Example 3 Example 4 protected See Also Send Feedback

Contains the parameters for a SQL statement.

Group

protected

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, Example 1, Example 2, Example 3, Example 4, protected, See Also
Description

Use Params property to view and set SQL statement parameter names, values, and data types at run time. Use the collection editor for the Params property to set parameter information at design time.

If dataset is TADQuery, then Params is populated automatically after changing SQL property value, if ResourceOptions.ParamCreate = True. The parameters order is the same as they appear in the SQL command. When Params.BindMode = pbByName, then each parameter name will appear in Params only once. When Params.BindMode = pbByNumber, then each parameter marker will appear in the Params, including duplicated names.

If dataset is TADStoredProc, then Params is populated automatically after calling Prepare method at run time or changing StoredProcName at design time, if fiMeta is in FetchOption.Items. The parameters order is the same as in the stored procedure header.

Otherwise Params may be populated by hands. At Prepare call, parameters will be bind to prepared SQL command. After that you cannot change parameter types, otherwise will get an exception.

An easier way to set and retrieve parameter values when the name of each parameter is known is to call ParamByName. This method is especially preferred versus accessing parameters by index when they are populated automatically and there is a chance that the SQL property or StoredProcName property will be changed in the code dynamically.

Syntax
property Params: TADParams;
See Also

Executing Command, Executing Stored Procedure, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items

Example 1
// TADQuery automatic parameters creation - ResourceOptions.ParamCreate = True
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.Open;
Example 2
// TADQuery manual parameters creation - ResourceOptions.ParamCreate = False
ADQuery1.ResourceOptions.ParamCreate := False;
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
with ADQuery1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
  AsString := 'qwe';
end;
ADQuery1.Open;
Example 3
// TADStoredProc automatic parameters creation - fiMeta in FetchOptions.Items
ADStoredProc1.StoredProcName := 'my_proc';
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;
Example 4
// TADStoredProc manual parameters creation - fiMeta not in FetchOptions.Items
ADStoredProc1.FetchOptions.Items := ADStoredProc1.FetchOptions.Items - [fiMeta];
ADStoredProc1.StoredProcName := 'my_proc';
with ADStoredProc1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
end;
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;
What do you think about this topic? Send feedback!


TADDataSet.ResourceOptions Property

TADDataSet.ResourceOptions Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace protected See Also Send Feedback

The set of options to control resources usage.

Group

protected

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, protected, See Also
Description

The ResourceOptions property is the set of properties, controlling the resources usage by the dataset. These properties will inherit its values from ResourceOptions of connection object.

Syntax
property ResourceOptions: TADBottomResourceOptions;
See Also

Setting Options, TADBottomResourceOptions

What do you think about this topic? Send feedback!


TADDataSet.UpdateOptions Property

TADDataSet.UpdateOptions Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace protected See Also Send Feedback

The set of options to control updates posting.

Group

protected

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, protected, See Also
Description

The UpdateOptions property is the set of properties, controlling the posting updates from the dataset. These properties will inherit its values from UpdateOptions of connection object.

Syntax
property UpdateOptions: TADBottomUpdateOptions;
See Also

Setting Options, TADBottomUpdateOptions

What do you think about this topic? Send feedback!


TADDataSet.Updates Property

TADDataSet.Updates Property
TADDataSet Class TADDataSet Members uADCompDataSet Namespace protected See Also Send Feedback

The dataset change log.

Group

protected

Links
TADDataSet Class, TADDataSet Members, uADCompDataSet Namespace, protected, See Also
Description

Use Updates property to get reference to the dataset change log (record updates journal).

The change log contains list of changed, deleted and new record references. The list is ordered by the moment of time, when a change is happened. If record was changed twice or more, log contains information for last change only.

Syntax
property Updates: TADDatSUpdatesJournal;
See Also

TADDatSUpdatesJournal

What do you think about this topic? Send feedback!


TADIndex Class

TADIndex Class
public published TADIndex Members Example Classes See Also Send Feedback

TADIndex represents a maintained client view to records in an FireDAC dataset.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADIndex
File

uADCompDataSet

Links
public, published, TADIndex Members, Example, Classes, See Also
Description

Use TADIndex to create and maintain client view to records in an FireDAC dataset.

TADIndex are collected into TADIndexes collection. The set of TADIndex may be created as at design time, as at run time.

Fields property specifies the list of sort fields. Alternatively Expression property specifies sort expression. Filter property specifies filtering expression. The view will be maintained if Active is True and TADataSet.IndexesActive is True.

The view becomes current in dataset, if Selected is True or TADDataSet.IndexName is set to the name of this view.

Notes

The name may confuse you. It talks about "index". Originally TADIndex was representing a maintained index, but later we have added extended features to TADIndex, so it is not just controlling sorting order.

It is possible to define indexes using TADDataSet.IndexDefs. But we recomend to use TADDataSet.Indexes. It offers more options, while IndexDefs is for compatibility with legacy software.

Syntax
TADIndex = class(TCollectionItem);
See Also

TADIndexes, TADDataSet, TADDataSet.IndexFieldNames, TADDataSet.IndexName, TADDataSet.Indexes, TADDataSet.IndexesActive

Example
ADQuery1.IndexesActive := True;
ADQuery1.Open;

with ADQuery1.Indexes.Add do begin
  Name := 'Orders';
  Fields := 'ORDER_NO;PART_NO';
  Filter := 'OrderDate < ''01.01.2008''';
  Active := True;
  Selected := True;
end;
What do you think about this topic? Send feedback!


TADIndex Members

TADIndex Members
TADIndex Class Legend Properties Send Feedback

The following tables list the members exposed by TADIndex.

Class

TADIndex Class

Properties
Property | Description
Active | Controls when dataset view must be maintained.
ActualActive | Returns True, if dataset view is really maintained.
CaseInsFields | Specifies fields for which sorting must be case-insensitive.
DataSet | Returns the reference to containing dataset.
DescFields | Specifies fields for which sorting must be done in descending order.
Distinct | Controls returning of distinct view value.
Expression | Specifies expression which must be used to sort records.
Fields | Identifies the fields that comprise the index.
Filter | Specifies the text of a view filter.
FilterOptions | Specifies filtering options.
Name | Specifies the name of dataset view.
Options | Specifies sorting options.
Selected | Specifies, if a dataset view is the current dataset view.
Links
TADIndex Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADIndex Class Legend Properties Send Feedback

The public members of the TADIndex class are listed here.

Class

TADIndex Class

Properties
Property | Description
ActualActive | Returns True, if dataset view is really maintained.
DataSet | Returns the reference to containing dataset.
Links
TADIndex Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIndex.ActualActive Property

TADIndex.ActualActive Property
TADIndex Class TADIndex Members uADCompDataSet Namespace public See Also Send Feedback

Returns True, if dataset view is really maintained.

Group

public

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, public, See Also
Description

Use ActualActive to see if FireDAC is maintaining this dataset view. In general, the view is maintained if:

  • Active is True;
  • dataset is active;
  • dataset IndexesActive is True.
Syntax
property ActualActive: Boolean;
See Also

Active, Selected, TADDataSet.IndexesActive

What do you think about this topic? Send feedback!


TADIndex.DataSet Property

TADIndex.DataSet Property
TADIndex Class TADIndex Members uADCompDataSet Namespace public See Also Send Feedback

Returns the reference to containing dataset.

Group

public

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, public, See Also
Description

Use the DataSet property to get reference to dataset, containing this view.

Syntax
property DataSet: TADDataSet;
See Also

TADDataSet

What do you think about this topic? Send feedback!


published

published
TADIndex Class Legend Properties Send Feedback

The published members of the TADIndex class are listed here.

Class

TADIndex Class

Properties
Property | Description
Active | Controls when dataset view must be maintained.
CaseInsFields | Specifies fields for which sorting must be case-insensitive.
DescFields | Specifies fields for which sorting must be done in descending order.
Distinct | Controls returning of distinct view value.
Expression | Specifies expression which must be used to sort records.
Fields | Identifies the fields that comprise the index.
Filter | Specifies the text of a view filter.
FilterOptions | Specifies filtering options.
Name | Specifies the name of dataset view.
Options | Specifies sorting options.
Selected | Specifies, if a dataset view is the current dataset view.
Links
TADIndex Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIndex.Active Property

TADIndex.Active Property
TADIndex Class TADIndex Members uADCompDataSet Namespace published See Also Send Feedback

Controls when dataset view must be maintained.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, published, See Also
Description

Set Active property value to True to activate view maintenance. By default it is False.

All views will be maintained when TADDataSet.IndexesActive is True. Really, view will be maintained only when ActualActive returns True.

To make dataset view current in the dataset, set Selected property to True.

Syntax
property Active: Boolean;
See Also

ActualValue, Selected, TADDataSet.IndexesActive

What do you think about this topic? Send feedback!


TADIndex.CaseInsFields Property

TADIndex.CaseInsFields Property
TADIndex Class TADIndex Members uADCompDataSet Namespace Example published See Also Send Feedback

Specifies fields for which sorting must be case-insensitive.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, Example, published, See Also
Description

The CaseInsFields specifies fields for which sorting must be case-insensitive.

This fields must be included into Fields property value too. If index is expressional (Expression is specified), then CaseInsFields has no effect. Alternatively case insensitive fields may be specified right in the Fields property.

Syntax
property CaseInsFields: String;
See Also

Fields, DescFields

Example
with ADQuery1.Indexes.Add do begin
  Name := 'i1';
  Fields := 'Name;BirthDate';
  CaseInsFields := 'Name';
  Active := True;
  Selected := True;
end;
What do you think about this topic? Send feedback!


TADIndex.DescFields Property

TADIndex.DescFields Property
TADIndex Class TADIndex Members uADCompDataSet Namespace Example published See Also Send Feedback

Specifies fields for which sorting must be done in descending order.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, Example, published, See Also
Description

The DescFields specifies fields for which sorting must be done in descending order.

This fields must be included into Fields property value. If index is expressional (Expression is specified), then DescFields has no effect. Alternatively descending fields may be specified right in the Fields property.

Syntax
property DescFields: String;
See Also

Fields, CaseInsFields

Example
with ADQuery1.Indexes.Add do begin
  Name := 'i1';
  Fields := 'Name;BirthDate';
  DescFields := 'BirthDate';
  Active := True;
  Selected := True;
end;
What do you think about this topic? Send feedback!


TADIndex.Distinct Property

TADIndex.Distinct Property
TADIndex Class TADIndex Members uADCompDataSet Namespace published Send Feedback

Controls returning of distinct view value.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, published
Description

Set the Distinct property to True, to include into view only a first record from the set of records with the same index value. The option is similar to the SQL DISTINCT keyword.

Syntax
property Distinct: Boolean;
What do you think about this topic? Send feedback!


TADIndex.Expression Property

TADIndex.Expression Property
TADIndex Class TADIndex Members uADCompDataSet Namespace Example published See Also Send Feedback

Specifies expression which must be used to sort records.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, Example, published, See Also
Description

Set Expression property value to a formula. The dataset view records will be ordered by these formula values, calculated for each record.

Assignment to the Expression property value erases a Fields property value. The view sort order may be either expressional (Expression is specified), either field list based (Fields is specified).

Also use Options to setup sorting.

Syntax
property Expression: String;
See Also

Fields, Options

Example
ADQuery1.Indexes[0].Expression := 'Upper(Left(Name, 1))';
What do you think about this topic? Send feedback!


TADIndex.Fields Property

TADIndex.Fields Property
TADIndex Class TADIndex Members uADCompDataSet Namespace Example published See Also Send Feedback

Identifies the fields that comprise the index.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, Example, published, See Also
Description

Set Fields property value to the ';' separated list of field names with optional modifiers. The dataset view records will be ordered by these field values.

The general syntax for property value is: field[:[D][A][N]][;...]. There:

  • D - is descending modifier. Also may be used DescFields.
  • A - is ascending modifier. It is default order.
  • N - case-insensitive modifier. Also may be used CaseInsFields.

Assignment to Fields property value erases Expression property value. The view sort order may be either expressional (Expression is specified), either field list based (Fields is specified).

Also use Options to setup sorting.

Syntax
property Fields: String;
See Also

DescFields, CaseInsFields, Expression, Options

Example
// sort by Name - case insensitive and by BithDate - descending
ADQuery1.Indexes[0].Fields := 'Name:N;BirthDate:D';
What do you think about this topic? Send feedback!


TADIndex.Filter Property

TADIndex.Filter Property
TADIndex Class TADIndex Members uADCompDataSet Namespace Example published See Also Send Feedback

Specifies the text of a view filter.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, Example, published, See Also
Description

Use Filter property to specify a view filter. When Filter is applied to view, only those records that meet a filter's conditions are available to an application. Filter contains the string that describes the filter condition. See Writing Expressions for details of expression syntax.

To specify sort order for view use either Expression, either Fields properties. To setup filtering use FilterOptions property.

Syntax
property Filter: String;
See Also

Fields, Expression, FilterOptions

Example
ADMemTable.Indexes[0].Filter := 'Name LIKE ''A%''';
What do you think about this topic? Send feedback!


TADIndex.FilterOptions Property

TADIndex.FilterOptions Property
TADIndex Class TADIndex Members uADCompDataSet Namespace published See Also Send Feedback

Specifies filtering options.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, published, See Also
Description

Use FilterOptions to specify filtering options for dataset view:

Option | Description
ekNoCase | String comparisons will be performed case-insensitive.
ekPartial | String comparisons will be performed partially.

All these options may be implemented by programmer using additional constructions in Filter. ekPartial - using LIKE operator, and ekNoCase using UPPER / LOWER functions.

Syntax
property FilterOptions: TADExpressionOptions;
See Also

Filter

What do you think about this topic? Send feedback!


TADIndex.Name Property

TADIndex.Name Property
TADIndex Class TADIndex Members uADCompDataSet Namespace published See Also Send Feedback

Specifies the name of dataset view.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, published, See Also
Description

Use Name to specify the name of a dataset view. This name is used to display item at design time and to find item in a collection.

Syntax
property Name: String;
See Also

TADIndexes.FindIndex, TADIndexes.IndexByName

What do you think about this topic? Send feedback!


TADIndex.Options Property

TADIndex.Options Property
TADIndex Class TADIndex Members uADCompDataSet Namespace published See Also Send Feedback

Specifies sorting options.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, published, See Also
Description

Use Options to specify sorting options for dataset view:

Option | Description
soNoCase | Use case-insensitive sorting for all fields or expression result.
soNullFirst | Put NULL values before not-NULL values when sorting in ascending order. Otherwise - after.
soDescNullLast | Put NULL values after not-NULL values when sorting in descending order. Otherwise - before.
soDescending | Use descending order for full sorting.
soUnique | Enforce uniqueness in view. If the application will try to insert a new record with duplicating sorting field values and TADDataSet.ConstraintsEnabled is True, then exception will be raised.
soPrimary | As above, but dataset view with soPrimary may be only one.
soNoSymbols | Ignore symbols when comparing string to build the sort order.

Default value is empty set.

Syntax
property Options: TADSortOptions;
See Also

Fields, Expression, CaseInsFields, DescFields, TADDataSet.ConstraintsEnabled

What do you think about this topic? Send feedback!


TADIndex.Selected Property

TADIndex.Selected Property
TADIndex Class TADIndex Members uADCompDataSet Namespace published See Also Send Feedback

Specifies, if a dataset view is the current dataset view.

Group

published

Links
TADIndex Class, TADIndex Members, uADCompDataSet Namespace, published, See Also
Description

Set selected to True to make the dataset view active and the current one in a dataset. An alternative is to set TADDataSet.IndexName to the name of a dataset view. The Selected property returns True, if the dataset view is selected.

Syntax
property Selected: Boolean;
See Also

TADDataSet.IndexName, TADDataSet.IndexFieldNames, TADIndex.Active

What do you think about this topic? Send feedback!


TADIndexes Class

TADIndexes Class
public TADIndexes Members Classes See Also Send Feedback

TADIndexes is a collection of TADIndex objects.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADIndexes
File

uADCompDataSet

Links
public, TADIndexes Members, Classes, See Also
Description

TADIndexes is a list of all dataset views, maintained by dataset. A single TADIndex object represents a single maintained dataset view. The dataset views are maintained by dataset automatically, if:

  • TADIndex.Active is True and view is really active (see TADAggregate.ActualActive);
  • TADDataSet.IndexesActive is True.
Syntax
TADIndexes = class(TCollection);
See Also

TADIndex, TADDataSet, TADDataSet.IndexesActive

What do you think about this topic? Send feedback!


TADIndexes Members

TADIndexes Members
TADIndexes Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADIndexes.

Class

TADIndexes Class

Methods
Method | Description
Add | Appends new TADIndex object to a collection.
FindIndex | Find TADIndex object by its name.
FindIndexForFields | Find existing TADIndex object by sort fields and options.
IndexByName | Find TADIndex object by its name and raises exception if it is not found.
Properties
Property | Description
Items | Returns TADIndex object by it index.
Links
TADIndexes Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADIndexes Class Legend Methods Properties Send Feedback

The public members of the TADIndexes class are listed here.

Class

TADIndexes Class

Methods
Method | Description
Add | Appends new TADIndex object to a collection.
FindIndex | Find TADIndex object by its name.
FindIndexForFields | Find existing TADIndex object by sort fields and options.
IndexByName | Find TADIndex object by its name and raises exception if it is not found.
Properties
Property | Description
Items | Returns TADIndex object by it index.
Links
TADIndexes Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADIndexes.Items Property

TADIndexes.Items Property
TADIndexes Class TADIndexes Members uADCompDataSet Namespace public See Also Send Feedback

Returns TADIndex object by it index.

Group

public

Links
TADIndexes Class, TADIndexes Members, uADCompDataSet Namespace, public, See Also
Description

Use Items indexed property to get TADIndex object by it index.

The property is default one, so you does not need to write ADQuery1.Indexes.Items[i], just ADQuery1.Indexes[i].

Syntax
property Items [AIndex: Integer]: TADIndex;
See Also

TADIndex, TCollection.Count

What do you think about this topic? Send feedback!


TADIndexes.Add Method

TADIndexes.Add Method
TADIndexes Class TADIndexes Members uADCompDataSet Namespace Example public See Also Send Feedback

Appends new TADIndex object to a collection.

Group

public

Links
TADIndexes Class, TADIndexes Members, uADCompDataSet Namespace, Example, public, See Also
Description

Call Add method to add new empty TADIndex object to a collection.

Syntax
function Add: TADIndex;
See Also

Items, TCollection.Count

Example
with ADQuery1.Indexes.Add do begin
  Name := 'i1';
  Fields := 'Name';
  Active := True;
end;
What do you think about this topic? Send feedback!


TADIndexes.FindIndex Method

TADIndexes.FindIndex Method
TADIndexes Class TADIndexes Members uADCompDataSet Namespace Example public See Also Send Feedback

Find TADIndex object by its name.

Group

public

Links
TADIndexes Class, TADIndexes Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AName: String | A name of the view to find.
Description

Use FindIndex method to find view by its name. If object is not found, then FindIndex returns nil.

Syntax
function FindIndex(const AName: String): TADIndex;
See Also

TADIndex.Name, IndexByName, FindIndexForFields, Items

Example
var
  oInd: TADIndex;
...
oInd := ADQuery1.Indexes.FindIndex('i1');
if oInd = nil then
  with ADQuery1.Indexes.Add do begin
    Name := 'i1';
    Fields := 'Name';
    Active := True;
  end;
What do you think about this topic? Send feedback!


TADIndexes.FindIndexForFields Method

TADIndexes.FindIndexForFields Method
TADIndexes Class TADIndexes Members uADCompDataSet Namespace Example public See Also Send Feedback

Find existing TADIndex object by sort fields and options.

Group

public

Links
TADIndexes Class, TADIndexes Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AFields: String | A fields to find.
ARequiredOptions: TADSortOptions = [] | A required options.
AProhibitedOptions: TADSortOptions = [] | A prohibited options.
Description

Use FindIndex method to find view by sort fields and sort options. If view is not found, then FindIndexForFields returns nil.

The matched view must have:

  • Fields starting from AFields. Fields may include more fields, than AFields.
  • All ARequiredOptions options must be included into Options.
  • None of AProhibitedOptions must be included into Options.
Syntax
function FindIndexForFields(const AFields: String; ARequiredOptions: TADSortOptions = []; AProhibitedOptions: TADSortOptions = []): TADIndex;
See Also

TADIndex.Fields, TADIndex.Options, FindIndex, IndexByName, Items

Example
var
  oInd: TADIndex;
...
oInd := ADMemTable1.Indexes.FindIndexForFields('ID', [soUnique], []);
if oInd <> nil then
  oInd.Selected := True;
What do you think about this topic? Send feedback!


TADIndexes.IndexByName Method

TADIndexes.IndexByName Method
TADIndexes Class TADIndexes Members uADCompDataSet Namespace Example public See Also Send Feedback

Find TADIndex object by its name and raises exception if it is not found.

Group

public

Links
TADIndexes Class, TADIndexes Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
const AName: String | A name of the view to find.
Description

Use IndexByName method to find dataset view by its name. If view is not found, then IndexByName raises exception.

Syntax
function IndexByName(const AName: String): TADIndex;
See Also

TADIndex.Name, FindIndex, Items

Example
ADQuery1.Indexes.IndexByName('i1').Selected := True;
What do you think about this topic? Send feedback!


TADMasterDataLink Class

TADMasterDataLink Class
public TADMasterDataLink Members Classes See Also Send Feedback

TADMasterDataLink controlls master-detail link between two datasets.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADMasterDataLink
File

uADCompDataSet

Links
public, TADMasterDataLink Members, Classes, See Also
Description

The TADMasterDataLink is a class controlling master-detail link between two datasets. Each FireDAC dataset has public property MasterLink. Use it to control delayed refresh of detail dataset on master dataset scroll or update.

To turn on delayed refresh use TADDataSet.FetchOptions.DetailDelay property. Use DisableDelayedScroll / EnableDelayedScroll to temporary disable delayed refresh and use immediate refresh instead.

Use DisableScroll / EnableScroll to temporary disable refresh.

Syntax
TADMasterDataLink = class(TMasterDataLink);
See Also

Master-Detail Relationship, DetailDelay

What do you think about this topic? Send feedback!


TADMasterDataLink Members

TADMasterDataLink Members
TADMasterDataLink Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADMasterDataLink.

Class

TADMasterDataLink Class

Methods
Method | Description
CancelSync | Cancels delayed detail dataset refreshing.
DisableDelayedScroll | Disables delayed refresh of detail dataset.
DisableScroll | Disables refreshing of detail dataset.
EnableDelayedScroll | Reenables delayed refresh of detail dataset.
EnableScroll | Reenables refresh of detail dataset.
Synchronize | Synchronizes detail dataset with master dataset.
Properties
Property | Description
ActualDelayedScrollEnabled | Returns True, if a scrolling will be really delayed.
DelayedScrollEnabled | Returns True, if a delayed scrolling is enabled.
Links
TADMasterDataLink Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADMasterDataLink Class Legend Methods Properties Send Feedback

The public members of the TADMasterDataLink class are listed here.

Class

TADMasterDataLink Class

Methods
Method | Description
CancelSync | Cancels delayed detail dataset refreshing.
DisableDelayedScroll | Disables delayed refresh of detail dataset.
DisableScroll | Disables refreshing of detail dataset.
EnableDelayedScroll | Reenables delayed refresh of detail dataset.
EnableScroll | Reenables refresh of detail dataset.
Synchronize | Synchronizes detail dataset with master dataset.
Properties
Property | Description
ActualDelayedScrollEnabled | Returns True, if a scrolling will be really delayed.
DelayedScrollEnabled | Returns True, if a delayed scrolling is enabled.
Links
TADMasterDataLink Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADMasterDataLink.ActualDelayedScrollEnabled Property

TADMasterDataLink.ActualDelayedScrollEnabled Property
TADMasterDataLink Class TADMasterDataLink Members uADCompDataSet Namespace public See Also Send Feedback

Returns True, if a scrolling will be really delayed.

Group

public

Links
TADMasterDataLink Class, TADMasterDataLink Members, uADCompDataSet Namespace, public, See Also
Description

Use the ActualDelayedScrollEnabled property to detect when a scrolling will be really delayed for this dataset.

The property returns True, when DelayedScrollEnabled is True and TADDataSet.FetchOptions.DetailDelay is greater than zero.

Syntax
property ActualDelayedScrollEnabled: Boolean;
See Also

DelayedScrollEnabled, DetailDelay

What do you think about this topic? Send feedback!


TADMasterDataLink.DelayedScrollEnabled Property

TADMasterDataLink.DelayedScrollEnabled Property
TADMasterDataLink Class TADMasterDataLink Members uADCompDataSet Namespace public See Also Send Feedback

Returns True, if a delayed scrolling is enabled.

Group

public

Links
TADMasterDataLink Class, TADMasterDataLink Members, uADCompDataSet Namespace, public, See Also
Description

Use the DelayedScrollEnabled property to detect when delayed scrolling is enabled for this dataset.

The property returns True, when for this and for the all master datasets (if any) were no DisableDelayedScroll calls. Otherwise, the property returns False. The property does not check TADDataSet.FetchOptions.DetailDelay for zero value.

Use ActualDelayedScrollEnabled to check, will happens a delayed scrolling or not.

Syntax
property DelayedScrollEnabled: Boolean;
See Also

ActualDelayedScrollEnabled, DisableDelayedScroll, EnableDelayedScroll, DetailDelay

What do you think about this topic? Send feedback!


TADMasterDataLink.CancelSync Method

TADMasterDataLink.CancelSync Method
TADMasterDataLink Class TADMasterDataLink Members uADCompDataSet Namespace public See Also Send Feedback

Cancels delayed detail dataset refreshing.

Group

public

Links
TADMasterDataLink Class, TADMasterDataLink Members, uADCompDataSet Namespace, public, See Also
Parameters
Parameters | Description
AWithDetails: Boolean = True | If True, then will be canceled refreshes for all sub-detail datasets too.
Description

Call CancelSync method to cancel delayed detail dataset refreshing. The method has effect only is delayed refreshing is in effect.

Syntax
procedure CancelSync(AWithDetails: Boolean = True);
See Also

Synchronize

What do you think about this topic? Send feedback!


TADMasterDataLink.DisableDelayedScroll Method

TADMasterDataLink.DisableDelayedScroll Method
TADMasterDataLink Class TADMasterDataLink Members uADCompDataSet Namespace Example public See Also Send Feedback

Disables delayed refresh of detail dataset.

Group

public

Links
TADMasterDataLink Class, TADMasterDataLink Members, uADCompDataSet Namespace, Example, public, See Also
Description

Call DisableDelayedScroll method of the MasterLink property of detail dataset to disable delayed refresh of detail dataset and use immediate refresh instead. The method has effect only is delayed refreshing is in effect.

The method is useful in an application code, which needs to walk through master dataset and read also detail dataset records. And detail dataset has TADDataSet.FetchOptions.DetailDelay property value > 0. This allows to combine delayed refreshing of detail dataset, while user scrolls through master dataset in GUI and synchronized refreshing in code.

To re-enable delayed refresh of detail dataset, use EnableDelayedScroll method. The DisableDelayedScroll / EnableDelayedScroll method calls must be in pairs and may be nested. FireDAC uses counter to track DisableDelayedScroll / EnableDelayedScroll nested calls. The topmost call of DisableDelayedScroll method synchronizes detail dataset with master, if they are out of sync.

To synchronize detail dataset with its master single time, use Synchronize method.

Syntax
procedure DisableDelayedScroll;
See Also

Synchronize, EnableDelayedScroll, DetailDelay

Example
qDetail.MasterLink.DisableDelayedScroll;
try
  qMaster.First;
  while not qMaster.Eof do begin
    if qMaster.Fields[i].AsInteger = 100 then begin
      // read qDetail dataset - it is synchronized with qMaster
    end;
    qMaster.Next;
  end;
finally
  qDetail.MasterLink.EnableDelayedScroll;
end;
What do you think about this topic? Send feedback!


TADMasterDataLink.DisableScroll Method

TADMasterDataLink.DisableScroll Method
TADMasterDataLink Class TADMasterDataLink Members uADCompDataSet Namespace Example public See Also Send Feedback

Disables refreshing of detail dataset.

Group

public

Links
TADMasterDataLink Class, TADMasterDataLink Members, uADCompDataSet Namespace, Example, public, See Also
Description

Call DisableScroll method of the MasterLink property of detail dataset to disable refresh of a detail dataset.

The DisableControls method of master dataset disables all master dataset "feedback". The DisableScroll method allows to turn off detail dataset refreshing of single detail dataset.

To re-enable refresh of detail dataset, use EnableScroll method. The DisableScroll / EnableScroll method calls must be in pairs and may be nested. FireDAC uses counter to track DisableScroll / EnableScroll nested calls. The topmost call of EnableScroll method synchronizes detail dataset with master, if they are out of sync.

Syntax
procedure DisableScroll;
See Also

EnableScroll

Example
qDetail.MasterLink.DisableScroll;
try
  qMaster.First;
  while not qMaster.Eof do begin
    if qMaster.Fields[i].AsInteger = 100 then begin
      qDetail.ApplyMaster;
      // read qDetail dataset - it is synchronized with qMaster
    end;
    qMaster.Next;
  end;
finally
  qDetail.MasterLink.EnableScroll;
end;
What do you think about this topic? Send feedback!


TADMasterDataLink.EnableDelayedScroll Method

TADMasterDataLink.EnableDelayedScroll Method
TADMasterDataLink Class TADMasterDataLink Members uADCompDataSet Namespace public See Also Send Feedback

Reenables delayed refresh of detail dataset.

Group

public

Links
TADMasterDataLink Class, TADMasterDataLink Members, uADCompDataSet Namespace, public, See Also
Description

Call EnableDelayedScroll method of the MasterLink property of detail dataset to re-enable delayed refresh of detail dataset and stop to use immediate refresh. The method reverts effect of DisableDelayedScroll method call.

Syntax
procedure EnableDelayedScroll;
See Also

Synchronize, DisableDelayedScroll

What do you think about this topic? Send feedback!


TADMasterDataLink.EnableScroll Method

TADMasterDataLink.EnableScroll Method
TADMasterDataLink Class TADMasterDataLink Members uADCompDataSet Namespace public See Also Send Feedback

Reenables refresh of detail dataset.

Group

public

Links
TADMasterDataLink Class, TADMasterDataLink Members, uADCompDataSet Namespace, public, See Also
Description

Call EnableScroll method of the MasterLink property of detail dataset to re-enable delayed refresh of detail dataset. The method reverts effect of DisableScroll method call.

Syntax
procedure EnableScroll;
See Also

DisableScroll

What do you think about this topic? Send feedback!


TADMasterDataLink.Synchronize Method

TADMasterDataLink.Synchronize Method
TADMasterDataLink Class TADMasterDataLink Members uADCompDataSet Namespace Example public See Also Send Feedback

Synchronizes detail dataset with master dataset.

Group

public

Links
TADMasterDataLink Class, TADMasterDataLink Members, uADCompDataSet Namespace, Example, public, See Also
Parameters
Parameters | Description
AWithDetails: Boolean = True | If True, then will be synchronized all sub-detail datasets too.
Description

Call Synchronize method to synchronize not yet refreshed detail dataset with the master dataset. The method is useful when delayed refreshing is in effect (TADDataSet.FetchOptions.DetailDelay > 0) or when refreshing is disabled (DisableScroll).

Optionally, you can use DisableDelayedScroll / EnableDelayedScroll to temporary disable / enable delayed refreshing.

Syntax
procedure Synchronize(AWithDetails: Boolean = True);
See Also

CancelSync, DisableDelayedScroll, EnableDelayedScroll, DisableScroll, EnableScroll, DetailDelay

Example
qMaster.First;
while not qMaster.Eof do begin
  if qMaster.Fields[i].AsInteger = 100 then begin
    qDetail.MasterLink.Synchronize(True);
    // read qDetail dataset - here it is synchronized with qMaster
  end;
  qMaster.Next;
end;
What do you think about this topic? Send feedback!


TADSQLTimeIntervalField Class

TADSQLTimeIntervalField Class
public TADSQLTimeIntervalField Members Classes See Also Send Feedback

TADSQLTimeIntervalField represents a time interval field in a dataset.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADSQLTimeIntervalField
File

uADCompDataSet

Links
public, TADSQLTimeIntervalField Members, Classes, See Also
Description

TADSQLTimeIntervalField encapsulates the fundamental behavior common to fields that contain SQL time interval data. The time inverval data in most of the DBMS's is represented by the INTERVAL YEAR TO MONTH or INTERVAL DAY TO SECOND SQL data types.

The TADSQLTimeIntervalField corresponds to the following data type:

  • Delphi 2006 and higher - ftOraInterval;
  • Delphi 2005 or less - ftParadoxOle.

These two data types are synonyms for FireDAC.

Syntax
TADSQLTimeIntervalField = class(TField);
See Also

uADStanSQLTimeInt

What do you think about this topic? Send feedback!


TADSQLTimeIntervalField Members

TADSQLTimeIntervalField Members
TADSQLTimeIntervalField Class Legend Properties Send Feedback

The following tables list the members exposed by TADSQLTimeIntervalField.

Class

TADSQLTimeIntervalField Class

Properties
Property | Description
AsSQLTimeInterval | Value of the time interval field.
IntervalKind | Returns time interval kind.
Links
TADSQLTimeIntervalField Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADSQLTimeIntervalField Class Legend Properties Send Feedback

The public members of the TADSQLTimeIntervalField class are listed here.

Class

TADSQLTimeIntervalField Class

Properties
Property | Description
AsSQLTimeInterval | Value of the time interval field.
IntervalKind | Returns time interval kind.
Links
TADSQLTimeIntervalField Class, Legend, Properties
What do you think about this topic? Send feedback!


TADSQLTimeIntervalField.AsSQLTimeInterval Property

TADSQLTimeIntervalField.AsSQLTimeInterval Property
TADSQLTimeIntervalField Class TADSQLTimeIntervalField Members uADCompDataSet Namespace Example public See Also Send Feedback

Value of the time interval field.

Group

public

Links
TADSQLTimeIntervalField Class, TADSQLTimeIntervalField Members, uADCompDataSet Namespace, Example, public, See Also
Description

Use AsSQLTimeInterval property to read / write time interval field value, represented by the TADSQLTimeInterval structure.

Alternatively, you can use TField.AsVariant property to assign time interval, packed into Variant data type, or TField.AsString.

Syntax
property AsSQLTimeInterval: TADSQLTimeInterval;
See Also

TField.AsVariant, TField.AsString, uADStanSQLTimeInt.TADSQLTimeInterval

Example
var
  rInt: TADSQLTimeInterval;
...
  rInt.Sign := 1;
  rInt.Kind := itYear2Month;
  rInt.Years := 5;
  rInt.Months := 11;
  ADQuery1EventInt.AsSQLTimeInterval := rInt;
What do you think about this topic? Send feedback!


TADSQLTimeIntervalField.IntervalKind Property

TADSQLTimeIntervalField.IntervalKind Property
TADSQLTimeIntervalField Class TADSQLTimeIntervalField Members uADCompDataSet Namespace public See Also Send Feedback

Returns time interval kind.

Group

public

Links
TADSQLTimeIntervalField Class, TADSQLTimeIntervalField Members, uADCompDataSet Namespace, public, See Also
Description

Use IntervalKind property to read the time interval kind of this field. The property value may be itDay2Second or itYear2Month.

Syntax
property IntervalKind: TADSQLTimeIntervalKind;
See Also

uADStanSQLTimeInt

What do you think about this topic? Send feedback!


TADWideMemoField Class

TADWideMemoField Class
public TADWideMemoField Members Classes See Also Send Feedback

TADWideMemoField represents a Unicode encoded memo field in a dataset.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADWideMemoField
File

uADCompDataSet

Links
public, TADWideMemoField Members, Classes, See Also
Description

TADWideMemoField encapsulates the fundamental behavior common to fields that contain Unicode encoded (UTF8 / UTF16) long text data of arbitrary length. Memo fields are a form of binary large object (BLOB) field where the data consists of simple text.

TADWideMemoField was introduced at first to support Unicode long text data on early Delphi versions, which does not had TWideMemoField.

The TADWideMemoField corresponds to the following data type:

  • Delphi 2006 and higher - ftWideMemo;
  • Delphi 2005 or less - ftFmtMemo.

These two data types are synonyms for FireDAC.

Syntax
TADWideMemoField = class(TBlobField);
See Also

TWideMemoField

What do you think about this topic? Send feedback!


TADWideMemoField Members

TADWideMemoField Members
TADWideMemoField Class Legend Properties Send Feedback

The following tables list the members exposed by TADWideMemoField.

Class

TADWideMemoField Class

Properties
Property | Description
Value | Value of long text field.
Links
TADWideMemoField Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADWideMemoField Class Legend Properties Send Feedback

The public members of the TADWideMemoField class are listed here.

Class

TADWideMemoField Class

Properties
Property | Description
Value | Value of long text field.
Links
TADWideMemoField Class, Legend, Properties
What do you think about this topic? Send feedback!


TADWideMemoField.Value Property

TADWideMemoField.Value Property
TADWideMemoField Class TADWideMemoField Members uADCompDataSet Namespace public Send Feedback

Value of long text field.

Group

public

Links
TADWideMemoField Class, TADWideMemoField Members, uADCompDataSet Namespace, public
Description

Use Value property to read / write Unicode encoded long text field value. The value is always UTF16 encoded.

Syntax
property Value: TADWideString;
What do you think about this topic? Send feedback!


TADXMLField Class

TADXMLField Class
public TADXMLField Members Classes See Also Send Feedback

TADXMLField represents a Unicode encoded XML data field in a dataset.

Group

Classes

Class Hierarchy
  uADCompDataSet_TADXMLFielduADCompDataSet_TADXMLField
File

uADCompDataSet

Links
public, TADXMLField Members, Classes, See Also
Description

TADXMLField encapsulates the fundamental behavior common to fields that contain XML text data of arbitrary length. XML fields are a form of binary large object (BLOB) field where the data consists of a XML text.

The TADXMLField corresponds to the ftDBaseOle data type.

Syntax
TADXMLField = class(TADWideMemoField);
See Also

TADWideMemoField

What do you think about this topic? Send feedback!


TADXMLField Members

TADXMLField Members
TADXMLField Class Legend Properties Send Feedback

The following tables list the members exposed by TADXMLField.

Class

TADXMLField Class

Properties
Property | Description
SchemaName | Returns optional XML schema name.
Value | Value of long text field.
Links
TADXMLField Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADXMLField Class Legend Properties Send Feedback

The public members of the TADXMLField class are listed here.

Class

TADXMLField Class

Properties
Property | Description
SchemaName | Returns optional XML schema name.
Links
TADXMLField Class, Legend, Properties
What do you think about this topic? Send feedback!


TADXMLField.SchemaName Property

TADXMLField.SchemaName Property
TADXMLField Class TADXMLField Members uADCompDataSet Namespace public Send Feedback

Returns optional XML schema name.

Group

public

Links
TADXMLField Class, TADXMLField Members, uADCompDataSet Namespace, public
Description

Use SchemaName property to read the optional XML schema name for this field. The semantic of this value is DBMS dependent.

Syntax
property SchemaName: String;
What do you think about this topic? Send feedback!


uADCompGUIx Namespace

uADCompGUIx Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains most of the UI components, including TADGUIxAsyncExecuteDialog, TADGUIxErrorDialog, TADGUIxLoginDialog, TADGUIxScriptDialog and TADGUIxWaitCursor classes.

Classes
Class | Description
TADGUIxAsyncExecuteDialog | The dialog showing a SQL query execution progress.
TADGUIxComponent | The base class for all FireDAC GUIx components.
TADGUIxErrorDialog | The dialog displaying FireDAC exceptions.
TADGUIxLoginDialog | The dialog allows the users to enter their DB credentials.
TADGUIxScriptDialog | The dialog showing a SQL script execution progress.
TADGUIxWaitCursor | The component allowing to control the wait cursor.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADCompGUIx unit contains most of the UI components:

  • TADGUIxAsyncExecuteDialog - dialog showing FireDAC SQL execute progress.
  • TADGUIxErrorDialog - dialog showing FireDAC specific exceptions.
  • TADGUIxLoginDialog - dialog allowing the end users to enter their DB credentials.
  • TADGUIxScriptDialog - dialog showing FireDAC SQL script execution progress.
  • TADGUIxWaitCursor - component implementing and controlling the wait cursor.
See Also

TADResourceOptions.CmdExecMode, Handling Errors, uADStanError, Establishing Connection, Executing SQL Scripts, uADCompScript Namespace

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADCompGUIx Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADGUIxAsyncExecuteDialog | The dialog showing a SQL query execution progress.
TADGUIxComponent | The base class for all FireDAC GUIx components.
TADGUIxErrorDialog | The dialog displaying FireDAC exceptions.
TADGUIxLoginDialog | The dialog allows the users to enter their DB credentials.
TADGUIxScriptDialog | The dialog showing a SQL script execution progress.
TADGUIxWaitCursor | The component allowing to control the wait cursor.
Namespace

uADCompGUIx Namespace

Links
Classes, uADCompGUIx Namespace, Legend
What do you think about this topic? Send feedback!


TADGUIxAsyncExecuteDialog Class

TADGUIxAsyncExecuteDialog Class
public published TADGUIxAsyncExecuteDialog Members Classes See Also Send Feedback

The dialog showing a SQL query execution progress.

Group

Classes

Class Hierarchy
  uADCompGUIx_TADGUIxAsyncExecuteDialoguADCompGUIx_TADGUIxAsyncExecuteDialog
File

uADCompGUIx

Links
public, published, TADGUIxAsyncExecuteDialog Members, Classes, See Also
Description

Use the TADGUIxAsyncExecuteDialog in FireDAC GUI application to display SQL query execution progress. The dialog allows:

  • to see, that a query is executing;
  • to cancel query execution.

The TADQuery will show the dialog automatically, when TADResourceOptions.CmdExecMode is set to amCancelDialog. Only single query may be executed in this mode at each moment at a time.

To use the dialog, drop it on a form or a data module. All additional setups are optional.

IADGUIxAsyncExecuteDialog has Forms and FMX implementations. Use Provider property to select the desired implementation.

Syntax
TADGUIxAsyncExecuteDialog = class(TADGUIxComponent, IADGUIxAsyncExecuteDialog);
See Also

TADResourceOptions.CmdExecMode

What do you think about this topic? Send feedback!


TADGUIxAsyncExecuteDialog Members

TADGUIxAsyncExecuteDialog Members
Events TADGUIxAsyncExecuteDialog Class Legend Properties Send Feedback

The following tables list the members exposed by TADGUIxAsyncExecuteDialog.

Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
Class

TADGUIxAsyncExecuteDialog Class

Properties
Property | Description
AsyncDialog | Reference to dialog interface.
Caption | The dialog caption.
HideDelay | Specifies a delay before dialog hiding.
Prompt | Specifies the dialog prompt.
Provider | Specifies implementation kind.
ShowDelay | Specifies a delay before dialog showing.
Links
Events, TADGUIxAsyncExecuteDialog Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADGUIxAsyncExecuteDialog Class Legend Properties Send Feedback

The public members of the TADGUIxAsyncExecuteDialog class are listed here.

Class

TADGUIxAsyncExecuteDialog Class

Properties
Property | Description
AsyncDialog | Reference to dialog interface.
Links
TADGUIxAsyncExecuteDialog Class, Legend, Properties
What do you think about this topic? Send feedback!


TADGUIxAsyncExecuteDialog.AsyncDialog Property

TADGUIxAsyncExecuteDialog.AsyncDialog Property
TADGUIxAsyncExecuteDialog Class TADGUIxAsyncExecuteDialog Members uADCompGUIx Namespace public Send Feedback

Reference to dialog interface.

Group

public

Links
TADGUIxAsyncExecuteDialog Class, TADGUIxAsyncExecuteDialog Members, uADCompGUIx Namespace, public
Description

Use the AsyncDialog to get a dialog interface reference.

Syntax
property AsyncDialog: IADGUIxAsyncExecuteDialog;
What do you think about this topic? Send feedback!


published

published
Events TADGUIxAsyncExecuteDialog Class Legend Properties Send Feedback

The published members of the TADGUIxAsyncExecuteDialog class are listed here.

Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
Class

TADGUIxAsyncExecuteDialog Class

Properties
Property | Description
Caption | The dialog caption.
HideDelay | Specifies a delay before dialog hiding.
Prompt | Specifies the dialog prompt.
ShowDelay | Specifies a delay before dialog showing.
Links
Events, TADGUIxAsyncExecuteDialog Class, Legend, Properties
What do you think about this topic? Send feedback!


TADGUIxAsyncExecuteDialog.Caption Property

TADGUIxAsyncExecuteDialog.Caption Property
TADGUIxAsyncExecuteDialog Class TADGUIxAsyncExecuteDialog Members uADCompGUIx Namespace published See Also Send Feedback

The dialog caption.

Group

published

Links
TADGUIxAsyncExecuteDialog Class, TADGUIxAsyncExecuteDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the Caption property to specify the dialog caption.

Syntax
property Caption: String;
See Also

Prompt

What do you think about this topic? Send feedback!


TADGUIxAsyncExecuteDialog.HideDelay Property

TADGUIxAsyncExecuteDialog.HideDelay Property
TADGUIxAsyncExecuteDialog Class TADGUIxAsyncExecuteDialog Members uADCompGUIx Namespace published See Also Send Feedback

Specifies a delay before dialog hiding.

Group

published

Links
TADGUIxAsyncExecuteDialog Class, TADGUIxAsyncExecuteDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the HideDelay to specify the delay in milliseconds after a query execution will be finished and other query execution will not be started before the dialog will be hidden. When an application executes one query by one, then setting HideDelay to a correct value allows to avoid flickering.

Syntax
property HideDelay: Integer;
See Also

ShowDelay.

What do you think about this topic? Send feedback!


TADGUIxAsyncExecuteDialog.OnHide Event

TADGUIxAsyncExecuteDialog.OnHide Event
TADGUIxAsyncExecuteDialog Class TADGUIxAsyncExecuteDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires after the dialog will be hidden.

Group

published

Links
TADGUIxAsyncExecuteDialog Class, TADGUIxAsyncExecuteDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnHide event to perform the actions after the dialog was hidden at the end of a query execution.

Syntax
property OnHide: TNotifyEvent;
See Also

OnShow

What do you think about this topic? Send feedback!


TADGUIxAsyncExecuteDialog.OnShow Event

TADGUIxAsyncExecuteDialog.OnShow Event
TADGUIxAsyncExecuteDialog Class TADGUIxAsyncExecuteDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires before the dialog will be displayed.

Group

published

Links
TADGUIxAsyncExecuteDialog Class, TADGUIxAsyncExecuteDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnShow event to perform the actions before the dialog will be displayed.

Syntax
property OnShow: TNotifyEvent;
See Also

OnHide

What do you think about this topic? Send feedback!


TADGUIxAsyncExecuteDialog.Prompt Property

TADGUIxAsyncExecuteDialog.Prompt Property
TADGUIxAsyncExecuteDialog Class TADGUIxAsyncExecuteDialog Members uADCompGUIx Namespace published See Also Send Feedback

Specifies the dialog prompt.

Group

published

Links
TADGUIxAsyncExecuteDialog Class, TADGUIxAsyncExecuteDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the Prompt property to specify the dialog prompt.

Syntax
property Prompt: String;
See Also

Caption

What do you think about this topic? Send feedback!


TADGUIxAsyncExecuteDialog.ShowDelay Property

TADGUIxAsyncExecuteDialog.ShowDelay Property
TADGUIxAsyncExecuteDialog Class TADGUIxAsyncExecuteDialog Members uADCompGUIx Namespace published See Also Send Feedback

Specifies a delay before dialog showing.

Group

published

Links
TADGUIxAsyncExecuteDialog Class, TADGUIxAsyncExecuteDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the ShowDelay to specify the delay in milliseconds after a query execution is started and before the dialog will be shown. When an application executes fast queries, then setting ShowDelay to a correct value allows to avoid flickering.

Syntax
property ShowDelay: Integer;
See Also

HideDelay

What do you think about this topic? Send feedback!


TADGUIxComponent Class

TADGUIxComponent Class
published TADGUIxComponent Members Classes Send Feedback

The base class for all FireDAC GUIx components.

Group

Classes

Class Hierarchy
  uADCompGUIx_TADGUIxComponent
File

uADCompGUIx

Links
published, TADGUIxComponent Members, Classes
Description

The TADGUIxComponent class is not used directly and serves as the base class for all FireDAC GUIx components. The main property is Provider.

Syntax
TADGUIxComponent = class(TADComponent);
What do you think about this topic? Send feedback!


TADGUIxComponent Members

TADGUIxComponent Members
TADGUIxComponent Class Legend Properties Send Feedback

The following tables list the members exposed by TADGUIxComponent.

Class

TADGUIxComponent Class

Properties
Property | Description
Provider | Specifies implementation kind.
Links
TADGUIxComponent Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADGUIxComponent Class Legend Properties Send Feedback

The published members of the TADGUIxComponent class are listed here.

Class

TADGUIxComponent Class

Properties
Property | Description
Provider | Specifies implementation kind.
Links
TADGUIxComponent Class, Legend, Properties
What do you think about this topic? Send feedback!


TADGUIxComponent.Provider Property

TADGUIxComponent.Provider Property
TADGUIxComponent Class TADGUIxComponent Members uADCompGUIx Namespace Example published Send Feedback

Specifies implementation kind.

Group

published

Links
TADGUIxComponent Class, TADGUIxComponent Members, uADCompGUIx Namespace, Example, published
Description

Use Provider property to select the GUIx component implementation:

Value | Description
'Forms' | VCL based implementation for Delphi / C++ Builder. LCL based implementation for Lazarus / FPC.
'FMX' | FireMonkey based implementation for Delphi / C++ Builder XE2 and higher.
'Console' | Console based implementation.

After setting the Provider property at design-time, save the form and corresponding implementation unit will be automatically added to the form "uses" clause. At run-time you will need to add the corresponding implementation unit by hands to the "uses" clause. When corresponding implementation is not linked into application, then an exception may be raised. See the corresponding component description for supported implementations.

Note, when Provider property value was switched from one to another value, then developer may need to delete implementation units for old Provider value from the uses clauses. Eg, switching from 'Forms' to 'FMX' requires to delete uADGUIxFormsXxx units.

If Provider property value is not explicitly assigned, then default value will be used. By default it is 'FMX' for FireMonkey based applications, 'Console' for Windows console applications, 'Forms' - otherwise. The TADGUIxWaitCursor.Provider or uADGUIxIntf.FADGUIxProvider global variable allow to specify the default GUIx provider.

Provider property value must be assigned before first component usage.

Syntax
property Provider: String;
Example
uses
   uADGUIxFMXfLogin;
....
ADGUIxLoginDialog1.Provider := 'FMX';
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADGUIxErrorDialog Class

TADGUIxErrorDialog Class
public published TADGUIxErrorDialog Members Classes See Also Send Feedback

The dialog displaying FireDAC exceptions.

Group

Classes

Class Hierarchy
  uADCompGUIx_TADGUIxErrorDialoguADCompGUIx_TADGUIxErrorDialog
File

uADCompGUIx

Links
public, published, TADGUIxErrorDialog Members, Classes, See Also
Description

Use the TADGUIxErrorDialog in FireDAC GUI application to display FireDAC exceptions to the user. The dialog allows:

  • to browse multiple error items, included into an exception;
  • error kind, native error code, erroneous DB object, etc;
  • original SQL command and parameter values leaded to an exception.

For that the dialog hooks TApllication.OnException event. To use the dialog, drop it on a form or a data module. All additional setups are optional.

IADGUIxErrorDialog has Forms and FMX implementations. Use Provider property to select the desired implementation.

Syntax
TADGUIxErrorDialog = class(TADGUIxComponent, IADGUIxErrorDialog);
See Also

Handling Errors, EADDBEngineException

What do you think about this topic? Send feedback!


TADGUIxErrorDialog Members

TADGUIxErrorDialog Members
TADGUIxErrorDialog Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADGUIxErrorDialog.

Class

TADGUIxErrorDialog Class

Methods
Method | Description
Execute | Displays the error dialog.
Properties
Property | Description
Caption | The dialog caption.
Enabled | Controls the dialog usage.
ErrorDialog | Reference to dialog interface.
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
Provider | Specifies implementation kind.
StayOnTop | Controls the position of dialog.
Links
TADGUIxErrorDialog Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADGUIxErrorDialog Class Legend Methods Properties Send Feedback

The public members of the TADGUIxErrorDialog class are listed here.

Class

TADGUIxErrorDialog Class

Methods
Method | Description
Execute | Displays the error dialog.
Properties
Property | Description
ErrorDialog | Reference to dialog interface.
Links
TADGUIxErrorDialog Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADGUIxErrorDialog.ErrorDialog Property

TADGUIxErrorDialog.ErrorDialog Property
TADGUIxErrorDialog Class TADGUIxErrorDialog Members uADCompGUIx Namespace public Send Feedback

Reference to dialog interface.

Group

public

Links
TADGUIxErrorDialog Class, TADGUIxErrorDialog Members, uADCompGUIx Namespace, public
Description

Use the ErrorDialog to get a dialog interface reference.

Syntax
property ErrorDialog: IADGUIxErrorDialog;
What do you think about this topic? Send feedback!


TADGUIxErrorDialog.Execute Method

TADGUIxErrorDialog.Execute Method
TADGUIxErrorDialog Class TADGUIxErrorDialog Members uADCompGUIx Namespace public Send Feedback

Displays the error dialog.

Group

public

Links
TADGUIxErrorDialog Class, TADGUIxErrorDialog Members, uADCompGUIx Namespace, public
Parameters
Parameters | Description
E: EADDBEngineException | An exception object to show.
Description

Use the Execute method to manually display the error dialog and show the content of an exception object.

Syntax
procedure Execute(E: EADDBEngineException);
What do you think about this topic? Send feedback!


published

published
TADGUIxErrorDialog Class Legend Properties Send Feedback

The published members of the TADGUIxErrorDialog class are listed here.

Class

TADGUIxErrorDialog Class

Properties
Property | Description
Caption | The dialog caption.
Enabled | Controls the dialog usage.
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
StayOnTop | Controls the position of dialog.
Links
TADGUIxErrorDialog Class, Legend, Properties
What do you think about this topic? Send feedback!


TADGUIxErrorDialog.Caption Property

TADGUIxErrorDialog.Caption Property
TADGUIxErrorDialog Class TADGUIxErrorDialog Members uADCompGUIx Namespace published Send Feedback

The dialog caption.

Group

published

Links
TADGUIxErrorDialog Class, TADGUIxErrorDialog Members, uADCompGUIx Namespace, published
Description

Use the Caption property to specify a custom dialog caption.

Syntax
property Caption: String;
What do you think about this topic? Send feedback!


TADGUIxErrorDialog.Enabled Property

TADGUIxErrorDialog.Enabled Property
TADGUIxErrorDialog Class TADGUIxErrorDialog Members uADCompGUIx Namespace published Send Feedback

Controls the dialog usage.

Group

published

Links
TADGUIxErrorDialog Class, TADGUIxErrorDialog Members, uADCompGUIx Namespace, published
Description

Use the Enabled to to control the dialog usage. When Enabled is True, then dialog hooks the Application.OnException event and will display FireDAC exceptions. When Enabled is False, the dialog unhooks the event and will not display exceptions. The default value is True.

Syntax
property Enabled: Boolean;
What do you think about this topic? Send feedback!


TADGUIxErrorDialog.OnHide Property

TADGUIxErrorDialog.OnHide Property
TADGUIxErrorDialog Class TADGUIxErrorDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires after the dialog will be hidden.

Group

published

Links
TADGUIxErrorDialog Class, TADGUIxErrorDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnHide event to perform the actions after the dialog was displayed and user pressed OK button to hide the dialog.

Syntax
property OnHide: TADGUIxErrorDialogEvent;
See Also

OnShow, Enabled

What do you think about this topic? Send feedback!


TADGUIxErrorDialog.OnShow Property

TADGUIxErrorDialog.OnShow Property
TADGUIxErrorDialog Class TADGUIxErrorDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires before the dialog will be displayed.

Group

published

Links
TADGUIxErrorDialog Class, TADGUIxErrorDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnShow event to perform the actions before the dialog will be displayed.

Syntax
property OnShow: TADGUIxErrorDialogEvent;
See Also

OnHide, Enabled

What do you think about this topic? Send feedback!


TADGUIxErrorDialog.StayOnTop Property

TADGUIxErrorDialog.StayOnTop Property
TADGUIxErrorDialog Class TADGUIxErrorDialog Members uADCompGUIx Namespace published See Also Send Feedback

Controls the position of dialog.

Group

published

Links
TADGUIxErrorDialog Class, TADGUIxErrorDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the StayOnTop property to control the dialog position on the screen. When StayOnTop is True, then the dialog will be displayed on top of all windows on the screen. When False, then it will be displayed on top of the application forms.

Syntax
property StayOnTop: Boolean;
See Also

Enabled

What do you think about this topic? Send feedback!


TADGUIxLoginDialog Class

TADGUIxLoginDialog Class
public published TADGUIxLoginDialog Members Example Classes See Also Send Feedback

The dialog allows the users to enter their DB credentials.

Group

Classes

Class Hierarchy
  uADCompGUIx_TADGUIxLoginDialoguADCompGUIx_TADGUIxLoginDialog
File

uADCompGUIx

Links
public, published, TADGUIxLoginDialog Members, Example, Classes, See Also
Description

Use the TADGUIxLoginDialog in FireDAC GUI application to allow to the users:

  • enter their credentials;
  • optionally change expired password.

The dialog may be used globally by all connections in an applications or may be linked directly to TADConnection.To use the dialog globally, drop it on a form or a data module. To use dialog privately by some connection, drop component on a form and set TADConnection.LoginDialog property to this dialog.

The dialog may track the login history. This is useful in environments, which does not require security, for example the developer workstations. In such case, set HistoryEnabled to True. The dialog will store recent credentials in registry or INI-file, as specified by HistoryStorage and HistoryKey properties. And will offer the recent credentials to the user at login.

To limit the number of login retries an application should set LoginRetries property.

IADGUIxLoginDialog has Forms and FMX implementations. Use Provider property to select the desired implementation.

Syntax
TADGUIxLoginDialog = class(TADGUIxComponent, IADGUIxLoginDialog);
See Also

Establishing Connection, TADCustomConnection.LoginDialog

Example
ADGUIxLoginDialog1.Caption := 'Your ERP login';
with ADGUIxLoginDialog1.VisibleItems do begin
  Clear;
  Add('User_name=Your name');
  Add('Password=Your key');
end;
ADGUIxLoginDialog1.HistoryEnabled := False;

ADConnection1.ConnectionDefName := 'Oracle_Demo';
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADGUIxLoginDialog Members

TADGUIxLoginDialog Members
Events TADGUIxLoginDialog Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADGUIxLoginDialog.

Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
Class

TADGUIxLoginDialog Class

Methods
Method | Description
Execute | Executes the login dialog.
GetAllLoginParams | Fills the VisibleItems.
Properties
Property | Description
Caption | The dialog caption.
ChangeExpiredPassword | Controls the user ability to change an expired password.
ConnectionDef | Specifies the connection definition to modify.
HistoryEnabled | Controls the login history storage.
HistoryKey | Specifies where to store login history.
HistoryStorage | Specifies what storage kind to use for the login history.
HistoryWithPassword | Controls should the login history contain the passwords or not.
LoginDialog | Reference to dialog interface.
LoginRetries | Specifies the number of unsuccessful login retries.
OnChangePassword | Fires when user password is expired.
OnLogin | Fires when user should provide database credentials.
Provider | Specifies implementation kind.
VisibleItems | Specifies the visible login dialog fields.
Links
Events, TADGUIxLoginDialog Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADGUIxLoginDialog Class Legend Methods Properties Send Feedback

The public members of the TADGUIxLoginDialog class are listed here.

Class

TADGUIxLoginDialog Class

Methods
Method | Description
Execute | Executes the login dialog.
GetAllLoginParams | Fills the VisibleItems.
Properties
Property | Description
ConnectionDef | Specifies the connection definition to modify.
LoginDialog | Reference to dialog interface.
Links
TADGUIxLoginDialog Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADGUIxLoginDialog.ConnectionDef Property

TADGUIxLoginDialog.ConnectionDef Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace public Send Feedback

Specifies the connection definition to modify.

Group

public

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, public
Description

Use the ConnectionDef property to specify or to get a reference to a connection definition. The dialog uses the connection definition to retrieve specified parameters and to save the entered by user parameter values. When dialog is used with TADConnection, then connection object will automatically specify a connection definition.

Syntax
property ConnectionDef: IADStanConnectionDef;
What do you think about this topic? Send feedback!


TADGUIxLoginDialog.LoginDialog Property

TADGUIxLoginDialog.LoginDialog Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace public Send Feedback

Reference to dialog interface.

Group

public

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, public
Description

Use the LoginDialog to get a dialog interface reference.

Syntax
property LoginDialog: IADGUIxLoginDialog;
What do you think about this topic? Send feedback!


TADGUIxLoginDialog.Execute Method

TADGUIxLoginDialog.Execute Method
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace public Send Feedback

Executes the login dialog.

Group

public

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, public
Parameters
Parameters | Description
ALoginAction: TADGUIxLoginAction | An action to perform after the user successfully entered the database credentials.
Description

Use the Execute method to manually execute the login dialog and enter user credentials. When dialog is used with TADConnection, then connection object will automatically execute the login dialog.

Syntax
function Execute(ALoginAction: TADGUIxLoginAction): Boolean;
What do you think about this topic? Send feedback!


TADGUIxLoginDialog.GetAllLoginParams Method

TADGUIxLoginDialog.GetAllLoginParams Method
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace public See Also Send Feedback

Fills the VisibleItems.

Group

public

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, public, See Also
Description

Use the GetAllLoginParams method to retrieve all driver parameters, eligible for modification by the end user, and put them into VisibleItems property. The connection definition must have DriverID parameter specified.

Syntax
procedure GetAllLoginParams;
See Also

ConnectionDef

What do you think about this topic? Send feedback!


published

published
Events TADGUIxLoginDialog Class Legend Properties Send Feedback

The published members of the TADGUIxLoginDialog class are listed here.

Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
Class

TADGUIxLoginDialog Class

Properties
Property | Description
Caption | The dialog caption.
ChangeExpiredPassword | Controls the user ability to change an expired password.
HistoryEnabled | Controls the login history storage.
HistoryKey | Specifies where to store login history.
HistoryStorage | Specifies what storage kind to use for the login history.
HistoryWithPassword | Controls should the login history contain the passwords or not.
LoginRetries | Specifies the number of unsuccessful login retries.
OnChangePassword | Fires when user password is expired.
OnLogin | Fires when user should provide database credentials.
VisibleItems | Specifies the visible login dialog fields.
Links
Events, TADGUIxLoginDialog Class, Legend, Properties
What do you think about this topic? Send feedback!


TADGUIxLoginDialog.Caption Property

TADGUIxLoginDialog.Caption Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published Send Feedback

The dialog caption.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published
Description

Use the Caption property to specify a custom dialog caption.

Syntax
property Caption: String;
What do you think about this topic? Send feedback!


TADGUIxLoginDialog.ChangeExpiredPassword Property

TADGUIxLoginDialog.ChangeExpiredPassword Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published Send Feedback

Controls the user ability to change an expired password.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published
Description

Use the ChangeExpiredPassword to control the user ability to change an expired password at login to a database. When ChangeExpiredPassword is True and driver returns an exception with Kind = ekUserPwdExpired, then dialog will allow to user to change an expired password. When ChangeExpiredPassword is False, then corresponding exception will be raised. The default value is True.

Syntax
property ChangeExpiredPassword: Boolean;
What do you think about this topic? Send feedback!


TADGUIxLoginDialog.HistoryEnabled Property

TADGUIxLoginDialog.HistoryEnabled Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published See Also Send Feedback

Controls the login history storage.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the HistoryEnabled to control the storage of login history. When HistoryEnabled is True, then login history will be stored as specified by the HistoryStorage and HistoryKey properties. Default value is False.

Syntax
property HistoryEnabled: Boolean;
See Also

HistoryKey, HistoryStorage, HistoryWithPassword

What do you think about this topic? Send feedback!


TADGUIxLoginDialog.HistoryKey Property

TADGUIxLoginDialog.HistoryKey Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published See Also Send Feedback

Specifies where to store login history.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published, See Also
Description

Depending on the HistoryStorage property the login history will be stored:

  • hsRegistry - in specified registry key.
  • hsFile - in specified INI-file.
Syntax
property HistoryKey: String;
See Also

HistoryStorage, HistoryEnabled, HistoryWithPassword

What do you think about this topic? Send feedback!


TADGUIxLoginDialog.HistoryStorage Property

TADGUIxLoginDialog.HistoryStorage Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published See Also Send Feedback

Specifies what storage kind to use for the login history.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use HistoryStorage property to specify the login history storage kind:

  • hsRegistry - in registry. HistoryKey property specifies the registry key, where to store history.
  • hsFile - in INI-file. HistoryKey property specifies the INI-file name, where to store history.
Syntax
property HistoryStorage: TADGUIxLoginHistoryStorage;
See Also

HistoryKey, HistoryEnabled, HistoryWithPassword

What do you think about this topic? Send feedback!


TADGUIxLoginDialog.HistoryWithPassword Property

TADGUIxLoginDialog.HistoryWithPassword Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published See Also Send Feedback

Controls should the login history contain the passwords or not.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the HistoryWithPassword to control the passwords storage in login history. When the HistoryWithPassword is True, then the passwords will be stored in login history. Default value is True.

Syntax
property HistoryWithPassword: Boolean;
See Also

HistoryStorage, HistoryKey, HistoryEnabled

What do you think about this topic? Send feedback!


TADGUIxLoginDialog.LoginRetries Property

TADGUIxLoginDialog.LoginRetries Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published Send Feedback

Specifies the number of unsuccessful login retries.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published
Description

Use the LoginRetries property to specify the number of unsuccessful login retries. When user will fail to enter correct credentials specified number of times, an exception will be raised and login process will be stoped. To disable retires checking set it to some high value. The default value is 3.

Syntax
property LoginRetries: Integer;
What do you think about this topic? Send feedback!


TADGUIxLoginDialog.OnChangePassword Property

TADGUIxLoginDialog.OnChangePassword Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires when user password is expired.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnChangePassword even handler to override the dialog asking user for a new password. In this event handler application may provide the new password by setting NewPassword parameter of the connection definition.

Syntax
property OnChangePassword: TADGUIxLoginDialogEvent;
See Also

ConnectionDef

What do you think about this topic? Send feedback!


TADGUIxLoginDialog.OnHide Event

TADGUIxLoginDialog.OnHide Event
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires after the dialog will be hidden.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnHide event to perform the actions after the dialog was closed.

Syntax
property OnHide: TNotifyEvent;
See Also

OnShow

What do you think about this topic? Send feedback!


TADGUIxLoginDialog.OnLogin Property

TADGUIxLoginDialog.OnLogin Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires when user should provide database credentials.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnLogin even handler to override the dialog asking user for the login credentials. In this event handler application may provide the required connection definition parameters.

Syntax
property OnLogin: TADGUIxLoginDialogEvent;
See Also

ConnectionDef

What do you think about this topic? Send feedback!


TADGUIxLoginDialog.OnShow Event

TADGUIxLoginDialog.OnShow Event
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires before the dialog will be displayed.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnShow event to perform the actions before the dialog will be displayed.

Syntax
property OnShow: TNotifyEvent;
See Also

OnHide

What do you think about this topic? Send feedback!


TADGUIxLoginDialog.VisibleItems Property

TADGUIxLoginDialog.VisibleItems Property
TADGUIxLoginDialog Class TADGUIxLoginDialog Members uADCompGUIx Namespace Example published Send Feedback

Specifies the visible login dialog fields.

Group

published

Links
TADGUIxLoginDialog Class, TADGUIxLoginDialog Members, uADCompGUIx Namespace, Example, published
Description

Use the VisibleItems to specify the list of visible login dialog fields. The list consist of the connection definition parameters, where each parameter is on separated line. Optionally application may specify an alternative label for a field after '='.

Syntax
property VisibleItems: TStrings;
Example
with ADGUIxLoginDialog1.VisibleItems do begin
  Clear;
  Add('Database');
  Add('User_name=Your name');
  Add('Password=Your key');
end;
What do you think about this topic? Send feedback!


TADGUIxScriptDialog Class

TADGUIxScriptDialog Class
public published TADGUIxScriptDialog Members Classes See Also Send Feedback

The dialog showing a SQL script execution progress.

Group

Classes

Class Hierarchy
  uADCompGUIx_TADGUIxScriptDialoguADCompGUIx_TADGUIxScriptDialog
File

uADCompGUIx

Links
public, published, TADGUIxScriptDialog Members, Classes, See Also
Description

Use the TADGUIxScriptDialog in FireDAC GUI application to display SQL script execution progress. The dialog allows:

  • to see, that a script is executing;
  • to see, what part of a script is executing;
  • to see, how much job remains to perform;
  • to cancel script execution.

The TADScript will show the dialog automatically, when TADScript.ScriptDialog property is set to the dialog instance.

To use the dialog, drop it on a form or a data module. All additional setups are optional.

IADGUIxScriptDialog has Forms, FMX and Console implementations. Use Provider property to select the desired implementation.

Syntax
TADGUIxScriptDialog = class(TADGUIxComponent, IADGUIxScriptDialog);
See Also

Executing SQL Scripts, TADScript Class

What do you think about this topic? Send feedback!


TADGUIxScriptDialog Members

TADGUIxScriptDialog Members
Events TADGUIxScriptDialog Class Legend Properties Send Feedback

The following tables list the members exposed by TADGUIxScriptDialog.

Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
Class

TADGUIxScriptDialog Class

Properties
Property | Description
Caption | The dialog caption.
OnInput | Fires when a script executes ACCEPT command.
OnOutput | Fires when a script provides some feedback to a user.
OnPause | Fires when a script executes PAUSE command.
OnProgress | Fires when a script updates the job progress.
Options | Specifies the dialog options.
Provider | Specifies implementation kind.
ScriptDialog | Reference to dialog interface.
Links
Events, TADGUIxScriptDialog Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADGUIxScriptDialog Class Legend Properties Send Feedback

The public members of the TADGUIxScriptDialog class are listed here.

Class

TADGUIxScriptDialog Class

Properties
Property | Description
ScriptDialog | Reference to dialog interface.
Links
TADGUIxScriptDialog Class, Legend, Properties
What do you think about this topic? Send feedback!


TADGUIxScriptDialog.ScriptDialog Property

TADGUIxScriptDialog.ScriptDialog Property
TADGUIxScriptDialog Class TADGUIxScriptDialog Members uADCompGUIx Namespace public Send Feedback

Reference to dialog interface.

Group

public

Links
TADGUIxScriptDialog Class, TADGUIxScriptDialog Members, uADCompGUIx Namespace, public
Description

Use the ScriptDialog to get a dialog interface reference.

Syntax
property ScriptDialog: IADGUIxScriptDialog;
What do you think about this topic? Send feedback!


published

published
Events TADGUIxScriptDialog Class Legend Properties Send Feedback

The published members of the TADGUIxScriptDialog class are listed here.

Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
Class

TADGUIxScriptDialog Class

Properties
Property | Description
Caption | The dialog caption.
OnInput | Fires when a script executes ACCEPT command.
OnOutput | Fires when a script provides some feedback to a user.
OnPause | Fires when a script executes PAUSE command.
OnProgress | Fires when a script updates the job progress.
Options | Specifies the dialog options.
Links
Events, TADGUIxScriptDialog Class, Legend, Properties
What do you think about this topic? Send feedback!


TADGUIxScriptDialog.Caption Property

TADGUIxScriptDialog.Caption Property
TADGUIxScriptDialog Class TADGUIxScriptDialog Members uADCompGUIx Namespace published Send Feedback

The dialog caption.

Group

published

Links
TADGUIxScriptDialog Class, TADGUIxScriptDialog Members, uADCompGUIx Namespace, published
Description

Use the Caption property to specify the dialog caption.

Syntax
property Caption: String;
What do you think about this topic? Send feedback!


TADGUIxScriptDialog.OnHide Event

TADGUIxScriptDialog.OnHide Event
TADGUIxScriptDialog Class TADGUIxScriptDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires after the dialog will be hidden.

Group

published

Links
TADGUIxScriptDialog Class, TADGUIxScriptDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnHide event to perform the actions after the dialog was hidden at end of a script execution.

Syntax
property OnHide: TNotifyEvent;
See Also

OnShow

What do you think about this topic? Send feedback!


TADGUIxScriptDialog.OnInput Property

TADGUIxScriptDialog.OnInput Property
TADGUIxScriptDialog Class TADGUIxScriptDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires when a script executes ACCEPT command.

Group

published

Links
TADGUIxScriptDialog Class, TADGUIxScriptDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnInput event handler to perform required actions to show APrompt to the user and return AResult value to a script.

Syntax
property OnInput: TADGUIxScriptInputEvent;
See Also

OnPause

What do you think about this topic? Send feedback!


TADGUIxScriptDialog.OnOutput Property

TADGUIxScriptDialog.OnOutput Property
TADGUIxScriptDialog Class TADGUIxScriptDialog Members uADCompGUIx Namespace published Send Feedback

Fires when a script provides some feedback to a user.

Group

published

Links
TADGUIxScriptDialog Class, TADGUIxScriptDialog Members, uADCompGUIx Namespace, published
Description

Use the OnOutput event handler to perform required actions to output a AStr string to some console. A provided string is of AKind kind.

Syntax
property OnOutput: TADGUIxScriptOutputEvent;
What do you think about this topic? Send feedback!


TADGUIxScriptDialog.OnPause Property

TADGUIxScriptDialog.OnPause Property
TADGUIxScriptDialog Class TADGUIxScriptDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires when a script executes PAUSE command.

Group

published

Links
TADGUIxScriptDialog Class, TADGUIxScriptDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnPause event handler to perform required actions to show APrompt to the user, pause a script execution and continue on user request.

Syntax
property OnPause: TADGUIxScriptPauseEvent;
See Also

OnInput

What do you think about this topic? Send feedback!


TADGUIxScriptDialog.OnProgress Property

TADGUIxScriptDialog.OnProgress Property
TADGUIxScriptDialog Class TADGUIxScriptDialog Members uADCompGUIx Namespace published Send Feedback

Fires when a script updates the job progress.

Group

published

Links
TADGUIxScriptDialog Class, TADGUIxScriptDialog Members, uADCompGUIx Namespace, published
Description

Use the OnProgress event handler to show the job progress to a user. The event handler receives AInfoProvider parameter, which is a reference to IADGUIxScriptDialogInfoProvider interface. It provides detailed information about job progress.

Syntax
property OnProgress: TADGUIxScriptProgressEvent;
What do you think about this topic? Send feedback!


TADGUIxScriptDialog.OnShow Event

TADGUIxScriptDialog.OnShow Event
TADGUIxScriptDialog Class TADGUIxScriptDialog Members uADCompGUIx Namespace published See Also Send Feedback

Fires before the dialog will be displayed.

Group

published

Links
TADGUIxScriptDialog Class, TADGUIxScriptDialog Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnShow event to perform the actions before the dialog will be displayed.

Syntax
property OnShow: TNotifyEvent;
See Also

OnHide

What do you think about this topic? Send feedback!


TADGUIxScriptDialog.Options Property

TADGUIxScriptDialog.Options Property
TADGUIxScriptDialog Class TADGUIxScriptDialog Members uADCompGUIx Namespace published Send Feedback

Specifies the dialog options.

Group

published

Links
TADGUIxScriptDialog Class, TADGUIxScriptDialog Members, uADCompGUIx Namespace, published
Description

Use the Options property to specify dialog options.

Option | Description
ssCallstack | The dialog will show the current script call stack.
ssConsole | The dialog will show script execution feedback.
ssAutoHide | The dialog will be automatically hidden after a script execution is finished.

The default value is [ssCallstack, ssConsole, ssAutoHide].

Syntax
property Options: TADGUIxScriptOptions;
What do you think about this topic? Send feedback!


TADGUIxWaitCursor Class

TADGUIxWaitCursor Class
public published TADGUIxWaitCursor Members Classes Send Feedback

The component allowing to control the wait cursor.

Group

Classes

Class Hierarchy
  uADCompGUIx_TADGUIxWaitCursoruADCompGUIx_TADGUIxWaitCursor
File

uADCompGUIx

Links
public, published, TADGUIxWaitCursor Members, Classes
Description

Use the TADGUIxWaitCursor to add the IADGUIxWaitCursor interface implementation to your application. This implementation is mandatory for FireDAC applications. And the TADGUIxWaitCursor allows to control the wait cursor.

IADGUIxWaitCursor has Forms, FMX and Console implementations. Use Provider property to select the desired implementation. Note, setting TADGUIxWaitCursor.Provider property value changes also the default application GUIx provider. For example, setting it to 'Console' will set console provider for all GUIx components.

Syntax
TADGUIxWaitCursor = class(TADGUIxComponent, IADGUIxWaitCursor);
What do you think about this topic? Send feedback!


TADGUIxWaitCursor Members

TADGUIxWaitCursor Members
Events TADGUIxWaitCursor Class Legend Properties Send Feedback

The following tables list the members exposed by TADGUIxWaitCursor.

Events
Event | Description
OnHide | Fires before the wait cursor will be hidden.
OnShow | Fires after the wait cursor will be shown.
Class

TADGUIxWaitCursor Class

Properties
Property | Description
Provider | Specifies implementation kind.
ScreenCursor | Specifies the cursor to use when FireDAC is busy.
WaitCursor | Returns reference to wait cursor interface.
Links
Events, TADGUIxWaitCursor Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADGUIxWaitCursor Class Legend Properties Send Feedback

The public members of the TADGUIxWaitCursor class are listed here.

Class

TADGUIxWaitCursor Class

Properties
Property | Description
WaitCursor | Returns reference to wait cursor interface.
Links
TADGUIxWaitCursor Class, Legend, Properties
What do you think about this topic? Send feedback!


TADGUIxWaitCursor.WaitCursor Property

TADGUIxWaitCursor.WaitCursor Property
TADGUIxWaitCursor Class TADGUIxWaitCursor Members uADCompGUIx Namespace public Send Feedback

Returns reference to wait cursor interface.

Group

public

Links
TADGUIxWaitCursor Class, TADGUIxWaitCursor Members, uADCompGUIx Namespace, public
Description

The WaitCursor returns a reference to the IADGUIxWaitCursor interface.

Syntax
property WaitCursor: IADGUIxWaitCursor;
What do you think about this topic? Send feedback!


published

published
Events TADGUIxWaitCursor Class Legend Properties Send Feedback

The published members of the TADGUIxWaitCursor class are listed here.

Events
Event | Description
OnHide | Fires before the wait cursor will be hidden.
OnShow | Fires after the wait cursor will be shown.
Class

TADGUIxWaitCursor Class

Properties
Property | Description
ScreenCursor | Specifies the cursor to use when FireDAC is busy.
Links
Events, TADGUIxWaitCursor Class, Legend, Properties
What do you think about this topic? Send feedback!


TADGUIxWaitCursor.OnHide Event

TADGUIxWaitCursor.OnHide Event
TADGUIxWaitCursor Class TADGUIxWaitCursor Members uADCompGUIx Namespace published See Also Send Feedback

Fires before the wait cursor will be hidden.

Group

published

Links
TADGUIxWaitCursor Class, TADGUIxWaitCursor Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnHide event handler to take some actions before the wait cursor will be hidden.

Syntax
property OnHide: TNotifyEvent;
See Also

OnShow

What do you think about this topic? Send feedback!


TADGUIxWaitCursor.OnShow Event

TADGUIxWaitCursor.OnShow Event
TADGUIxWaitCursor Class TADGUIxWaitCursor Members uADCompGUIx Namespace published See Also Send Feedback

Fires after the wait cursor will be shown.

Group

published

Links
TADGUIxWaitCursor Class, TADGUIxWaitCursor Members, uADCompGUIx Namespace, published, See Also
Description

Use the OnShow event handler to take some actions after the wait cursor will be shown.

Syntax
property OnShow: TNotifyEvent;
See Also

OnHide

What do you think about this topic? Send feedback!


TADGUIxWaitCursor.ScreenCursor Property

TADGUIxWaitCursor.ScreenCursor Property
TADGUIxWaitCursor Class TADGUIxWaitCursor Members uADCompGUIx Namespace published Send Feedback

Specifies the cursor to use when FireDAC is busy.

Group

published

Links
TADGUIxWaitCursor Class, TADGUIxWaitCursor Members, uADCompGUIx Namespace, published
Description

Use the ScreenCursor property to specify the mouse cursor to use to show that FireDAC is busy. Default value is gcrSQLWait.

Syntax
property ScreenCursor: TADGUIxScreenCursor;
What do you think about this topic? Send feedback!


uADCompScript Namespace

uADCompScript Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains TADScript scripting engine class and additional utility methods and classes.

Classes
Class | Description
TADScript | The class implementing SQL script engine, capable to execute a series of SQL queries.
TADScriptCommand | The base class for custom script commands.
TADScriptCommandRegistry | The list of the registered script commands.
TADScriptOptions | The class implementing SQL script engine options.
TADSQLScript | An in-memory stored SQL script.
TADSQLScripts | TADSQLScripts is a collection of the TADSQLScript objects.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADCompScript unit contains:

  • TADScript - SQL script execution engine component;
  • TADScriptCommand - base class for SQL script engine command implementations;
  • TADScriptCommandRegistry - class implementing registry for command implementations;
  • TADScriptOptions - class containing the set of SQL script engine options;
  • TADSQLScript, TADSQLScripts - collection of SQL scripts.
See Also

Executing SQL Scripts, uADCompClient, uADCompScriptCommands

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADCompScript Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADScript | The class implementing SQL script engine, capable to execute a series of SQL queries.
TADScriptCommand | The base class for custom script commands.
TADScriptCommandRegistry | The list of the registered script commands.
TADScriptOptions | The class implementing SQL script engine options.
TADSQLScript | An in-memory stored SQL script.
TADSQLScripts | TADSQLScripts is a collection of the TADSQLScript objects.
Namespace

uADCompScript Namespace

Links
Classes, uADCompScript Namespace, Legend
What do you think about this topic? Send feedback!


TADScript Class

TADScript Class
public published TADScript Members Example Classes See Also Send Feedback

The class implementing SQL script engine, capable to execute a series of SQL queries.

Group

Classes

Class Hierarchy
  uADCompScript_TADScript
File

uADCompScript

Links
public, published, TADScript Members, Example, Classes, See Also
Description

Use TADScript to execute a series of the SQL queries, script control commands, produce a execution log and so on.

Syntax
TADScript = class(TADComponent, IUnknown, IADStanOptions, IADStanErrorHandler, IADStanObject, IADGUIxScriptDialogInfoProvider, IADScriptEngineIntf);
See Also

Executing SQL Scripts, TADQuery, TADConnection

Example

You can find TADScript related demos in the FireDAC\Samples\Comp Layer\TADScript folder:

  • Main - the demo application, showing different aspects of TADScript
  • GUI - the generic SQL script execution GUI application
  • Console - the generic SQL script execution console application
What do you think about this topic? Send feedback!


TADScript Members

TADScript Members
Events TADScript Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADScript.

Events
Event | Description
AfterExecute | The event is fired after the execution is finished.
AfterScript | The event is fired after the script processing is finished.
BeforeExecute | The event is fired before the execution is started.
BeforeScript | The event is fired vefore the script processing is started.
OnConsoleGet | The event allows to an end-user to enter a value.
OnConsoleLockUpdate | The event allows to temporary lock an end-user interface.
OnConsolePut | The event allows to produce an end-user output.
OnError | The event fires, when an error happens, while script engine is communicating with DBMS.
OnGetText | The event fires, when a script engine needs a reference to a stream.
OnHostCommand | The event fires, when a script engine needs to execute external host OS command.
OnPause | The event fires, when a script engine needs to make a pause in script execution.
OnProgress | The event is firing, while a script engine is processing a script.
OnReleaseText | The event fires, when a script engine needs to release a reference to a stream.
OnSpoolPut | The event allows to produce a script execution trace output.
Class

TADScript Class

Methods
Method | Description
AbortJob | Aborts the script validation of execution.
ExecuteAll | Executes a SQL script.
ExecuteFile | Executes the specified SQL script file.
ExecuteFile | Executes the specified SQL script file with the specified arguments.
ExecuteScript | Executes a SQL script contained in the string list.
ExecuteScript | Executes a SQL script contained in the string list with the specified arguments.
ExecuteStep | Extracts and executes a next command from the SQL script.
ValidateAll | Validates the SQL script.
ValidateStep | Validates a next command in the SQL script.
Properties
Property | Description
AllSpools | A list of the all produced spool files.
Arguments | The script arguments.
CallStack | Returns the current script call stack.
Connection | Specifies a connection object.
CurrentCommand | A reference to the current SQL script command.
EOF | Returns True, if current position is beyond the last command in SQL script.
FetchOptions | Fetch options for the SQL commands.
Finished | Controls the script execution.
FormatOptions | Format options for the SQL commands.
LastSpoolFileName | Returns the name of the current active spool file.
Macros | The script macros.
Params | The parameters for the script SQL commands.
Position | Controls the current SQL script position.
ProcessedAfterCommit | Returns the number of the SQL commands processed after last commiting of a transaction.
ResourceOptions | Resource options for the SQL commands.
ScriptDialog | A reference to a script feedback dialog.
ScriptOptions | The script control options.
SQLScriptFileName | The SQL script file name.
SQLScripts | The collection of the SQL scripts.
Status | Returns the script engine current status.
TotalErrors | The number of exceptions raised.
TotalJobDone | The already processed part of the script.
TotalJobSize | The total size of the script.
TotalPct10Done | The percents of the already processed part of the script.
Transaction | Specifies a transaction object.
Links
Events, TADScript Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADScript Class Legend Methods Properties Send Feedback

The public members of the TADScript class are listed here.

Class

TADScript Class

Methods
Method | Description
AbortJob | Aborts the script validation of execution.
ExecuteAll | Executes a SQL script.
ExecuteFile | Executes the specified SQL script file.
ExecuteFile | Executes the specified SQL script file with the specified arguments.
ExecuteScript | Executes a SQL script contained in the string list.
ExecuteScript | Executes a SQL script contained in the string list with the specified arguments.
ExecuteStep | Extracts and executes a next command from the SQL script.
ValidateAll | Validates the SQL script.
ValidateStep | Validates a next command in the SQL script.
Properties
Property | Description
AllSpools | A list of the all produced spool files.
CallStack | Returns the current script call stack.
CurrentCommand | A reference to the current SQL script command.
EOF | Returns True, if current position is beyond the last command in SQL script.
Finished | Controls the script execution.
LastSpoolFileName | Returns the name of the current active spool file.
Position | Controls the current SQL script position.
ProcessedAfterCommit | Returns the number of the SQL commands processed after last commiting of a transaction.
Status | Returns the script engine current status.
TotalErrors | The number of exceptions raised.
TotalJobDone | The already processed part of the script.
TotalJobSize | The total size of the script.
TotalPct10Done | The percents of the already processed part of the script.
Links
TADScript Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADScript.AllSpools Property

TADScript.AllSpools Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

A list of the all produced spool files.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Use the AllSpools property to get a list of all spool files produced by the last ExecuteAll call. The list will be updated right after a new spool file is opened.

Syntax
property AllSpools: TStrings;
See Also

ExecuteAll, SpoolOutput, SpoolFileName, CloseSpool, UpdateSpool

What do you think about this topic? Send feedback!


TADScript.CallStack Property

TADScript.CallStack Property
TADScript Class TADScript Members uADCompScript Namespace public Send Feedback

Returns the current script call stack.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public
Description

Use the CallStack property to get the current script call stack. The stack will contain one line for each active script, starting from the root script. Each line consists of the script name and line number in this script.

Syntax
property CallStack: TStrings;
What do you think about this topic? Send feedback!


TADScript.CurrentCommand Property

TADScript.CurrentCommand Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

A reference to the current SQL script command.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Use the CurrentCommand property to a reference to the current SQL script control command.

Syntax
property CurrentCommand: TADScriptCommand;
See Also

CallStack

What do you think about this topic? Send feedback!


TADScript.EOF Property

TADScript.EOF Property
TADScript Class TADScript Members uADCompScript Namespace Example public See Also Send Feedback

Returns True, if current position is beyond the last command in SQL script.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, public, See Also
Description

Use the EOF property to check the current position specified by the Position property. If the value is True, then position is beyond the last command in the current script. If the value is False, then there may be few other commands after the current position.

Syntax
property EOF: Boolean;
See Also

Position, ValidateStep, ExecuteStep, Finished, Status

Example
procedure TForm1.acRunUpdate(Sender: TObject);
begin
  acStep.Enabled := ADScript1.Connection.Connected and not ADScript1.EOF;
end;
What do you think about this topic? Send feedback!


TADScript.Finished Property

TADScript.Finished Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

Controls the script execution.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Use Finished property to get / set the script termination status.

If Finished is True, then script execution is going to be terminated or is already terminated. If to set Finished to True, then the script execution will be terminated after the current command execution will be finished.

To abort the execution of the current command and the whole script use the AbortJob method. We are recommending always use AbortJob method.

Syntax
property Finished: Boolean;
See Also

AbortJob, Status, ValidateStep, ExecuteStep

What do you think about this topic? Send feedback!


TADScript.LastSpoolFileName Property

TADScript.LastSpoolFileName Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

Returns the name of the current active spool file.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Read the LastSpoolFileName property to get the name of the currently active spool file. If there is no active spooling, then the value will be an empty string.

Syntax
property LastSpoolFileName: String;
See Also

SpoolOutput, SpoolFileName

What do you think about this topic? Send feedback!


TADScript.Position Property

TADScript.Position Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

Controls the current SQL script position.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Use Position property to get / set the script current position. A first line corresponds to Position.Y = 0 and a first character in line corresponds to Position.X = 0.

The property value will be used only for ValidateStep and ExecuteStep methods, when a script is contained in the SQLScripts collection. The next command extraction and execution will start from the specified position. After the command is extracted and executed, the Position will be updated to the new value.

If there is no more commands after specified Position, then the EOF property will return True, otherwise False.

Syntax
property Position: TPoint;
See Also

EOF, ValidateStep, ExecuteStep

What do you think about this topic? Send feedback!


TADScript.ProcessedAfterCommit Property

TADScript.ProcessedAfterCommit Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

Returns the number of the SQL commands processed after last commiting of a transaction.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Read the ProcessedAfterCommit property to get the number of the SQL commands, processed after last transaction commiting.

When the CommitEachNCommands option is 0 (never commit) or is greater than 1 (commit each N SQL commands), then the ProcessedAfterCommit may be greater than 0, if there were executed SQL commands after last COMMIT.

When the CommitEachNCommands is 0, then ProcessedAfterCommit will be always 0.

Syntax
property ProcessedAfterCommit: Integer;
See Also

CommitEachNCommands

What do you think about this topic? Send feedback!


TADScript.Status Property

TADScript.Status Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

Returns the script engine current status.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Read the Status property to get the SQL script engine current status.

Status | Description
ssInactive | Engine is inactive and was not yet running.
ssValidating | Engine is validating the script after calling the ValidateAll or ValidateStep methods.
ssRunning | Engine is executing the script after calling the ExecuteAll or ExecuteStep methods.
ssFinishWithErrors | Engine has finished the run with errors.
ssFinishSuccess | Engine has finished the run without errors.
ssAborted | Engine run has aborted.

Also an application can check the Finished property to see, when the engine has finished.

Syntax
property Status: TADScriptStatus;
See Also

Finished, EOF, TotalErrors

What do you think about this topic? Send feedback!


TADScript.TotalErrors Property

TADScript.TotalErrors Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

The number of exceptions raised.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Read the TotalErrors property to get the number of exceptions raised in the last ValidateStep, ValidateAll, ExecuteStep, ExecuteAll method call.

If the IgnoreError option is True, then exceptions will be hidden. Otherwise, the exceptions will be counted and showed in the user feedback. Also, if the BreakOnError options is True, then the script execution will be stopped after a first exception.

Syntax
property TotalErrors: Integer;
See Also

IgnoreError, BreakOnError

What do you think about this topic? Send feedback!


TADScript.TotalJobDone Property

TADScript.TotalJobDone Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

The already processed part of the script.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Read the TotalJobDone property to get the already processed part of the script and produce an end-user feedback. The value is in bytes.

Syntax
property TotalJobDone: Integer;
See Also

TotalJobSize, TotalPct10Done

What do you think about this topic? Send feedback!


TADScript.TotalJobSize Property

TADScript.TotalJobSize Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

The total size of the script.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Read the TotalJobSize property to get the total size of the script and produce an end-user feedback. The value is in bytes.

An application may call ValidateAll method to get an estimation of the TotalJobSize.

Syntax
property TotalJobSize: Integer;
See Also

TotalJobDone, TotalPct10Done, ValidateAll

What do you think about this topic? Send feedback!


TADScript.TotalPct10Done Property

TADScript.TotalPct10Done Property
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

The percents of the already processed part of the script.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Read the TotalPct10Done property to get the percents of the already processed part of the script and produce an end-user feedback. The value is in 0.1 of percents. For example, 100 = 10%, 567 = 56.7%.

Syntax
property TotalPct10Done: Integer;
See Also

TotalJobDone, TotalJobSize

What do you think about this topic? Send feedback!


TADScript.AbortJob Method

TADScript.AbortJob Method
TADScript Class TADScript Members uADCompScript Namespace Example public See Also Send Feedback

Aborts the script validation of execution.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, public, See Also
Parameters
Parameters | Description
const AWait: Boolean = False | True, if to wait for a DBMS query cancelation.
Description

Call the AbortJob method to abort the script:

  • validation, run by the ValidateStep or ValidateAll method calls;
  • execution, run by the ExecuteStep or ExecuteAll method calls.

The method also will abort any DBMS query launched by the script execution. If AWait is True, then the AbortJob will wait until a DBMS query will finish its processing. After the method call the Status property will be equal to ssAborted and Finished will be True. The method also aborts all nested script calls.

Syntax
procedure AbortJob(const AWait: Boolean = False);
See Also

Finished, Status

Example
// background thread
ADScript1.ExecuteAll;
...
// main thread
ADScript1.AbortJob(True);
What do you think about this topic? Send feedback!


TADScript.ExecuteAll Method

TADScript.ExecuteAll Method
TADScript Class TADScript Members uADCompScript Namespace Example 1 Example 2 public See Also Send Feedback

Executes a SQL script.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example 1, Example 2, public, See Also
Description

Call the ExecuteAll method to execute the SQL script.

The TADScript allows to execute a script from a file pointed by SQLScriptFileName, if it specified. Otherwise from a SQL property of the item with a zero index from the SQLScripts collection.

The script will be executed in full, including all nested script calls. The script execution will be stoped, after one of the following will happen:

  • all script commands are processed;
  • the AbortJob method is called;
  • the Finished property is set to True;
  • EXIT | QUIT | STOP command is found and processed in the script;
  • exception is raised by one of the script commands and IgnoreError option is False and BreakOnError option is True.

The exceptions, raised at the script command executions are not propagated out of ExecuteAll method. To check the script completion status, use:

  • Method result value. If it is True, then there was no errors. If it is False, then there was at least one error.
  • TotalErrors property. It returns the total number of errors at script execution.
  • Status property. It has ssFinishWithErrors value, if there was any error, which stoped the script execution.

Before execution the BeforeExecute event handler will be called. And after the execution is finished the AfterExecute event handler will be called. A script execution may be nested. The BeforeScript event handler will be called before each script start up. And after a script is finished the AfterScript event handler will be called.

Alternatively a script may be executed by the ExecuteFile or ExecuteScript methods.

Syntax
function ExecuteAll: Boolean; overload;
See Also

ExecuteFile, ExecuteScript, AbortJob, BeforeExecute, AfterExecute, BeforeScript, AfterScript

Example 1
ADScript1.SQLScriptFileName := 'c:\temp\createdb.sql';
ADScript1.ExecuteAll;
Example 2

The following code shows how to wrap the script execution into transaction:

ADConnection1.StartTransaction;
try
  ADScript1.ExecuteAll;
finally
  if ADScript1.TotalErrors > 0 then
    ADConnection1.Rollback
  else
    ADConnection1.Commit;
end;
What do you think about this topic? Send feedback!


TADScript.ExecuteFile Method (String)

TADScript.ExecuteFile Method (String)
TADScript Class TADScript Members uADCompScript Namespace Example public See Also Send Feedback

Executes the specified SQL script file.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, public, See Also
Parameters
Parameters | Description
const AFileName: String | A SQL script file to execute.
Description

Use the ExecuteFile method to execute the specifed SQL script file. The method is a shortcut for the following pseudocode:

  SQLScripts.Clear;
  SQLScriptFileName := AFileName;
  ValidateAll;
  ExecuteAll;

Please, see the above methods for details, at first ExecuteAll.

Syntax
procedure ExecuteFile(const AFileName: String); overload;
See Also

SQLScripts, SQLScriptFileName, ValidateAll, ExecuteAll

Example
 ADScript1.ExecuteFile('c:\temp\createdb.sql');
What do you think about this topic? Send feedback!


TADScript.ExecuteFile Method (String, array of String)

TADScript.ExecuteFile Method (String, array of String)
TADScript Class TADScript Members uADCompScript Namespace Example public See Also Send Feedback

Executes the specified SQL script file with the specified arguments.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, public, See Also
Parameters
Parameters | Description
const AFileName: String | A SQL script file to execute.
const AArguments: array of String | A script arguments.
Description

Use the ExecuteFile method to execute the specifed SQL script file with the specified arguments. The method is a shortcut for the following pseudocode:

Arguments := AArguments;
SQLScripts.Clear;
SQLScriptFileName := AFileName;
ValidateAll;
ExecuteAll;

Please, see the above methods for details, at first ExecuteAll.

Syntax
procedure ExecuteFile(const AFileName: String; const AArguments: array of String); overload;
See Also

SQLScripts, SQLScriptFileName, ValidateAll, ExecuteAll, Arguments

Example
ADScript1.ExecuteFile('c:\temp\createdb.sql', ['scott/tiger@mydb', 'c:\temp\']);
What do you think about this topic? Send feedback!


TADScript.ExecuteScript Method (TStrings)

TADScript.ExecuteScript Method (TStrings)
TADScript Class TADScript Members uADCompScript Namespace Example public See Also Send Feedback

Executes a SQL script contained in the string list.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, public, See Also
Parameters
Parameters | Description
const AScript: TStrings | A string list with a SQL script to execute.
Description

Use the ExecuteScript method to execute a SQL script contained in the string list. The method is a shortcut for the following pseudocode:

SQLScripts.Clear;
SQLScripts.Add.SQL := AScript;
SQLScriptFileName := '';
ValidateAll;
ExecuteAll;

Please, see the above methods for details, at first ExecuteAll.

Syntax
procedure ExecuteScript(const AScript: TStrings); overload;
See Also

SQLScripts, SQLScriptFileName, ValidateAll, ExecuteAll

Example
ADScript1.ExecuteScript(Memo1.Lines);
What do you think about this topic? Send feedback!


TADScript.ExecuteScript Method (TStrings, array of String)

TADScript.ExecuteScript Method (TStrings, array of String)
TADScript Class TADScript Members uADCompScript Namespace Example public See Also Send Feedback

Executes a SQL script contained in the string list with the specified arguments.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, public, See Also
Parameters
Parameters | Description
const AScript: TStrings | A string list with a SQL script to execute.
const AArguments: array of String | A script arguments.
Description

Use the ExecuteScript method to execute a SQL script contained in the string list. The method is a shortcut for the following pseudocode:

Arguments := AArguments;
SQLScripts.Clear;
SQLScripts.Add.SQL := AScript;
SQLScriptFileName := '';
ValidateAll;
ExecuteAll;

Please, see the above methods for details, at first ExecuteAll.

Syntax
procedure ExecuteScript(const AScript: TStrings; const AArguments: array of String); overload;
See Also

SQLScripts, SQLScriptFileName, ValidateAll, ExecuteAll, Arguments

Example
ADScript1.ExecuteScript(Memo1.Lines, ['scott/tiger@mydb', 'c:\temp\']);
What do you think about this topic? Send feedback!


TADScript.ExecuteStep Method

TADScript.ExecuteStep Method
TADScript Class TADScript Members uADCompScript Namespace Example public See Also Send Feedback

Extracts and executes a next command from the SQL script.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, public, See Also
Description

Call the ExecuteStep to extract and execute a next command from the SQL script.

The extraction will be started from the Position position in the SQL script, when the SQL script is stored in the SQLScript collection. When the SQL script is stored in a file, then extraction will be started from the current position in a file stream.

After execution of a command, the current position will be forwarded to the first symbol after the processed command. When a script is stored in SQLScript, then the Position property will be updated. When a script is stored in a file, then file stream position will be updated.

If script command execution raised an exception, and there TADScriptOptions.IgnoreError is False, then this exception will propagated out of the method.

Before execution the BeforeExecute event handler will be called. And after the execution is finished the AfterExecute event handler will be called. When a subscript call is encountered, then the subscript will be executed by the ExecuteStep command.

Syntax
function ExecuteStep: Boolean; overload;
See Also

Position, EOF, ValidateStep, ExecuteAll

Example
ADScript1.Position := Memo1.CaretPos;
ADScript1.ExecuteStep;
Memo1.CaretPos := ADScript1.Position;
What do you think about this topic? Send feedback!


TADScript.ValidateAll Method

TADScript.ValidateAll Method
TADScript Class TADScript Members uADCompScript Namespace public See Also Send Feedback

Validates the SQL script.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, public, See Also
Description

Call the ValidateAll method to validate the SQL script.

The ValidateAll method does not execute SQL commands and does not execute many of the script control commands. The method checks the syntax of the next control command and executes it, if that is required to continue with checking. Also, the ValidateAll method updates the total job volume indicator - TotalJobSize. Which is required to show the correct work progress values.

It is a good practice to call the ValidateAll before the ExecuteAll method.

Syntax
function ValidateAll: Boolean; overload;
See Also

ExecuteAll, TotalJobDone

What do you think about this topic? Send feedback!


TADScript.ValidateStep Method

TADScript.ValidateStep Method
TADScript Class TADScript Members uADCompScript Namespace Example public See Also Send Feedback

Validates a next command in the SQL script.

Group

public

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, public, See Also
Description

Call the ValidateStep command to extract and validate a next command in the SQL script.

The ValidateStep method does not execute a SQL command and does not execute many of the script control commands. The method checks the syntax of the next script control command and executes it, if that is required to continue with checking.

The ValidateStep method may be used to skip a next command in the GUI applicaitons allowing to execute add-hoc commands.

Syntax
function ValidateStep: Boolean; overload;
See Also

Position, EOF, ExecuteStep, ValidateAll

Example
ADScript1.Position := Memo1.CaretPos;
ADScript1.ValidateStep;
Memo1.CaretPos := ADScript1.Position;
What do you think about this topic? Send feedback!


published

published
Events TADScript Class Legend Properties Send Feedback

The published members of the TADScript class are listed here.

Events
Event | Description
AfterExecute | The event is fired after the execution is finished.
AfterScript | The event is fired after the script processing is finished.
BeforeExecute | The event is fired before the execution is started.
BeforeScript | The event is fired vefore the script processing is started.
OnConsoleGet | The event allows to an end-user to enter a value.
OnConsoleLockUpdate | The event allows to temporary lock an end-user interface.
OnConsolePut | The event allows to produce an end-user output.
OnError | The event fires, when an error happens, while script engine is communicating with DBMS.
OnGetText | The event fires, when a script engine needs a reference to a stream.
OnHostCommand | The event fires, when a script engine needs to execute external host OS command.
OnPause | The event fires, when a script engine needs to make a pause in script execution.
OnProgress | The event is firing, while a script engine is processing a script.
OnReleaseText | The event fires, when a script engine needs to release a reference to a stream.
OnSpoolPut | The event allows to produce a script execution trace output.
Class

TADScript Class

Properties
Property | Description
Arguments | The script arguments.
Connection | Specifies a connection object.
FetchOptions | Fetch options for the SQL commands.
FormatOptions | Format options for the SQL commands.
Macros | The script macros.
Params | The parameters for the script SQL commands.
ResourceOptions | Resource options for the SQL commands.
ScriptDialog | A reference to a script feedback dialog.
ScriptOptions | The script control options.
SQLScriptFileName | The SQL script file name.
SQLScripts | The collection of the SQL scripts.
Transaction | Specifies a transaction object.
Links
Events, TADScript Class, Legend, Properties
What do you think about this topic? Send feedback!


TADScript.AfterExecute Event

TADScript.AfterExecute Event
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

The event is fired after the execution is finished.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the AfterExecute event to handle the event, when the execution is finished.

All the ExecuteXxx and ValidateXxx methods are calling the AfterExecute event handler at their end.

Syntax
property AfterExecute: TNotifyEvent;
See Also

BeforeExecute, AfterScript

What do you think about this topic? Send feedback!


TADScript.AfterScript Event

TADScript.AfterScript Event
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

The event is fired after the script processing is finished.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the AfterScript event to handle the event, when the script processing is finished.

The event is not called by the ExecuteStep, ValidateStep events, if they does not call a subscripts.

Syntax
property AfterScript: TNotifyEvent;
See Also

BeforeScript, AfterExecute

What do you think about this topic? Send feedback!


TADScript.Arguments Property

TADScript.Arguments Property
TADScript Class TADScript Members uADCompScript Namespace Example 1 Example 2 published See Also Send Feedback

The script arguments.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example 1, Example 2, published, See Also
Description

Use the Arguments property to specify the script arguments.

An argument may be referenced as a substitution variable with the &<argument number> name. The arguments may be used in any place of the script. They are similar to the Macros, but in contrast to the Macros are using positional syntax, while macros are using named syntax.

The @ / @@ commands allow to specify arguments as a comma-separated list after the script name. When arguments are not specified, then they will be inherited from the parent script.

Syntax
property Arguments: TStrings;
See Also

Macros, Params

Example 1
with ADScript1.Arguments do begin
  Add('scott/tiger@orasrv');
  Add('c:\temp\');
end;
with ADScript1.SQLScripts.Add do begin
  SQL.Add(....);
  SQL.Add('connect &1');
  SQL.Add(....);
  SQL.Add('spool &2');
end;
Example 2
with ADScript1.SQLScripts.Add do begin
  SQL.Add('@@DropTab Orders');
  SQL.Add('@@DropTab Tickets');
  SQL.Add('@@DropTab Posts');
end;
with ADScript1.SQLScripts.Add do begin
  Name := 'DropTab';
  SQL.Add('drop table &1;');
  SQL.Add('drop table &1_details;');
end;
What do you think about this topic? Send feedback!


TADScript.BeforeExecute Event

TADScript.BeforeExecute Event
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

The event is fired before the execution is started.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the BeforeExecute event to handle the event, when the execution is started.

All the ExecuteXxx and ValidateXxx methods are calling the BeforeExecute event handler at their start.

Syntax
property BeforeExecute: TNotifyEvent;
See Also

AfterExecute, BeforeScript

What do you think about this topic? Send feedback!


TADScript.BeforeScript Event

TADScript.BeforeScript Event
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

The event is fired vefore the script processing is started.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the AfterScript event to handle the event, when the script processing is started.

The event is not called by the ExecuteStep, ValidateStep events, if they does not call a subscripts.

Syntax
property BeforeScript: TNotifyEvent;
See Also

AfterScript, BeforeExecute

What do you think about this topic? Send feedback!


TADScript.Connection Property

TADScript.Connection Property
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

Specifies a connection object.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

The Connection property value points to a connection object.

The Connection property value must be specified before ExecuteXxx or ValidateXxx calls. When it will be required the connection object will be activated. To control transaction, the Transaction property may be used additionally.

The connection may be changed from the script using CONNECT <connection string command>.

Syntax
property Connection: TADCustomConnection;
See Also

TADScriptOptions.DriverID, Transaction

What do you think about this topic? Send feedback!


TADScript.FetchOptions Property

TADScript.FetchOptions Property
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

Fetch options for the SQL commands.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the FetchOptions to specify the fetch options, which will be used for the SQL commands, returning the cursors.

Syntax
property FetchOptions: TADFetchOptions;
See Also

FormatOptions, ResourceOptions

What do you think about this topic? Send feedback!


TADScript.FormatOptions Property

TADScript.FormatOptions Property
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

Format options for the SQL commands.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the FormatOptions to specify the data format options, which will be used for the SQL command parameters and cursors.

Syntax
property FormatOptions: TADFormatOptions;
See Also

FetchOptions, ResourceOptions

What do you think about this topic? Send feedback!


TADScript.Macros Property

TADScript.Macros Property
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

The script macros.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the Macros property to specify the script macros.

The macros may be used in any place of the script.

Syntax
property Macros: TADMacros;
See Also

Arguments, Params

What do you think about this topic? Send feedback!


TADScript.OnConsoleGet Event

TADScript.OnConsoleGet Event
TADScript Class TADScript Members uADCompScript Namespace Example published See Also Send Feedback

The event allows to an end-user to enter a value.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, published, See Also
Description

Use the OnConsoleGet event to get an end-user input. At moment this is required for the ACCEPT control command.

APrompt - a text used as a prompt to an end-user.

AResult - a text provided by am end-user.

If the ScriptDialog is specified and OnConsoleGet is not specified, then the script dialog will ask an end-user for the input.

Syntax
property OnConsoleGet: TADConsoleGetEvent;
See Also

ScriptDialog, OnConsolePut, OnPause

Example
procedure TForm1.ADScript1ConsoleGet(AEngine: TADScript; const APrompt: String; var AResult: String);
begin
  InputQuery('Enter value', APrompt, AResult);
end;
What do you think about this topic? Send feedback!


TADScript.OnConsoleLockUpdate Event

TADScript.OnConsoleLockUpdate Event
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

The event allows to temporary lock an end-user interface.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the OnConsoleLockUpdate event to temporary lock and unlock an end-user interface. That is required to optimize the output of large data volumes. At moment OnConsoleLockUpdate event is fired with a ALock = True before a cursor data will be output. After that it is fired with ALock = False.

Syntax
property OnConsoleLockUpdate: TADConsoleLockUpdate;
See Also

OnConsolePut

What do you think about this topic? Send feedback!


TADScript.OnConsolePut Event

TADScript.OnConsolePut Event
TADScript Class TADScript Members uADCompScript Namespace Example published See Also Send Feedback

The event allows to produce an end-user output.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, published, See Also
Description

Use the OnConsolePut event to produce an end-user output.

AMessage - a message output to an end-user.

AKind - the output message kind.

If the ScriptDialog is specified, then it will show an end-user output, additionally to the OnConsolePut event handler.

Syntax
property OnConsolePut: TADConsolePutEvent;
See Also

ScriptDialog, OnConsoleGet, OnConsoleLockUpdate

Example
procedure TForm1.ADScrip1ConsolePut(AEngine: TADScript; const AMessage: String; AKind: TADScriptOuputKind);
begin
  mmLog.Lines.AddObject(AMessage, nil);
  Application.ProcessMessages;
end;
What do you think about this topic? Send feedback!


TADScript.OnError Event

TADScript.OnError Event
TADScript Class TADScript Members uADCompScript Namespace published Send Feedback

The event fires, when an error happens, while script engine is communicating with DBMS.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published
Description

Use the OnError event to handle an exception raised, while script engine is communicating with a DBMS.

This event should not be used to produce an end-user output regarding the exceptions.

Syntax
property OnError: TADErrorEvent;
What do you think about this topic? Send feedback!


TADScript.OnGetText Event

TADScript.OnGetText Event
TADScript Class TADScript Members uADCompScript Namespace Example published See Also Send Feedback

The event fires, when a script engine needs a reference to a stream.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, published, See Also
Description

Use the OnGetText event handler to provide a reference to a text stream to the script engine. The text stream is represented by the TADTextFile class, which may work with a string or a TStream reference. If event handler returns nil as the AText parameter value, then default action will be took.

When the text stream will be no more required, the OnReleaseText event will be called.

AFileName - the name of a file to open.

AMode - the file open mode.

AText - returns a reference to the TADTextFile object.

Syntax
property OnGetText: TADGetTextEvent;
See Also

OnReleaseText

Example
procedure TForm1.ADScript1GetText(AEngine: TADScript; const AFileName: string; AMode: TADScriptTextMode; out AText: TADTextFile);
begin
   AText := TADTextFile.Create(...);
end;
What do you think about this topic? Send feedback!


TADScript.OnHostCommand Event

TADScript.OnHostCommand Event
TADScript Class TADScript Members uADCompScript Namespace published Send Feedback

The event fires, when a script engine needs to execute external host OS command.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published
Description

Use the OnHostCommand event handler, to execute external host OS commands, launched by the HOST | !! | SHELL script commands. The event handler may do whatever an application is needing - as launch an OS command, as, for example, show some dialog.

ACommand - a command to execute.

ADoDefault - if True, then default action will be performed. The default action is ShellExecute('open', ACommand) call.

Syntax
property OnHostCommand: TADHostCommandEvent;
What do you think about this topic? Send feedback!


TADScript.OnPause Event

TADScript.OnPause Event
TADScript Class TADScript Members uADCompScript Namespace Example published See Also Send Feedback

The event fires, when a script engine needs to make a pause in script execution.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, published, See Also
Description

Use the OnPause event handler, to make a pause in the script execution, as result of PAUSE <prompt> script command call.

For a GUI application OnPause event handler may show a message box using the ShowMessage procedure call. For a console application OnPause event handler may use WRITELN / READLN RTL procedures.

If the ScriptDialog is specified and OnPause is not specified, then the script dialog will ask an end-user to wait.

Syntax
property OnPause: TADPauseEvent;
See Also

ScriptDialog, OnConsoleGet

Example
procedure TForm1.ADScript1Pause(AEngine: TADScript; const AText: String);
begin
  ShowMessage(AText);
end;
What do you think about this topic? Send feedback!


TADScript.OnProgress Event

TADScript.OnProgress Event
TADScript Class TADScript Members uADCompScript Namespace Example published See Also Send Feedback

The event is firing, while a script engine is processing a script.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, published, See Also
Description

Use the OnProgress event handler, to show a script processing progress to an end-user.

In the event handler an application may read the TotalJobDone, TotalJobSize, TotalPct10Done properties to get information about how large is the full job and what it part is already done.

If the ScriptDialog is specified, then it will show a script processing progress, additionally to the OnProgress event handler.

Syntax
property OnProgress: TNotifyEvent;
See Also

TotalJobDone, TotalJobSize, TotalPct10Done, ScriptDialog

Example
procedure TForm1.ADScript1Progress(ASender: TObject);
begin
  ProgressBar1.Position := ADScript1.TotalPct10Done;
end;
What do you think about this topic? Send feedback!


TADScript.OnReleaseText Event

TADScript.OnReleaseText Event
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

The event fires, when a script engine needs to release a reference to a stream.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the OnReleaseText event handler to release a reference to a text stream, after it was acquired using OnGetText event handler and is no more used by the script engine.

Syntax
property OnReleaseText: TADGetTextEvent;
See Also

OnGetText

What do you think about this topic? Send feedback!


TADScript.OnSpoolPut Event

TADScript.OnSpoolPut Event
TADScript Class TADScript Members uADCompScript Namespace Example published See Also Send Feedback

The event allows to produce a script execution trace output.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, published, See Also
Description

Use the OnSpoolPut event handler to produce a script execution trace output or spool output.

The spool output is enabled:

  • by the SPOOL | OUTPUT script control commands and disabled by them with OFF parameter;
  • by the SpoolOutput and SpoolFileName options.
Syntax
property OnSpoolPut: TADConsolePutEvent;
See Also

SpoolOutput, SpoolFileName

Example
procedure TForm1.ADScript1SpoolPut(AEngine: TADScript; const AMessage: String; AKind: TADScriptOuputKind);
begin
  Memo1.Lines.Add(AMessage);
end;
What do you think about this topic? Send feedback!


TADScript.Params Property

TADScript.Params Property
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

The parameters for the script SQL commands.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the Params property to specify the script SQL command parameters.

The parameters may be used only in the SQL commands.

Syntax
property Params: TADParams;
See Also

Arguments, Macros

What do you think about this topic? Send feedback!


TADScript.ResourceOptions Property

TADScript.ResourceOptions Property
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

Resource options for the SQL commands.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the ResourceOptions to specify the resource usage options, which will be used for the SQL commands.

Syntax
property ResourceOptions: TADResourceOptions;
See Also

FetchOptions, FormatOptions

What do you think about this topic? Send feedback!


TADScript.ScriptDialog Property

TADScript.ScriptDialog Property
TADScript Class TADScript Members uADCompScript Namespace Example 1 Example 2 published See Also Send Feedback

A reference to a script feedback dialog.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example 1, Example 2, published, See Also
Description

Use the ScriptDialog property to set a reference to the TADGUIxScriptDialog instance. The dialog allows to the script engine to communicate with the end-user. The interface implementation provides a standard implementation for the following events:

  • OnConsoleGet
  • OnConsolePut
  • OnProgress
  • OnPause

GUI applications should use TADGUIxScriptDialog and set it Provider property to 'Forms' or 'FMX'. Console applications should set it to 'Console'.

Note, if a dialog is created not at design-time, but at run-time, then the application should include uADGUIxFormsfScript unit for VCL applications, and uADGUIxFMXfScript for FireMonkey applications. The console applications should include uADGUIxConsoleScript unit.

The dialog will be shown when global silent flag is not set to True (ADGUIxSilent() = False).

Syntax
property ScriptDialog: TADGUIxScriptDialog;
See Also

TADGUIxScriptDialog, OnProgress, OnConsoleGet, OnConsolePut, OnPause

Example 1

GUI application:

uses
  uADGUIxFormsfScript;
...
ADGUIxScriptDialog1.Provider := 'Forms';
ADScript1.ScriptDialog := ADGUIxScriptDialog1;
Example 2

Console application:

uses
  uADGUIxConsoleScript;
...
ADGUIxScriptDialog1.Provider := 'Console';
ADScript1.ScriptDialog := ADGUIxScriptDialog1;
What do you think about this topic? Send feedback!


TADScript.ScriptOptions Property

TADScript.ScriptOptions Property
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

The script control options.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

Use the ScriptOptions to set the script control options.

These options may be changed by the script control commands too. The property descriptions are showing the corresponding commands.

Syntax
property ScriptOptions: TADScriptOptions;
See Also

TADScriptOptions

What do you think about this topic? Send feedback!


TADScript.SQLScriptFileName Property

TADScript.SQLScriptFileName Property
TADScript Class TADScript Members uADCompScript Namespace Example published See Also Send Feedback

The SQL script file name.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, published, See Also
Description

Use the SQLScriptFileName property to set a SQL script file name to run.

The name may use macros from the Macros collection or arguments from the Arguments list. If the OS file name does not have an extension, then the ".SQL" will be appended. If there is no path, then DefaultScriptPath option will be used.

A SQL script loading mechanism may be overridden using the OnGetText event handler. Including, for example, loading a SQL script not from a file, but from a EXE resource. Alternatively a SQL script may be submitted from a memory using the SQLScript collection. The SQLScriptFileName has high priority than SQLScript collection.

Note, that ExecuteFile and ExecuteScript methods clear the existing SQLScriptFileName value.

Syntax
property SQLScriptFileName: String;
See Also

ExecuteAll, DefaultScriptPath, OnGetText, SQLScripts, Macros, Arguments

Example
ADScript1.Arguments.Clear;
ADScript1.Arguments.Add('financial');
ADScript1.ScriptOptions.DefaultScriptPath := 'c:\temp';
ADScript1.SQLScriptFileName := 'create_&1_db';
// a file name will be resolved into c:\temp\create_financial_db.sql
ADScript1.ExecuteAll;
What do you think about this topic? Send feedback!


TADScript.SQLScripts Property

TADScript.SQLScripts Property
TADScript Class TADScript Members uADCompScript Namespace Example published See Also Send Feedback

The collection of the SQL scripts.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, Example, published, See Also
Description

Use the SQLScripts collection to store and manage SQL scripts in application memory, instead of the external OS files.

Each collection item has the Name property, identifying a script, and the SQL property, actually containing a script. A script then may be referenced by its name. The item with zero index is the main (root) script and the execution will start from it.

A SQL script loading mechanism may be overridden using the OnGetText event handler. Alternatively a SQL script may be submitted from an external OS file using the SQLScriptFileName property. The SQLScriptFileName has high priority than SQLScript collection.

Note, that ExecuteFile and ExecuteScript methods clear the existing SQLScripts content.

Syntax
property SQLScripts: TADSQLScripts;
See Also

ExecuteAll, OnGetText, SQLScriptFileName

Example
with ADScript1.SQLScripts do begin
  Clear;
  with Add do begin
    Name := 'root';
    SQL.Add('@first');  // explicitly call 'first' script
    SQL.Add('@second'); // explicitly call 'second' script
  end;
  with Add do begin
    Name := 'first';
    SQL.Add('create table t1 (...);');
    SQL.Add('create table t2 (...);');
  end;
  with Add do begin
    Name := 'second';
    SQL.Add('create procedure p1 (...);');
    SQL.Add('create procedure p2 (...);');
  end;
end;
ADScript1.ValidateAll;
ADScript1.ExecuteAll;
What do you think about this topic? Send feedback!


TADScript.Transaction Property

TADScript.Transaction Property
TADScript Class TADScript Members uADCompScript Namespace published See Also Send Feedback

Specifies a transaction object.

Group

published

Links
TADScript Class, TADScript Members, uADCompScript Namespace, published, See Also
Description

The Transaction property value points to a transaction object. The SQL commands, executed by the script engine, will be prepared and executed in the context of this transaction. The Transaction property value must be specified before ExecuteAll or ExecuteStep calls. If a value is not specified, then the commands will use a default transaction object, specified at TADCustomConnection.Transaction or internal connection transaction object.

Syntax
property Transaction: TADCustomTransaction;
See Also

Managing Transactions, Connection

What do you think about this topic? Send feedback!


TADScriptCommand Class

TADScriptCommand Class
public TADScriptCommand Members Example Classes See Also Send Feedback

The base class for custom script commands.

Group

Classes

Class Hierarchy
  uADCompScript_TADScriptCommand
File

uADCompScript

Links
public, TADScriptCommand Members, Example, Classes, See Also
Description

The FireDAC SQL Script engine is fully extendable and allows to create custom script control commands.

Use the TADScriptCommand class as a base class for custom script commands. The command developer must implement the following virtual methods:

  • Keywords - returns the list of the keywords, which run this command;
  • Help - returns the command help;
  • Parse - parses the script and prepares the command for execution;
  • Validate - run the command in script validation mode;
  • Execute - run the command in actual execution mode.

The command class must be registered with SQL Script engine, using ADScriptCommandRegistry().AddCommand(...) call.

Syntax
TADScriptCommand = class(TObject);
See Also

Executing SQL Scripts, SQL Script Control Commands, Developing Custom Commands, AddCommand

Example

Please, check the uADCompScriptCommands unit for the command examples.

What do you think about this topic? Send feedback!


TADScriptCommand Members

TADScriptCommand Members
TADScriptCommand Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADScriptCommand.

Class

TADScriptCommand Class

Methods
Method | Description
AbortJob | Implements SQL script command abortion.
Execute | Implements the script control command execution.
Help | Implements the command help output.
Keywords | Implements command keywords providing.
Parse | Implements script command parsing.
Validate | Implements the script control command validation.
Properties
Property | Description
Engine | Returns a reference to SQL script engine.
EngineIntf | Returns reference to SQL script engine private API.
Parser | Returns reference to a SQL Script parser object.
Position | Returns the current script command position.
Links
TADScriptCommand Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADScriptCommand Class Legend Methods Properties Send Feedback

The public members of the TADScriptCommand class are listed here.

Class

TADScriptCommand Class

Methods
Method | Description
AbortJob | Implements SQL script command abortion.
Execute | Implements the script control command execution.
Help | Implements the command help output.
Keywords | Implements command keywords providing.
Parse | Implements script command parsing.
Validate | Implements the script control command validation.
Properties
Property | Description
Engine | Returns a reference to SQL script engine.
EngineIntf | Returns reference to SQL script engine private API.
Parser | Returns reference to a SQL Script parser object.
Position | Returns the current script command position.
Links
TADScriptCommand Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADScriptCommand.Engine Property

TADScriptCommand.Engine Property
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Returns a reference to SQL script engine.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Description

Use the Engine property to get the reference to SQL script engine.

Syntax
property Engine: TADScript;
See Also

Developing Custom Commands, EngineIntf

What do you think about this topic? Send feedback!


TADScriptCommand.EngineIntf Property

TADScriptCommand.EngineIntf Property
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Returns reference to SQL script engine private API.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Description

Use the EngineIntf to get a reference to SQL script engine private API, accessible only to script command classes.

Syntax
property EngineIntf: IADScriptEngineIntf;
See Also

Developing Custom Commands, Engine

What do you think about this topic? Send feedback!


TADScriptCommand.Parser Property

TADScriptCommand.Parser Property
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Returns reference to a SQL Script parser object.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Description

Use the Parser property to get a reference to a SQL Script parser object. It is useful only inside of Parse method implementation.

Syntax
property Parser: TADScriptParser;
See Also

Developing Custom Commands, Parse

What do you think about this topic? Send feedback!


TADScriptCommand.Position Property

TADScriptCommand.Position Property
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Returns the current script command position.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Description

Use the Position property to get / set the current SQL script position. This property is useful only in Parse method implementation.

Syntax
property Position: TPoint;
See Also

Developing Custom Commands, Parse

What do you think about this topic? Send feedback!


TADScriptCommand.AbortJob Method

TADScriptCommand.AbortJob Method
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Implements SQL script command abortion.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Parameters
Parameters | Description
const AWait: Boolean = False | True, if the AbortJob must wait, until the execution will be finished.
Description

The AbortJob method implementation allows to abort the SQL script execution in full, by terminating the current control command execution. The method may be calling from other thread, than Execute method.

Syntax
procedure AbortJob(const AWait: Boolean = False); virtual;
See Also

Developing Custom Commands, Execute

What do you think about this topic? Send feedback!


TADScriptCommand.Execute Method

TADScriptCommand.Execute Method
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Implements the script control command execution.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Description

The Execute method implementation is responsible for the script control command actual execution. The method should use the internal data prepared by the Parse method call.

Syntax
procedure Execute; virtual;
See Also

Developing Custom Commands, Parse

What do you think about this topic? Send feedback!


TADScriptCommand.Help Method

TADScriptCommand.Help Method
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Implements the command help output.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Description

The Help method provides the command readable description, which may be output to a script console using HELP script command.

Syntax
class function Help: String; virtual;
See Also

Developing Custom Commands

What do you think about this topic? Send feedback!


TADScriptCommand.Keywords Method

TADScriptCommand.Keywords Method
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Implements command keywords providing.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Parameters
Parameters | Description
AKwds: TStrings | The keyword list.
Description

The Keywords method implementation returns the keyword list, which SQL Script engine will use to recognize this command in script.

Each keyword consist from mandatory part (upper case characters) and optional part (lower case characters). The mandatory part must be unique across other commands. The optional part may be avoided in script text.

Syntax
class procedure Keywords(AKwds: TStrings); virtual;
See Also

Developing Custom Commands, Parse

What do you think about this topic? Send feedback!


TADScriptCommand.Parse Method

TADScriptCommand.Parse Method
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Implements script command parsing.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Parameters
Parameters | Description
const AKwd: String | A keyword, which triggered this command execution.
Description

The parse method implementation parses the script text and builds an command internal state, which will be used by the Execute and Validatemethods.

Syntax
function Parse(const AKwd: String): Boolean; virtual;
See Also

Developing Custom Commands, Execute, Keywords

What do you think about this topic? Send feedback!


TADScriptCommand.Validate Method

TADScriptCommand.Validate Method
TADScriptCommand Class TADScriptCommand Members uADCompScript Namespace public See Also Send Feedback

Implements the script control command validation.

Group

public

Links
TADScriptCommand Class, TADScriptCommand Members, uADCompScript Namespace, public, See Also
Description

The Validate method implementation is responsible for the script control command validation mode. The method should use the internal data prepared by the Parse method call.

Syntax
procedure Validate; virtual;
See Also

Developing Custom Commands, Execute, Parse

What do you think about this topic? Send feedback!


TADScriptCommandRegistry Class

TADScriptCommandRegistry Class
public TADScriptCommandRegistry Members Classes See Also Send Feedback

The list of the registered script commands.

Group

Classes

Class Hierarchy
  uADCompScript_TADScriptCommandRegistry
File

uADCompScript

Links
public, TADScriptCommandRegistry Members, Classes, See Also
Description

The TADScriptCommandRegistry class implement the registry of the script commands.

Syntax
TADScriptCommandRegistry = class(TObject);
See Also

Executing SQL Scripts, Developing Custom Commands, TADScriptCommand

What do you think about this topic? Send feedback!


TADScriptCommandRegistry Members

TADScriptCommandRegistry Members
TADScriptCommandRegistry Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADScriptCommandRegistry.

Class

TADScriptCommandRegistry Class

Methods
Method | Description
AddCommand | Registers new command class.
LookupCommand | Finds a command class by the command name.
Properties
Property | Description
Commands | Returns reference to a command class by the index.
Count | Returns the number of registered command classes.
Links
TADScriptCommandRegistry Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADScriptCommandRegistry Class Legend Methods Properties Send Feedback

The public members of the TADScriptCommandRegistry class are listed here.

Class

TADScriptCommandRegistry Class

Methods
Method | Description
AddCommand | Registers new command class.
LookupCommand | Finds a command class by the command name.
Properties
Property | Description
Commands | Returns reference to a command class by the index.
Count | Returns the number of registered command classes.
Links
TADScriptCommandRegistry Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADScriptCommandRegistry.Commands Property

TADScriptCommandRegistry.Commands Property
TADScriptCommandRegistry Class TADScriptCommandRegistry Members uADCompScript Namespace public See Also Send Feedback

Returns reference to a command class by the index.

Group

public

Links
TADScriptCommandRegistry Class, TADScriptCommandRegistry Members, uADCompScript Namespace, public, See Also
Description

Use Commands property to get a registered script command class by its index.

Syntax
property Commands [AIndex: Integer]: TADScriptCommandClass;
See Also

Count

What do you think about this topic? Send feedback!


TADScriptCommandRegistry.Count Property

TADScriptCommandRegistry.Count Property
TADScriptCommandRegistry Class TADScriptCommandRegistry Members uADCompScript Namespace public See Also Send Feedback

Returns the number of registered command classes.

Group

public

Links
TADScriptCommandRegistry Class, TADScriptCommandRegistry Members, uADCompScript Namespace, public, See Also
Description

Use Count property to get the number of registered script command classes.

Syntax
property Count: Integer;
See Also

Commands

What do you think about this topic? Send feedback!


TADScriptCommandRegistry.AddCommand Method

TADScriptCommandRegistry.AddCommand Method
TADScriptCommandRegistry Class TADScriptCommandRegistry Members uADCompScript Namespace public See Also Send Feedback

Registers new command class.

Group

public

Links
TADScriptCommandRegistry Class, TADScriptCommandRegistry Members, uADCompScript Namespace, public, See Also
Parameters
Parameters | Description
ACommand: TADScriptCommandClass | A command class.
Description

Use AddCommand method to register new script command class.

Syntax
procedure AddCommand(ACommand: TADScriptCommandClass);
See Also

Developing Custom Commands, Commands, Count

What do you think about this topic? Send feedback!


TADScriptCommandRegistry.LookupCommand Method

TADScriptCommandRegistry.LookupCommand Method
TADScriptCommandRegistry Class TADScriptCommandRegistry Members uADCompScript Namespace public See Also Send Feedback

Finds a command class by the command name.

Group

public

Links
TADScriptCommandRegistry Class, TADScriptCommandRegistry Members, uADCompScript Namespace, public, See Also
Parameters
Parameters | Description
const AStr: String | A keyword.
out ACommand: TADScriptCommandClass | A command class.
Description

The LookupCommand method is used by the ADScript to find the registered command class by its keyword.

Syntax
function LookupCommand(const AStr: String; out ACommand: TADScriptCommandClass): TADScriptCommandLookupRes;
See Also

AddCommand

What do you think about this topic? Send feedback!


TADScriptOptions Class

TADScriptOptions Class
published TADScriptOptions Members Classes See Also Send Feedback

The class implementing SQL script engine options.

Group

Classes

Class Hierarchy
  uADCompScript_TADScriptOptions
File

uADCompScript

Links
published, TADScriptOptions Members, Classes, See Also
Description

The TADScriptOptions class contains a set of the SQL script engine options.

Syntax
TADScriptOptions = class(TPersistent);
See Also

Executing SQL Scripts, TADScript

What do you think about this topic? Send feedback!


TADScriptOptions Members

TADScriptOptions Members
TADScriptOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADScriptOptions.

Class

TADScriptOptions Class

Methods
Method | Description
Assign | Assigns a TADScriptOptions object to this object.
Reset | Reset this object property values to their default state.
Properties
Property | Description
AutoPrintParams | Controls the output of the parameter values after a SQL command execution.
BreakOnError | Controls an action the script engine should take if an error has happened.
CharacterSet | Specifies the default connection character set.
ClientLib | Specifies the default connection client library.
ColumnHeadings | Controls output of the result set column headers.
CommandSeparator | Specifies the SQL command separator.
CommitEachNCommands | Specifies the number of SQL commands, after which a COMMIT must be performed.
ConsoleOutput | Controls the script engine output to a console.
DefaultDataPath | Specifies default path to the data files for the COPY command.
DefaultScriptPath | Specifies default path to the script files.
DriverID | Specifies the default connection driver ID.
DropNonexistObj | Controls the dropping of the nonexistent database objects.
EchoCommands | Specifies what parts of a SQL script must be echoed to console.
EchoCommandTrim | Controls the command echo output trimming.
FeedbackCommands | Controls the feedback output after each SQL command execution.
FeedbackScript | Controls the feedback output after each SQL script execution.
FileEncoding | Specifies the SQL script file encoding.
FileEndOfLine | Specifies the SQL script file end-of-line character sequence.
IgnoreError | Controls the script engine action on the errors.
LineSize | Specifies the maximum line width.
MacroExpand | Controls macro substitution for script engine.
MaxStringWidth | Specifies the maximum string field value size.
PageSize | Specifies the rowset page size.
ParamArraySize | Specifies the Array DML size.
RaisePLSQLErrors | Controls raising of exceptions after the PL/SQL compilation errors.
SpoolFileName | Specifies the spool file name.
SpoolOutput | Controls the spooling output mode.
SQLDialect | Specifies the SQL dialect for new Firebird or Interbase connections.
Timing | Controls the command performance feedback.
TrimConsole | Controls the right spaces trimming from the console output.
TrimSpool | Controls the right spaces trimming from the spool output.
Verify | Enables to show a complete SQL command text before execution.
Links
TADScriptOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
TADScriptOptions Class Legend Methods Properties Send Feedback

The published members of the TADScriptOptions class are listed here.

Class

TADScriptOptions Class

Methods
Method | Description
Assign | Assigns a TADScriptOptions object to this object.
Reset | Reset this object property values to their default state.
Properties
Property | Description
AutoPrintParams | Controls the output of the parameter values after a SQL command execution.
BreakOnError | Controls an action the script engine should take if an error has happened.
CharacterSet | Specifies the default connection character set.
ClientLib | Specifies the default connection client library.
ColumnHeadings | Controls output of the result set column headers.
CommandSeparator | Specifies the SQL command separator.
CommitEachNCommands | Specifies the number of SQL commands, after which a COMMIT must be performed.
ConsoleOutput | Controls the script engine output to a console.
DefaultDataPath | Specifies default path to the data files for the COPY command.
DefaultScriptPath | Specifies default path to the script files.
DriverID | Specifies the default connection driver ID.
DropNonexistObj | Controls the dropping of the nonexistent database objects.
EchoCommands | Specifies what parts of a SQL script must be echoed to console.
EchoCommandTrim | Controls the command echo output trimming.
FeedbackCommands | Controls the feedback output after each SQL command execution.
FeedbackScript | Controls the feedback output after each SQL script execution.
FileEncoding | Specifies the SQL script file encoding.
FileEndOfLine | Specifies the SQL script file end-of-line character sequence.
IgnoreError | Controls the script engine action on the errors.
LineSize | Specifies the maximum line width.
MacroExpand | Controls macro substitution for script engine.
MaxStringWidth | Specifies the maximum string field value size.
PageSize | Specifies the rowset page size.
ParamArraySize | Specifies the Array DML size.
RaisePLSQLErrors | Controls raising of exceptions after the PL/SQL compilation errors.
SpoolFileName | Specifies the spool file name.
SpoolOutput | Controls the spooling output mode.
SQLDialect | Specifies the SQL dialect for new Firebird or Interbase connections.
Timing | Controls the command performance feedback.
TrimConsole | Controls the right spaces trimming from the console output.
TrimSpool | Controls the right spaces trimming from the spool output.
Verify | Enables to show a complete SQL command text before execution.
Links
TADScriptOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADScriptOptions.AutoPrintParams Property

TADScriptOptions.AutoPrintParams Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published Send Feedback

Controls the output of the parameter values after a SQL command execution.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published
Description

Set AutoPrintParams property to True to enable the SQL command parameter output after the command execution. The default value is False.

The property may be set from a script using SET AUTOPRINT ON|OFF command.

Syntax
property AutoPrintParams: Boolean;
What do you think about this topic? Send feedback!


TADScriptOptions.BreakOnError Property

TADScriptOptions.BreakOnError Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls an action the script engine should take if an error has happened.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set BreakOnError to True to stop a script execution on first error. The default value is False. The property has effect only when IgnoreError is False.

The property may be set from a script using SET BREAK ON|OFF command.

Syntax
property BreakOnError: Boolean;
See Also

IgnoreError

What do you think about this topic? Send feedback!


TADScriptOptions.CharacterSet Property

TADScriptOptions.CharacterSet Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies the default connection character set.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Use the CharacterSet property to specify the character set, which will be used for the script CONNECT <connection string> command.

The property may be set from a script using SET (CHARACTERset | NAMES) <value> command.

Syntax
property CharacterSet: String;
See Also

DriverID, ClientLib

What do you think about this topic? Send feedback!


TADScriptOptions.ClientLib Property

TADScriptOptions.ClientLib Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace Example 1 Example 2 published See Also Send Feedback

Specifies the default connection client library.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, Example 1, Example 2, published, See Also
Description

Use the ClientLib property to specify the DBMS client library, which will be used for the script CONNECT <connection string> command. Note, that setting ClientLib has effect only before a first connection to a DB will be established.

The property may be set from a script using SET CLIENTlib <value> command.

Syntax
property ClientLib: String;
See Also

DriverID, TADScript.Connection

Example 1
ADScript1.ScriptOptions.DriverID := 'IB';
ADScript1.ScriptOptions.ClientLib := 'c:\fbclient.dll';
with ADScript1.SQLScripts.Add do begin
  SQL.Add(...);
  SQL.Add('connect sysdba/masterkey');
end;
Example 2
with ADScript1.SQLScripts.Add do begin
  SQL.Add('SET DRIVERID IB');
  SQL.Add('SET CLIENTLIB ''c:\fbclient.dll''');
  SQL.Add('connect sysdba/masterkey');
end;
What do you think about this topic? Send feedback!


TADScriptOptions.ColumnHeadings Property

TADScriptOptions.ColumnHeadings Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls output of the result set column headers.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set property ColumnHeadings to False to suppress output of the result set column headings at beginning of result set and at beginning of each next page with the result set rows. The default value is True. The headings will be output before each PageSize rows.

The property may be set from a script using SET HEADING ON|OFF command.

Syntax
property ColumnHeadings: Boolean;
See Also

PageSize, ConsoleOutput, SpoolOutput

What do you think about this topic? Send feedback!


TADScriptOptions.CommandSeparator Property

TADScriptOptions.CommandSeparator Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies the SQL command separator.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Use the CommandSeparator property to specify the SQL command separator. The default value is empty string, that means, that actual separator value will be choosed depending on a DBMS. For example, ';' for Oracle and 'go' for SQL Server. If a DBMS is not known to FireDAC, then ';' will be used as actual command separator value.

The property may be set from a script using SET (CMDSep | TERMinator) <value> command.

Syntax
property CommandSeparator: String;
See Also

ActualCommandSeparator

What do you think about this topic? Send feedback!


TADScriptOptions.CommitEachNCommands Property

TADScriptOptions.CommitEachNCommands Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies the number of SQL commands, after which a COMMIT must be performed.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set CommitEachNCommands to the number of SQL commands, after which the script engine will perform COMMIT. Set this property to 0 to enable auto-commit mode, where each SQL command will be committed. The default value is 0.

The property may be set from a script using SET AUTOCOMMIT N command.

Syntax
property CommitEachNCommands: Integer;
See Also

TADTxOptions.AutoCommit

What do you think about this topic? Send feedback!


TADScriptOptions.ConsoleOutput Property

TADScriptOptions.ConsoleOutput Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the script engine output to a console.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set ConsoleOutput to True to enable scrupt engine output to a console. The default value is True. The output will be provided through the script dialog, if it is attached to the TADScript.ScriptDialog, and/or TADScript.OnConsolePut event handler.

The property may be set from a script using SET (TERMOUT | CONSOLE) ON|OFF command.

Syntax
property ConsoleOutput: Boolean;
See Also

TrimConsole, TADScript.OnConsolePut, TADScript.ScriptDialog

What do you think about this topic? Send feedback!


TADScriptOptions.DefaultDataPath Property

TADScriptOptions.DefaultDataPath Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published Send Feedback

Specifies default path to the data files for the COPY command.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published
Description

Set DefaultDataPath property to a folder with the text data files, which will be used by the COPY SQL script command. If COPY command has text data file without a path specified, then DefaultDataPath will be used as a path.

Syntax
property DefaultDataPath: String;
What do you think about this topic? Send feedback!


TADScriptOptions.DefaultScriptPath Property

TADScriptOptions.DefaultScriptPath Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies default path to the script files.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set DefaultScriptPath property value to a folder with the SQL script files. If a script file name is specified without a path, then DefaultScriptPath will be used as a path.

Syntax
property DefaultScriptPath: String;
See Also

TADScript.SQLScriptFileName

What do you think about this topic? Send feedback!


TADScriptOptions.DriverID Property

TADScriptOptions.DriverID Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace Example published See Also Send Feedback

Specifies the default connection driver ID.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, Example, published, See Also
Description

Use the DriverID property to specify the ID of default driver, which will be used for the script CONNECT <connection string> command. The property may be set from a script using SET DRIVERid <value> command.

Syntax
property DriverID: String;
See Also

TADScript.Connection

Example
ADScript1.ScriptOptions.DriverID := 'Ora';
with ADScript1.SQLScripts.Add do begin
  SQL.Add(...);
  SQL.Add('connect scott/tiger@orasrv');
end;
What do you think about this topic? Send feedback!


TADScriptOptions.DropNonexistObj Property

TADScriptOptions.DropNonexistObj Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the dropping of the nonexistent database objects.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set DropNonexistObj to True to ignore the "table / view / what else not exists" error at the DROP or ALTER TABLE DROP CONSTRAINT SQL command execution. This is useful to avoid the checking for the dropping object existence. The default value is True.

The property may be set from a script using SET DROPnonexistent ON|OFF command.

Syntax
property DropNonexistObj: Boolean;
See Also

BreakOnError

What do you think about this topic? Send feedback!


TADScriptOptions.EchoCommands Property

TADScriptOptions.EchoCommands Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies what parts of a SQL script must be echoed to console.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set EchoCommands to one of the values, to enable SQL script commands echo output to a script console:

Value | Description
ecNone | No commands will be output.
ecSQL | Only SQL and PL/SQL commands will be output.
ecAll | SQL, PL/SQL and the script control commands will be output.

The default value is ecSQL. The output to the console is performed only when ConsoleOutput is True. When a command text is greater than EchoCommandTrim, then the command text will be trimmed to the specified by EchoCommandTrim length.

The property may be set from a script using SET ECHO OFF | ON [SQL|ALL] [TRIM <size>] command.

Syntax
property EchoCommands: TADScriptEchoCommands;
See Also

ConsoleOutput, EchoCommandTrim, TrimConsole

What do you think about this topic? Send feedback!


TADScriptOptions.EchoCommandTrim Property

TADScriptOptions.EchoCommandTrim Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the command echo output trimming.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set EchoCommandTrim to an integer value, which is the maximum command text length to output. When the text is greater than the specified value, then the text will be trimmed and '...' appended. When the value is <= 0, then no trimming is performed. The default value is 0. The EchoCommandTrim is used together with EchoCommands.

The property may be set from a script using SET ECHO OFF | ON [SQL|ALL] [TRIM <size>] command.

Syntax
property EchoCommandTrim: Integer;
See Also

ConsoleOutput, EchoCommands, TrimConsole

What do you think about this topic? Send feedback!


TADScriptOptions.FeedbackCommands Property

TADScriptOptions.FeedbackCommands Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the feedback output after each SQL command execution.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set FeedbackCommands to True, to enable the feedback output after each SQL command execution. The feedback may include:

  • the number of rows fetched for the commands returning a result set;
  • the number of rows updated by the INSERT/ UPDATE / DELETE SQL commands;
  • the command execution time, when Timing is True;
  • DB properties after connecting to a DB using CONNECT command;
  • the number of processed rows by the COPY command.

The default value is True.

The property may be set from a script using SET (FEEDback | COUNT) (OFF | ON) command.

Syntax
property FeedbackCommands: Boolean;
See Also

ConsoleOutput, FeedbackScript, Timing

What do you think about this topic? Send feedback!


TADScriptOptions.FeedbackScript Property

TADScriptOptions.FeedbackScript Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the feedback output after each SQL script execution.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set FeedbackScript to True, to enable the feedback output after each SQL script execution. The feedback may include:

  • the script name to execute;
  • the number of errors returned, while the script was processing;
  • the script execution time, when Timing is True.

The default value is True.

Syntax
property FeedbackScript: Boolean;
See Also

ConsoleOutput, FeedbackCommands, Timing

What do you think about this topic? Send feedback!


TADScriptOptions.FileEncoding Property

TADScriptOptions.FileEncoding Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies the SQL script file encoding.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set FileEncoding property value to the encoding of the SQL script file. Default value is enANSI.

The property may be set from a script using SET ENCoding (UTF8 | UTF16 | ANSI) command.

Syntax
property FileEncoding: TADEncoding;
See Also

FileEndOfLine

What do you think about this topic? Send feedback!


TADScriptOptions.FileEndOfLine Property

TADScriptOptions.FileEndOfLine Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies the SQL script file end-of-line character sequence.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set FileEndOfLine property value to the end-of-line character sequence kind. The default value is elDefault.

Syntax
property FileEndOfLine: TADTextEndOfLine;
See Also

FileEncoding

What do you think about this topic? Send feedback!


TADScriptOptions.IgnoreError Property

TADScriptOptions.IgnoreError Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the script engine action on the errors.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set IgnoreError to True, to stop the error message output to the console. When it is False the exception error message will be output to the console. And when BreakOnError is True, then the script execution will be terminated after the exception. Default value is False.

The property may be set from a script using SET IGNORE (OFF | ON) command.

Syntax
property IgnoreError: Boolean;
See Also

BreakOnError

What do you think about this topic? Send feedback!


TADScriptOptions.LineSize Property

TADScriptOptions.LineSize Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published Send Feedback

Specifies the maximum line width.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published
Description

Set LineSize to the maximum number of characters per console line. When script engine will output more long line, then it will be splitted into few lines, each of LineSize characters long. The default value is 0 (do not split).

The property may be set from a script using SET LINEsize <value> command.

Syntax
property LineSize: Integer;
What do you think about this topic? Send feedback!


TADScriptOptions.MacroExpand Property

TADScriptOptions.MacroExpand Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls macro substitution for script engine.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set MacroExpand to True to enable macro expansion for the script engine.

The macro substitution variables has the form &name or !name. They may appear in practically all script places, including script names. The macro variables and their values are listed in TADScript.Macros property and may be set from script using DEFINE name=value command.

Also, the script arguments may be referenced using &index or !index form. There the index is a value index from TADScript.Arguments.

The default value is True.

The property may be set from a script using SET (DEFine | SCAN) (ON | OFF) command.

Syntax
property MacroExpand: Boolean;
See Also

TADScript.Macros, TADScript.Arguments

What do you think about this topic? Send feedback!


TADScriptOptions.MaxStringWidth Property

TADScriptOptions.MaxStringWidth Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies the maximum string field value size.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set MaxStringWidth to the maximum number of characters per string field value. When script engine will output more long field value, then it will be trimmed to MaxStringWidth characters. The default value is 80 characters.

The property may be set from a script using SET (LONG | WIDTH) <value> command.

Syntax
property MaxStringWidth: Integer;
See Also

LineSize

What do you think about this topic? Send feedback!


TADScriptOptions.PageSize Property

TADScriptOptions.PageSize Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies the rowset page size.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set PageSize to the number of rows, before which script engine will put the column headings, when ColumnHeadings is True. The default value is 24.

The property may be set from a script using SET PAGESize <value> command.

Syntax
property PageSize: Integer;
See Also

ColumnHeadings, ConsoleOutput, SpoolOutput

What do you think about this topic? Send feedback!


TADScriptOptions.ParamArraySize Property

TADScriptOptions.ParamArraySize Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies the Array DML size.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set the ParamArraySize to the Array DML size.

Syntax
property ParamArraySize: Integer;
See Also

TADScript.Params

What do you think about this topic? Send feedback!


TADScriptOptions.RaisePLSQLErrors Property

TADScriptOptions.RaisePLSQLErrors Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls raising of exceptions after the PL/SQL compilation errors.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set RaisePLSQLErrors to True to raise an exception after PL/SQL compilation, if there were any errors. That will allow to stop the script execution, if some PL/SQL related command, like a CREATE PROCEDURE or LATER PACKAGE finished with the errors.

The default value is False.

Syntax
property RaisePLSQLErrors: Boolean;
See Also

BreakOnError, IgnoreError

What do you think about this topic? Send feedback!


TADScriptOptions.SpoolFileName Property

TADScriptOptions.SpoolFileName Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Specifies the spool file name.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set the SpoolFileName property value to the name of a file, where the spooling output must be recorded. The spooling output duplicates output to the console. The output to the spool file will be performed only when SpoolFileName is specified and SpoolOutput is no smNone.

The property may be set from a script using (SPOol | OUTput) [OFF|[APPend] <spool name>] command.

Syntax
property SpoolFileName: String;
See Also

SpoolOutput, TrimSpool, TADScript.OnSpoolPut

What do you think about this topic? Send feedback!


TADScriptOptions.SpoolOutput Property

TADScriptOptions.SpoolOutput Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the spooling output mode.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set SpoolOutput to smOnAppend or smOnReset to enable output to the spool file with SpoolFileName name. smOnReset - overwrite the file, amOnAppend - append output to the existing file. Set SpoolOutput to smNone to disable output. The default value is smNone.

The property may be set from a script using (SPOol | OUTput) [OFF|[APPend] <spool name>] command.

Syntax
property SpoolOutput: TADScriptSpoolOutputMode;
See Also

SpoolFileName, TrimSpool, TADScript.OnSpoolPut

What do you think about this topic? Send feedback!


TADScriptOptions.SQLDialect Property

TADScriptOptions.SQLDialect Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published Send Feedback

Specifies the SQL dialect for new Firebird or Interbase connections.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published
Description

Set SQLDialect property value to the Firebird / Interbase SQL dialect, which will be used at new connections opened with CONNECT script command or with CREATE DATABASE command.

The property may be set from a script using SET SQL DIALECT value command.

Syntax
property SQLDialect: Integer;
What do you think about this topic? Send feedback!


TADScriptOptions.Timing Property

TADScriptOptions.Timing Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the command performance feedback.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set Timing to True to enable performance output after each SQL command and after each script. The output includes the command and script execution times. The Timing has only effect, when FeedbackCommands is True. The default value is True.

The property may be set from a script using SET TIMing OFF|ON command.

Syntax
property Timing: Boolean;
See Also

FeedbackCommands

What do you think about this topic? Send feedback!


TADScriptOptions.TrimConsole Property

TADScriptOptions.TrimConsole Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the right spaces trimming from the console output.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set TrimConsole to True to trim right spaces from the console output text. The default value is False.

The property may be set from a script using SET TRIMout OFF|ON command.

Syntax
property TrimConsole: Boolean;
See Also

ConsoleOutput, TrimSpool

What do you think about this topic? Send feedback!


TADScriptOptions.TrimSpool Property

TADScriptOptions.TrimSpool Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published See Also Send Feedback

Controls the right spaces trimming from the spool output.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published, See Also
Description

Set TrimSpool to True to trim right spaces from the spool output text. The default value is True.

The property may be set from a script using SET TRIMSpool OFF|ON command.

Syntax
property TrimSpool: Boolean;
See Also

SpoolOutput

What do you think about this topic? Send feedback!


TADScriptOptions.Verify Property

TADScriptOptions.Verify Property
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published Send Feedback

Enables to show a complete SQL command text before execution.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published
Description

Set Verify to True to enable output of a SQL command text with substituted macro variables, if any. The default value is False.

The property may be set from a script using SET VERify OFF|ON command.

Syntax
property Verify: Boolean;
What do you think about this topic? Send feedback!


TADScriptOptions.Assign Method

TADScriptOptions.Assign Method
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published Send Feedback

Assigns a TADScriptOptions object to this object.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published
Parameters
Parameters | Description
Source: TPersistent | The source object.
Description

Use the Assign method to assign TADScriptOptions object property values to corresponding properties of this object.

Syntax
procedure Assign(Source: TPersistent); override;
What do you think about this topic? Send feedback!


TADScriptOptions.Reset Method

TADScriptOptions.Reset Method
TADScriptOptions Class TADScriptOptions Members uADCompScript Namespace published Send Feedback

Reset this object property values to their default state.

Group

published

Links
TADScriptOptions Class, TADScriptOptions Members, uADCompScript Namespace, published
Description

Call Reset method to reset all properties of this objects to their default values.

Syntax
procedure Reset;
What do you think about this topic? Send feedback!


TADSQLScript Class

TADSQLScript Class
published TADSQLScript Members Classes See Also Send Feedback

An in-memory stored SQL script.

Group

Classes

Class Hierarchy
  uADCompScript_TADSQLScript
File

uADCompScript

Links
published, TADSQLScript Members, Classes, See Also
Description

The TADSQLScript class represents a SQL script, stored in program memory. Each script is identified by its name by the Name property and contains script commands in its SQL property.

Syntax
TADSQLScript = class(TCollectionItem);
See Also

Executing SQL Scripts

What do you think about this topic? Send feedback!


TADSQLScript Members

TADSQLScript Members
TADSQLScript Class Legend Properties Send Feedback

The following tables list the members exposed by TADSQLScript.

Class

TADSQLScript Class

Properties
Property | Description
Name | The name of a script.
SQL | The SQL script.
Links
TADSQLScript Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADSQLScript Class Legend Properties Send Feedback

The published members of the TADSQLScript class are listed here.

Class

TADSQLScript Class

Properties
Property | Description
Name | The name of a script.
SQL | The SQL script.
Links
TADSQLScript Class, Legend, Properties
What do you think about this topic? Send feedback!


TADSQLScript.Name Property

TADSQLScript.Name Property
TADSQLScript Class TADSQLScript Members uADCompScript Namespace published See Also Send Feedback

The name of a script.

Group

published

Links
TADSQLScript Class, TADSQLScript Members, uADCompScript Namespace, published, See Also
Description

Set Name property to a name of a SQL script. Engine will use this name to find a script, when it is launched by @<name> or similar command.

Syntax
property Name: String;
See Also

SQL, TADSQLScripts.FindScript

What do you think about this topic? Send feedback!


TADSQLScript.SQL Property

TADSQLScript.SQL Property
TADSQLScript Class TADSQLScript Members uADCompScript Namespace published See Also Send Feedback

The SQL script.

Group

published

Links
TADSQLScript Class, TADSQLScript Members, uADCompScript Namespace, published, See Also
Description

Use SQL property to store the list of SQL and script control commands. The commands may span few lines and must be separated by the command separator.

Syntax
property SQL: TStrings;
See Also

Name, TADScriptOptions.CommandSeparator

What do you think about this topic? Send feedback!


TADSQLScripts Class

TADSQLScripts Class
public TADSQLScripts Members Classes See Also Send Feedback

TADSQLScripts is a collection of the TADSQLScript objects.

Group

Classes

Class Hierarchy
  uADCompScript_TADSQLScripts
File

uADCompScript

Links
public, TADSQLScripts Members, Classes, See Also
Description

The TADSQLScripts class is a collection of the TADSQLScript objects. All scripts in a collection must have unique names. Use:

  • Add method to add new script object.
  • FindScript to find a script by its name.
Syntax
TADSQLScripts = class(TOwnedCollection);
See Also

Executing SQL Scripts, TADScript.SQLScripts

What do you think about this topic? Send feedback!


TADSQLScripts Members

TADSQLScripts Members
TADSQLScripts Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADSQLScripts.

Class

TADSQLScripts Class

Methods
Method | Description
Add | Add new SQL script object to a collection.
FindScript | Returns a SQL script by its name.
Properties
Property | Description
Items | Returns SQL script object by its index.
Links
TADSQLScripts Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADSQLScripts Class Legend Methods Properties Send Feedback

The public members of the TADSQLScripts class are listed here.

Class

TADSQLScripts Class

Methods
Method | Description
Add | Add new SQL script object to a collection.
FindScript | Returns a SQL script by its name.
Properties
Property | Description
Items | Returns SQL script object by its index.
Links
TADSQLScripts Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADSQLScripts.Items Property

TADSQLScripts.Items Property
TADSQLScripts Class TADSQLScripts Members uADCompScript Namespace public See Also Send Feedback

Returns SQL script object by its index.

Group

public

Links
TADSQLScripts Class, TADSQLScripts Members, uADCompScript Namespace, public, See Also
Description

Use Items property to get access by an index to the SQL script objects.

Syntax
property Items [AIndex: Integer]: TADSQLScript;
See Also

FindScript

What do you think about this topic? Send feedback!


TADSQLScripts.Add Method

TADSQLScripts.Add Method
TADSQLScripts Class TADSQLScripts Members uADCompScript Namespace public Send Feedback

Add new SQL script object to a collection.

Group

public

Links
TADSQLScripts Class, TADSQLScripts Members, uADCompScript Namespace, public
Description

Call the Add method to add new empty SQL script object to this collection.

Syntax
function Add: TADSQLScript;
What do you think about this topic? Send feedback!


TADSQLScripts.FindScript Method

TADSQLScripts.FindScript Method
TADSQLScripts Class TADSQLScripts Members uADCompScript Namespace public Send Feedback

Returns a SQL script by its name.

Group

public

Links
TADSQLScripts Class, TADSQLScripts Members, uADCompScript Namespace, public
Parameters
Parameters | Description
const AName: String | A name.
Description

Use the FindScript method to find a SQL script by its name.

Syntax
function FindScript(const AName: String): TADSQLScript;
What do you think about this topic? Send feedback!


uADMoniRemoteClient Namespace

uADMoniRemoteClient Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains TADMoniRemoteClientLink class.

Classes
Class | Description
TADMoniRemoteClientLink | Use the TADMoniRemoteClientLink component to link ADMonitor tracing capabilities to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADMoniRemoteClient unit contains:

  • TADMoniRemoteClientLink class - component implementing and controlling the trace output to ADMonitor utility.
See Also

Tracing and Monitoring

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADMoniRemoteClient Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADMoniRemoteClientLink | Use the TADMoniRemoteClientLink component to link ADMonitor tracing capabilities to an application and setup it.
Namespace

uADMoniRemoteClient Namespace

Links
Classes, uADMoniRemoteClient Namespace, Legend
What do you think about this topic? Send feedback!


TADMoniRemoteClientLink Class

TADMoniRemoteClientLink Class
published TADMoniRemoteClientLink Members Classes See Also Send Feedback

Use the TADMoniRemoteClientLink component to link ADMonitor tracing capabilities to an application and setup it.

Group

Classes

Class Hierarchy
  uADMoniRemoteClient_TADMoniRemoteClientLink
File

uADMoniRemoteClient

Links
published, TADMoniRemoteClientLink Members, Classes, See Also
Description

Use the TADMoniRemoteClientLink component to link the ADMonitor tracing capabilities to an application.

To enable ADMonitor trace output, add MonitorBy=Remote parameter to your connection definition. And set Tracing property to True.

ADMonitor and TADMoniRemoteClientLink are using TPC/IP protocol to communicate. Use the Host property to specify the ADMonitor host IP address, and Port to specify the IP port where ADMonitor is listening. EventKinds property specifies the information set to send to ADMonitor.

Syntax
TADMoniRemoteClientLink = class(TADMoniClientLinkBase);
See Also

Tracing and Monitoring

What do you think about this topic? Send feedback!


TADMoniRemoteClientLink Members

TADMoniRemoteClientLink Members
TADMoniRemoteClientLink Class Legend Properties Send Feedback

The following tables list the members exposed by TADMoniRemoteClientLink.

Class

TADMoniRemoteClientLink Class

Properties
Property | Description
Host | The IP host address, where ADMonitor is running.
Port | The IP port, where ADMonitor is listening.
Timeout | ADMonitor connection timeout.
Tracing | Add a short summary here...
Links
TADMoniRemoteClientLink Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADMoniRemoteClientLink Class Legend Properties Send Feedback

The published members of the TADMoniRemoteClientLink class are listed here.

Class

TADMoniRemoteClientLink Class

Properties
Property | Description
Host | The IP host address, where ADMonitor is running.
Port | The IP port, where ADMonitor is listening.
Timeout | ADMonitor connection timeout.
Tracing | Add a short summary here...
Links
TADMoniRemoteClientLink Class, Legend, Properties
What do you think about this topic? Send feedback!


TADMoniRemoteClientLink.Host Property

TADMoniRemoteClientLink.Host Property
TADMoniRemoteClientLink Class TADMoniRemoteClientLink Members uADMoniRemoteClient Namespace published See Also Send Feedback

The IP host address, where ADMonitor is running.

Group

published

Links
TADMoniRemoteClientLink Class, TADMoniRemoteClientLink Members, uADMoniRemoteClient Namespace, published, See Also
Description

Use the Host property to specify the IP address of the host where ADMonitor utility is running. Default value is localhost.

Syntax
property Host: String;
See Also

Port

What do you think about this topic? Send feedback!


TADMoniRemoteClientLink.Port Property

TADMoniRemoteClientLink.Port Property
TADMoniRemoteClientLink Class TADMoniRemoteClientLink Members uADMoniRemoteClient Namespace published See Also Send Feedback

The IP port, where ADMonitor is listening.

Group

published

Links
TADMoniRemoteClientLink Class, TADMoniRemoteClientLink Members, uADMoniRemoteClient Namespace, published, See Also
Description

Use the Port property to specify the IP port where ADMonitor utility is listening. Default value is 8050.

Syntax
property Port: Integer;
See Also

Host

What do you think about this topic? Send feedback!


TADMoniRemoteClientLink.Timeout Property

TADMoniRemoteClientLink.Timeout Property
TADMoniRemoteClientLink Class TADMoniRemoteClientLink Members uADMoniRemoteClient Namespace published Send Feedback

ADMonitor connection timeout.

Group

published

Links
TADMoniRemoteClientLink Class, TADMoniRemoteClientLink Members, uADMoniRemoteClient Namespace, published
Description

Use Timeout property to specify the connection establishment timeout in msecs. Default value is 3000 (3 secs).

Syntax
property Timeout: Integer;
What do you think about this topic? Send feedback!


TADMoniRemoteClientLink.Tracing Property

TADMoniRemoteClientLink.Tracing Property
TADMoniRemoteClientLink Class TADMoniRemoteClientLink Members uADMoniRemoteClient Namespace Example published See Also Send Feedback

Add a short summary here...

Group

published

Links
TADMoniRemoteClientLink Class, TADMoniRemoteClientLink Members, uADMoniRemoteClient Namespace, Example, published, See Also
Description

Add a description here...

Syntax
property Tracing;
See Also

List here...

Example
What do you think about this topic? Send feedback!


uADPhysADS Namespace

uADPhysADS Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains Advantage Database Server driver and service components.

Classes
Class | Description
TADADSBackup | The class implementing Advantage backup database service.
TADADSBackupRestore | The base class for backup and restored Advantage service classes.
TADADSRestore | The class implementing Advantage service restoring a database from a backup.
TADADSService | The base class for all Advantage service classes.
TADADSUtility | The class implementing Advantage table utilities.
TADPhysADSDriverLink | Use the TADPhysADSDriverLink component to link the Advantage Database Server driver to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysADS unit contains:

  • Advantage Database Server driver implementation;
  • TADPhysADSDriverLink - component to link the driver and setup CLI library;
  • TADADSBackup - backup DB service component;
  • TADADSRestore - restore DB service component.
See Also

Configuring Drivers, Connect to Advantage Database Server

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysADS Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADADSBackup | The class implementing Advantage backup database service.
TADADSBackupRestore | The base class for backup and restored Advantage service classes.
TADADSRestore | The class implementing Advantage service restoring a database from a backup.
TADADSService | The base class for all Advantage service classes.
TADADSUtility | The class implementing Advantage table utilities.
TADPhysADSDriverLink | Use the TADPhysADSDriverLink component to link the Advantage Database Server driver to an application and setup it.
Namespace

uADPhysADS Namespace

Links
Classes, uADPhysADS Namespace, Legend
What do you think about this topic? Send feedback!


TADADSBackup Class

TADADSBackup Class
public published TADADSBackup Members Example Classes See Also Send Feedback

The class implementing Advantage backup database service.

Group

Classes

Class Hierarchy
  uADPhysADS_TADADSBackupuADPhysADS_TADADSBackupuADPhysADS_TADADSBackupuADPhysADS_TADADSBackup
File

uADPhysADS

Links
public, published, TADADSBackup Members, Example, Classes, See Also
Description

Use the TADADSBackup component to add a backup Advantage database capability to an application. This is a programmatic method to invoke the adsbackup tool.

To produce a DB backup an application should:

  • specify DriverLink, UserName, Password, Database;
  • specify BackupPath - the path to put the backup files;
  • call Backup method.

Other properties and methods are optional.

Paths of backup files are relative to the server. Because the TADADSBackup executes backup on the DB server host and writes backup files on the server host. You must be logged in as the ADSSYS user or a user in the DB:Backup group. Note, the TADADSBackup works only with Advantage network server and not with local server.

To restore an backup performed by TADADSBackup use the TADADSRestore component.

Syntax
TADADSBackup = class(TADADSBackupRestore);
See Also

TADADSRestore

Example
ADADSBackup1.DriverLink := ADPhysADSDriverLink1;

ADADSBackup1.Database := '\\DA\ADS_DB\addemo.add';
ADADSBackup1.UserName := 'adssys';
ADADSBackup1.Password := 'a';
ADADSBackup1.BackupPath := 'C:\Temp';

ADADSBackup1.Backup;

ADMemTable1.AttachTable(ADADSBackup1.Results, nil);
ADMemTable1.Open;
What do you think about this topic? Send feedback!


TADADSBackup Members

TADADSBackup Members
Events TADADSBackup Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADADSBackup.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADADSBackup Class

Methods
Method | Description
Backup | Performs the backup task.
Properties
Property | Description
BackupPath | Specifies the path to place the backup image in.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Exclude | Specifies the tables to exclude from backup or restore.
Include | Specifies the tables to include into backup or restore.
Options | Specifies the backup options.
Password | Specifies the SQL user password to connect to the DB server.
Results | The reference to the backup / restore errors list.
TableTypeMap | Specifies the table type to file extension mapping.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADADSBackup Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADADSBackup Class Legend Methods Send Feedback

The public members of the TADADSBackup class are listed here.

Class

TADADSBackup Class

Methods
Method | Description
Backup | Performs the backup task.
Links
TADADSBackup Class, Legend, Methods
What do you think about this topic? Send feedback!


TADADSBackup.Backup Method

TADADSBackup.Backup Method
TADADSBackup Class TADADSBackup Members uADPhysADS Namespace public See Also Send Feedback

Performs the backup task.

Group

public

Links
TADADSBackup Class, TADADSBackup Members, uADPhysADS Namespace, public, See Also
Description

Use the Backup method to start the backup task on the Advantage server.

To perform a backup task an application must specify the connection parameters and BackupPath. This is a programmatic method to invoke the adsbackup tool or the sp_BackupDatabase stored procedure.

Syntax
procedure Backup;
See Also

TADADSService.Database, TADADSService.UserName, TADADSService.Password, BackupPath, Options

What do you think about this topic? Send feedback!


published

published
TADADSBackup Class Legend Properties Send Feedback

The published members of the TADADSBackup class are listed here.

Class

TADADSBackup Class

Properties
Property | Description
BackupPath | Specifies the path to place the backup image in.
Options | Specifies the backup options.
Links
TADADSBackup Class, Legend, Properties
What do you think about this topic? Send feedback!


TADADSBackup.BackupPath Property

TADADSBackup.BackupPath Property
TADADSBackup Class TADADSBackup Members uADPhysADS Namespace published See Also Send Feedback

Specifies the path to place the backup image in.

Group

published

Links
TADADSBackup Class, TADADSBackup Members, uADPhysADS Namespace, published, See Also
Description

Path to place the backup image in. This path can be any form recognized by the server operating system. For example, in Microsoft Windows this path can be UNC ( \\myserver\myshare\mydir ) or a local drive letter ( c:\mydir ). If using drive letters keep in mind the drive letter must be recognized by the server machine, any drives mapped on the client executing the backup command are irrelevant. Mapped network drive letters are not supported, and should not be used.

Syntax
property BackupPath: String;
See Also

TADADSService.Database

What do you think about this topic? Send feedback!


TADADSBackup.Options Property

TADADSBackup.Options Property
TADADSBackup Class TADADSBackup Members uADPhysADS Namespace published Send Feedback

Specifies the backup options.

Group

published

Links
TADADSBackup Class, TADADSBackup Members, uADPhysADS Namespace, published
Description

Use the Options property to specify additional options controlling the backup task. The default value is empty set.

Option | Description
boDontOverwrite | Specify if you do not want the backup operation to overwrite existing tables. Instead a warning will be logged to the Results.
boMetaOnly | Specify if you only want to backup the data dictionary file.
boPrepareDiff | Specify if you want to initialize a differential backup.
boDiff | Specify if you want to perform a differential backup on a database that you have previously initialized using the boPrepareDiff.
Syntax
property Options: TADADSBackupOptions;
What do you think about this topic? Send feedback!


TADADSBackupRestore Class

TADADSBackupRestore Class
public published TADADSBackupRestore Members Classes Send Feedback

The base class for backup and restored Advantage service classes.

Group

Classes

Class Hierarchy
  uADPhysADS_TADADSBackupRestoreuADPhysADS_TADADSBackupRestoreuADPhysADS_TADADSBackupRestore
File

uADPhysADS

Links
public, published, TADADSBackupRestore Members, Classes
Description

The TADADSBackupRestoreService class is used as a base class for TADADSBackup and TADADSRestore Advantage classes and should not be used directly. The class contains the common properties, like the Exclude, Include and TableTypeMap.

Syntax
TADADSBackupRestore = class(TADADSService);
What do you think about this topic? Send feedback!


TADADSBackupRestore Members

TADADSBackupRestore Members
Events TADADSBackupRestore Class Legend Properties Send Feedback

The following tables list the members exposed by TADADSBackupRestore.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADADSBackupRestore Class

Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Exclude | Specifies the tables to exclude from backup or restore.
Include | Specifies the tables to include into backup or restore.
Password | Specifies the SQL user password to connect to the DB server.
Results | The reference to the backup / restore errors list.
TableTypeMap | Specifies the table type to file extension mapping.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADADSBackupRestore Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADADSBackupRestore Class Legend Properties Send Feedback

The public members of the TADADSBackupRestore class are listed here.

Class

TADADSBackupRestore Class

Properties
Property | Description
Results | The reference to the backup / restore errors list.
Links
TADADSBackupRestore Class, Legend, Properties
What do you think about this topic? Send feedback!


TADADSBackupRestore.Results Property

TADADSBackupRestore.Results Property
TADADSBackupRestore Class TADADSBackupRestore Members uADPhysADS Namespace Example public See Also Send Feedback

The reference to the backup / restore errors list.

Group

public

Links
TADADSBackupRestore Class, TADADSBackupRestore Members, uADPhysADS Namespace, Example, public, See Also
Description

Use the Results property to read the all last backup / restore operation error list. The property is filled after the call to Backup or Restore methods.

Syntax
property Results: TADDatSTable;
See Also

Backup, Restore

Example
ADADSBackup.Backup;
ADMemTable1.AttachTable(ADADSBackup.Results, nil);
ADMemTable1.Open;
What do you think about this topic? Send feedback!


published

published
TADADSBackupRestore Class Legend Properties Send Feedback

The published members of the TADADSBackupRestore class are listed here.

Class

TADADSBackupRestore Class

Properties
Property | Description
Exclude | Specifies the tables to exclude from backup or restore.
Include | Specifies the tables to include into backup or restore.
TableTypeMap | Specifies the table type to file extension mapping.
Links
TADADSBackupRestore Class, Legend, Properties
What do you think about this topic? Send feedback!


TADADSBackupRestore.Exclude Property

TADADSBackupRestore.Exclude Property
TADADSBackupRestore Class TADADSBackupRestore Members uADPhysADS Namespace published See Also Send Feedback

Specifies the tables to exclude from backup or restore.

Group

published

Links
TADADSBackupRestore Class, TADADSBackupRestore Members, uADPhysADS Namespace, published, See Also
Description

Use the Exclude property to specify a list of tables to exclude from the backup or restore. The tables in this list will not be processed. Each table name must be located on a single line. When backing up or restoring a data dictionary, use the table object names. When backing up or restoring free tables, use the base filename and the file extension.

Syntax
property Exclude: TStrings;
See Also

Include, TableTypeMap

What do you think about this topic? Send feedback!


TADADSBackupRestore.Include Property

TADADSBackupRestore.Include Property
TADADSBackupRestore Class TADADSBackupRestore Members uADPhysADS Namespace published See Also Send Feedback

Specifies the tables to include into backup or restore.

Group

published

Links
TADADSBackupRestore Class, TADADSBackupRestore Members, uADPhysADS Namespace, published, See Also
Description

Use this option to specify a list of tables to include in the backup or restore. Only the tables in this list will be processed. Each table name must be located on a single line. When backing up or restoring a data dictionary, use the table object names. When backing up or restoring free tables, use the base filename and the file extension.

Syntax
property Include: TStrings;
See Also

Exclude, TableTypeMap

What do you think about this topic? Send feedback!


TADADSBackupRestore.TableTypeMap Property

TADADSBackupRestore.TableTypeMap Property
TADADSBackupRestore Class TADADSBackupRestore Members uADPhysADS Namespace Example published See Also Send Feedback

Specifies the table type to file extension mapping.

Group

published

Links
TADADSBackupRestore Class, TADADSBackupRestore Members, uADPhysADS Namespace, Example, published, See Also
Description

Use the TableTypeMap property to specify what table type should be used for a specific table extension. Only necessary for free table backup / restore operations. This option can be used to backup and/or restore a directory of free tables that consists of both ADT and DBF tables. Each mapping must be located on a separated line and should include a three character extension, followed by an equal sign, followed by the Advantage table type constant.

Syntax
property TableTypeMap: TStrings;
See Also

Exclude, Include

Example
with ADADSBackup1.TableTypeMap do begin
  Clear;
  Add('adt=ADS_ADT');
  Add('dbf=ADS_CDX');
end;
What do you think about this topic? Send feedback!


TADADSRestore Class

TADADSRestore Class
public published TADADSRestore Members Example Classes See Also Send Feedback

The class implementing Advantage service restoring a database from a backup.

Group

Classes

Class Hierarchy
  uADPhysADS_TADADSRestoreuADPhysADS_TADADSRestoreuADPhysADS_TADADSRestoreuADPhysADS_TADADSRestore
File

uADPhysADS

Links
public, published, TADADSRestore Members, Example, Classes, See Also
Description

Use the TADADSRestore component to add a restoring database from backup capability to an application. This is a programmatic method to invoke the adsbackup tool.

To restore a database from a DB backup an application should:

  • specify DriverLink, UserName, Password, Database;
  • specify SourcePath - the path to the backup files;
  • specify DestinationPath - the path to restore a database;
  • call Restore method.

Other properties and methods are optional.

SourcePath is relative to the server. Because the TADADSRestore restores backup on the DB server host. The restoration can be performed using a free connection or a dictionary connection. You must be logged in as the ADSSYS user or a user in the DB:Backup group.

Syntax
TADADSRestore = class(TADADSBackupRestore);
See Also

TADADSBackup

Example
ADADSRestore1.DriverLink := ADPhysADSDriverLink1;

ADADSRestore1.Database := '\\DA\ADS_DB\addemo.add';
ADADSRestore1.UserName := 'adssys';
ADADSRestore1.Password := 'a';
ADADSRestore1.SourcePath := 'C:\Temp';
ADADSRestore1.DestinationPath := '\\DA\ADS_DB\addemo.add';

ADADSRestore1.Restore;

ADMemTable1.AttachTable(ADADSRestore1.Results, nil);
ADMemTable1.Open;
What do you think about this topic? Send feedback!


TADADSRestore Members

TADADSRestore Members
Events TADADSRestore Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADADSRestore.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADADSRestore Class

Methods
Method | Description
Restore | Performs the restore task.
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DDPassword | Specify the data dictionary password.
DestinationPath | Path to restore the database to.
DriverLink | Specifies the DriverLink.
Exclude | Specifies the tables to exclude from backup or restore.
Include | Specifies the tables to include into backup or restore.
Options | Specifies the restore options.
Password | Specifies the SQL user password to connect to the DB server.
Results | The reference to the backup / restore errors list.
SourcePassword | Source dictionary password.
SourcePath | Path to the existing backup image.
TableTypeMap | Specifies the table type to file extension mapping.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADADSRestore Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADADSRestore Class Legend Methods Send Feedback

The public members of the TADADSRestore class are listed here.

Class

TADADSRestore Class

Methods
Method | Description
Restore | Performs the restore task.
Links
TADADSRestore Class, Legend, Methods
What do you think about this topic? Send feedback!


TADADSRestore.Restore Method

TADADSRestore.Restore Method
TADADSRestore Class TADADSRestore Members uADPhysADS Namespace public See Also Send Feedback

Performs the restore task.

Group

public

Links
TADADSRestore Class, TADADSRestore Members, uADPhysADS Namespace, public, See Also
Description

Use the Restore method to start the restore task on the Advantage server.

To perform a restore task an application must specify the connection parameters, SourcePath and DestinationPath. This is a programmatic method to invoke the adsbackup tool or the sp_RestoreDatabase stored procedure.

Syntax
procedure Restore;
See Also

TADADSService.Database, TADADSService.UserName, TADADSService.Password, SourcePath, DestinationPath, Options

What do you think about this topic? Send feedback!


published

published
TADADSRestore Class Legend Properties Send Feedback

The published members of the TADADSRestore class are listed here.

Class

TADADSRestore Class

Properties
Property | Description
DDPassword | Specify the data dictionary password.
DestinationPath | Path to restore the database to.
Options | Specifies the restore options.
SourcePassword | Source dictionary password.
SourcePath | Path to the existing backup image.
Links
TADADSRestore Class, Legend, Properties
What do you think about this topic? Send feedback!


TADADSRestore.DDPassword Property

TADADSRestore.DDPassword Property
TADADSRestore Class TADADSRestore Members uADPhysADS Namespace published Send Feedback

Specify the data dictionary password.

Group

published

Links
TADADSRestore Class, TADADSRestore Members, uADPhysADS Namespace, published
Description

Use the DDPassword property to specify the data dictionary password to use on a restore operation for a dictionary that uses AES encryption.

Syntax
property DDPassword: String;
What do you think about this topic? Send feedback!


TADADSRestore.DestinationPath Property

TADADSRestore.DestinationPath Property
TADADSRestore Class TADADSRestore Members uADPhysADS Namespace published See Also Send Feedback

Path to restore the database to.

Group

published

Links
TADADSRestore Class, TADADSRestore Members, uADPhysADS Namespace, published, See Also
Description

Use the DestinationPath to specify path to restore the database to, including the name of the new .add file to create. An example DestinationPath would be \\myserver\myshare\myrestoredir\mydd.add. This path can be any form recognized by the server operating system. For example, in Microsoft Windows this path can be UNC ( \\myserver\myshare\mydir ) or a local drive letter ( c:\mydir ). If using drive letters keep in mind the drive letter must be recognized by the server machine, any drives mapped on the client executing the restore command are irrelevant. Mapped network drive letters are not supported, and should not be used.

Syntax
property DestinationPath: String;
See Also

SourcePath

What do you think about this topic? Send feedback!


TADADSRestore.Options Property

TADADSRestore.Options Property
TADADSRestore Class TADADSRestore Members uADPhysADS Namespace published Send Feedback

Specifies the restore options.

Group

published

Links
TADADSRestore Class, TADADSRestore Members, uADPhysADS Namespace, published
Description

Use the Options property to specify additional options controlling the restore task. The default value is empty set.

Option | Description
roDontOverwrite | Specify if you do not want the restore operation to overwrite existing tables. Instead a warning will be logged to the Results.
roMetaOnly | Specify if you only want to restore the data dictionary file.
Syntax
property Options: TADADSRestoreOptions;
What do you think about this topic? Send feedback!


TADADSRestore.SourcePassword Property

TADADSRestore.SourcePassword Property
TADADSRestore Class TADADSRestore Members uADPhysADS Namespace published See Also Send Feedback

Source dictionary password.

Group

published

Links
TADADSRestore Class, TADADSRestore Members, uADPhysADS Namespace, published, See Also
Description

Use the SourcePassword to specify a password to the dictionary specified in the SourcePath parameter.

Syntax
property SourcePassword: String;
See Also

SourcePath

What do you think about this topic? Send feedback!


TADADSRestore.SourcePath Property

TADADSRestore.SourcePath Property
TADADSRestore Class TADADSRestore Members uADPhysADS Namespace published See Also Send Feedback

Path to the existing backup image.

Group

published

Links
TADADSRestore Class, TADADSRestore Members, uADPhysADS Namespace, published, See Also
Description

Use the SourcePath to specify path to the existing backup image, including the name of the .add file. An example SourcePath would be \\myserver\myshare\mybackupdir\mydd.add. This path can be any form recognized by the server operating system. For example, in Microsoft Windows this path can be UNC ( \\myserver\myshare\mydir ) or a local drive letter ( c:\mydir ). If using drive letters, keep in mind the drive letter must be recognized by the server machine, any drives mapped on the client executing the restore command are irrelevant. If using a drive letter for the source path, the drive must be a "local" drive, it cannot be a mapped drive.

Syntax
property SourcePath: String;
See Also

SourcePassword, DestinationPath

What do you think about this topic? Send feedback!


TADADSService Class

TADADSService Class
published TADADSService Members Classes Send Feedback

The base class for all Advantage service classes.

Group

Classes

Class Hierarchy
  uADPhysADS_TADADSServiceuADPhysADS_TADADSService
File

uADPhysADS

Links
published, TADADSService Members, Classes
Description

The TADADSService class is used as a base class for all Advantage service classes and should not be used directly. The class contains the common properties, like the DriverLink, Database, UserName and Password.

Syntax
TADADSService = class(TADPhysDriverService);
What do you think about this topic? Send feedback!


TADADSService Members

TADADSService Members
Events TADADSService Class Legend Properties Send Feedback

The following tables list the members exposed by TADADSService.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADADSService Class

Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Password | Specifies the SQL user password to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADADSService Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADADSService Class Legend Properties Send Feedback

The published members of the TADADSService class are listed here.

Class

TADADSService Class

Properties
Property | Description
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Password | Specifies the SQL user password to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Links
TADADSService Class, Legend, Properties
What do you think about this topic? Send feedback!


TADADSService.Database Property

TADADSService.Database Property
TADADSService Class TADADSService Members uADPhysADS Namespace Example published See Also Send Feedback

Specifies the connection path to the Advantage database.

Group

published

Links
TADADSService Class, TADADSService Members, uADPhysADS Namespace, Example, published, See Also
Description

Use the Database property to specify the connection path to the database. This property must be specified for any service operation.

The fully qualified path to the computer where the data files exist and the default location of the data files. This fully qualified path must contain a drive letter or use UNC. If a free connection is desired, the directory location must be specified. For a database connection, the path and data dictionary file must be specified.

Additionally may be specified other Advantage connection definition parameters, separated by ';'. For example, 'C:\DB;ServerTypes=Local'.

Syntax
property Database: String;
See Also

Connect to Advantage Database Server

Example
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';
What do you think about this topic? Send feedback!


TADADSService.DriverLink Property

TADADSService.DriverLink Property
TADADSService Class TADADSService Members uADPhysADS Namespace published Send Feedback

Specifies the DriverLink.

Group

published

Links
TADADSService Class, TADADSService Members, uADPhysADS Namespace, published
Description

Use the DriverLink property to specify the Advantage driver link. This property must be specified for any service operation.

Syntax
property DriverLink: TADPhysADSDriverLink;
What do you think about this topic? Send feedback!


TADADSService.Password Property

TADADSService.Password Property
TADADSService Class TADADSService Members uADPhysADS Namespace published See Also Send Feedback

Specifies the SQL user password to connect to the DB server.

Group

published

Links
TADADSService Class, TADADSService Members, uADPhysADS Namespace, published, See Also
Description

Use the Password property to specify the user password to connect to the Advantage database. This property must be specified for any service operation.

Syntax
property Password: String;
See Also

UserName

What do you think about this topic? Send feedback!


TADADSService.UserName Property

TADADSService.UserName Property
TADADSService Class TADADSService Members uADPhysADS Namespace published See Also Send Feedback

Specifies the SQL user name to connect to the DB server.

Group

published

Links
TADADSService Class, TADADSService Members, uADPhysADS Namespace, published, See Also
Description

Use the UserName property to specify the SQL user name to connect to the Advantage database. This property must be specified for any service operation.

Syntax
property UserName: String;
See Also

Password

What do you think about this topic? Send feedback!


TADADSUtility Class

TADADSUtility Class
public published TADADSUtility Members Example Classes Send Feedback

The class implementing Advantage table utilities.

Group

Classes

Class Hierarchy
  uADPhysADS_TADADSUtilityuADPhysADS_TADADSUtilityuADPhysADS_TADADSUtility
File

uADPhysADS

Links
public, published, TADADSUtility Members, Example, Classes
Description

Use the TADADSUtility component to add the database table utilities to an application, like zap, pack or reindex a table.

To use an utility an application should:

  • specify DriverLink, UserName, Password, Database;
  • specify Tables - the list of table names;
  • specify TableType - the table type for free connection;
  • specify TablePassword - the encrypted tables password for free connection;
  • call Pack, Zap or other method.
Syntax
TADADSUtility = class(TADADSService);
Example
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';
ADADSUtility1.Tables.Add('EVENT.DBF');
ADADSUtility1.TableType := ttVFP;
ADADSUtility1.Pack;
What do you think about this topic? Send feedback!


TADADSUtility Members

TADADSUtility Members
Events TADADSUtility Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADADSUtility.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Fires after a table is processed.
Class

TADADSUtility Class

Methods
Method | Description
Decrypt | Decrypts encrypted table and removes the password.
Encrypt | Encrypts a table and assigns a password.
Pack | Packs a table.
Recall | Recalls all deleted records in a table.
Reindex | Rebuilds all open indexes associated with the given table.
Zap | Removes all records from the table and re-indexes it.
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Password | Specifies the SQL user password to connect to the DB server.
TablePassword | Specifies encryption password for free tables.
Tables | The list of tables to process.
TableType | Specifies a table type.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADADSUtility Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADADSUtility Class Legend Methods Send Feedback

The public members of the TADADSUtility class are listed here.

Class

TADADSUtility Class

Methods
Method | Description
Decrypt | Decrypts encrypted table and removes the password.
Encrypt | Encrypts a table and assigns a password.
Pack | Packs a table.
Recall | Recalls all deleted records in a table.
Reindex | Rebuilds all open indexes associated with the given table.
Zap | Removes all records from the table and re-indexes it.
Links
TADADSUtility Class, Legend, Methods
What do you think about this topic? Send feedback!


TADADSUtility.Decrypt Method

TADADSUtility.Decrypt Method
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace Example public See Also Send Feedback

Decrypts encrypted table and removes the password.

Group

public

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, Example, public, See Also
Description

Use Decrypt method to decrypt all rows of an encrypted table, disable encryption for the table and remove the password. The tables must not be used by any of the processes. The Decrypt method applicable for free connections only.

The Tables property specifies the list of the tables to process. TableType specifies type of the tables. The TablePassword property specifies the table password.

Syntax
procedure Decrypt;
See Also

Tables, TableType, TablePassword, Encrypt

Example
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';
ADADSUtility1.Tables.Add('EVENT.DBF');
ADADSUtility1.TableType := ttVFP;
ADADSUtility1.TablePassword := '12345';
ADADSUtility1.Decrypt;
What do you think about this topic? Send feedback!


TADADSUtility.Encrypt Method

TADADSUtility.Encrypt Method
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace Example public See Also Send Feedback

Encrypts a table and assigns a password.

Group

public

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, Example, public, See Also
Description

Use Encrypt method to encrypt all rows of a table, enable encryption for the table and assign a password. The tables must not be used by any of the processes. The Decrypt method applicable for free connections only.

The Tables property specifies the list of the tables to process. TableType specifies type of the tables. The TablePassword property specifies the table password.

Syntax
procedure Encrypt;
See Also

Tables, TableType, TablePassword, Decrypt

Example
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';
ADADSUtility1.Tables.Add('ORDERS.DBF');
ADADSUtility1.TableType := ttVFP;
ADADSUtility1.TablePassword := '12345';
ADADSUtility1.Encrypt;
What do you think about this topic? Send feedback!


TADADSUtility.Pack Method

TADADSUtility.Pack Method
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace Example public See Also Send Feedback

Packs a table.

Group

public

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, Example, public, See Also
Description

Use Pack method to remove deleted records from a table and re-index the table. The tables must not be used by any of the processes.

The Tables property specifies the list of tables to process. TableType specifies type of the tables. The TablePassword property optionally specifies the table password.

Syntax
procedure Pack;
See Also

Tables, TableType, TablePassword, Recall, Reindex

Example
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';
ADADSUtility1.Tables.Add('ORDERS.DBF');
ADADSUtility1.TableType := ttVFP;
ADADSUtility1.Pack;
What do you think about this topic? Send feedback!


TADADSUtility.Recall Method

TADADSUtility.Recall Method
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace Example public See Also Send Feedback

Recalls all deleted records in a table.

Group

public

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, Example, public, See Also
Description

Use Recall method to recall all deleted records in a table, pack the table and re-index the table. The tables must not be used by any of the processes.

The Tables property specifies the list of tables to process. TableType specifies type of the tables. The TablePassword property optionally specifies the table password.

Syntax
procedure Recall;
See Also

Tables, TableType, TablePassword, Pack, Reindex

Example
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := '\\DA\ADS_DB';
ADADSUtility1.Tables.Add('ORDERS');
ADADSUtility1.Tables.Add('ORDER DETAILS');
ADADSUtility1.Recall;
What do you think about this topic? Send feedback!


TADADSUtility.Reindex Method

TADADSUtility.Reindex Method
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace Example public See Also Send Feedback

Rebuilds all open indexes associated with the given table.

Group

public

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, Example, public, See Also
Description

Use Reindex method to rebuild all open indexes associated with the given table. The tables must not be used by any of the processes.

The Tables property specifies the list of tables to process. TableType specifies type of the tables. The TablePassword property optionally specifies the table password.

Syntax
procedure Reindex;
See Also

Tables, TableType, TablePassword, Pack

Example
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := '\\DA\ADS_DB';
ADADSUtility1.Tables.Add('ORDERS');
ADADSUtility1.Tables.Add('ORDER DETAILS');
ADADSUtility1.Reindex;
What do you think about this topic? Send feedback!


TADADSUtility.Zap Method

TADADSUtility.Zap Method
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace Example public See Also Send Feedback

Removes all records from the table and re-indexes it.

Group

public

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, Example, public, See Also
Description

Use Zap method to remove all records from the table and re-index it. The tables must not be used by any of the processes.

The Tables property specifies the list of tables to process. TableType specifies type of the tables. The TablePassword property optionally specifies the table password.

Syntax
procedure Zap;
See Also

Tables, TableType, TablePassword, Pack

Example
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := '\\DA\ADS_DB';
ADADSUtility1.Tables.Add('ORDERS');
ADADSUtility1.Tables.Add('ORDER DETAILS');
ADADSUtility1.Reindex;
What do you think about this topic? Send feedback!


published

published
Events TADADSUtility Class Legend Properties Send Feedback

The published members of the TADADSUtility class are listed here.

Events
Event | Description
OnProgress | Fires after a table is processed.
Class

TADADSUtility Class

Properties
Property | Description
TablePassword | Specifies encryption password for free tables.
Tables | The list of tables to process.
TableType | Specifies a table type.
Links
Events, TADADSUtility Class, Legend, Properties
What do you think about this topic? Send feedback!


TADADSUtility.OnProgress Event

TADADSUtility.OnProgress Event
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace published See Also Send Feedback

Fires after a table is processed.

Group

published

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, published, See Also
Description

The OnProgress event fires after each table specified in Tables is processed. Use the event handler to provide a feedback to the end users.

Syntax
property OnProgress: TADPhysServiceProgressEvent;
See Also

Tables

What do you think about this topic? Send feedback!


TADADSUtility.TablePassword Property

TADADSUtility.TablePassword Property
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace published See Also Send Feedback

Specifies encryption password for free tables.

Group

published

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, published, See Also
Description

Use the TablePassword property to specify a table password for tables in a free connection.

Syntax
property TablePassword: String;
See Also

Tables

What do you think about this topic? Send feedback!


TADADSUtility.Tables Property

TADADSUtility.Tables Property
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace published See Also Send Feedback

The list of tables to process.

Group

published

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, published, See Also
Description

Use the Tables property to specify a list of tables to process. When list is empty, then FireDAC will process all tables in a connection.

Syntax
property Tables: TStrings;
See Also

TableType

What do you think about this topic? Send feedback!


TADADSUtility.TableType Property

TADADSUtility.TableType Property
TADADSUtility Class TADADSUtility Members uADPhysADS Namespace published See Also Send Feedback

Specifies a table type.

Group

published

Links
TADADSUtility Class, TADADSUtility Members, uADPhysADS Namespace, published, See Also
Description

Use the TableType property to specify a table type for tables specified in Tables property. At first is useful for a free connection.

Syntax
property TableType: TADSTableType;
See Also

Tables

What do you think about this topic? Send feedback!


TADPhysADSDriverLink Class

TADPhysADSDriverLink Class
published TADPhysADSDriverLink Members Example Classes See Also Send Feedback

Use the TADPhysADSDriverLink component to link the Advantage Database Server driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysADS_TADPhysADSDriverLinkuADPhysADS_TADPhysADSDriverLink
File

uADPhysADS

Links
published, TADPhysADSDriverLink Members, Example, Classes, See Also
Description

Use the TADPhysADSDriverLink component to link the Advantage Database Server driver to an application. In general it is enough to only include uADPhysADS unit into your application uses clause.

The TADPhysADSDriverLink component may be used to specify:

  • VendorHome - the Advantage installation root folder;
  • VendorLib - the name and optional path to the ACE32.DLL / ACE64.DLL (Advantage Client Engine) client library.
  • DateFormat, Decimals, Epoch - default Advantage data format settings;
  • DefaultPath, SearchPath - default Advantage table paths;
  • Exact, ShowDeleted - default Advantage operation modes.

All properties have default values appropriate for most case. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysADSDriverLink = class(TADPhysDriverLink);
See Also

Configuring Drivers, Connect to Advantage Database Server

Example
ADPhysADSDriverLink1.VendorLib := 'c:\ads\ace32.dll';
ADPhysADSDriverLink1.DefaultPath := 'c:\temp';
What do you think about this topic? Send feedback!


TADPhysADSDriverLink Members

TADPhysADSDriverLink Members
Events TADPhysADSDriverLink Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADPhysADSDriverLink.

Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.
Class

TADPhysADSDriverLink Class

Methods
Method | Description
Release | Releases the driver resources, allowing to initialize the driver with different parameters.
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DateFormat | Specifies the default driver date format.
Decimals | Specifies the default number of digits after decimal point.
DefaultPath | Specifies the default path for the free tables.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
Epoch | Specifies the default epoch for dates with two year digits.
Exact | Specifies the default string comparison mode.
SearchPath | Specifies the search path for the free tables.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
ShowDeleted | Specifies the deleted records visibility mode.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.
Links
Events, TADPhysADSDriverLink Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
TADPhysADSDriverLink Class Legend Properties Send Feedback

The published members of the TADPhysADSDriverLink class are listed here.

Class

TADPhysADSDriverLink Class

Properties
Property | Description
DateFormat | Specifies the default driver date format.
Decimals | Specifies the default number of digits after decimal point.
DefaultPath | Specifies the default path for the free tables.
Epoch | Specifies the default epoch for dates with two year digits.
Exact | Specifies the default string comparison mode.
SearchPath | Specifies the search path for the free tables.
ShowDeleted | Specifies the deleted records visibility mode.
Links
TADPhysADSDriverLink Class, Legend, Properties
What do you think about this topic? Send feedback!


TADPhysADSDriverLink.DateFormat Property

TADPhysADSDriverLink.DateFormat Property
TADPhysADSDriverLink Class TADPhysADSDriverLink Members uADPhysADS Namespace published See Also Send Feedback

Specifies the default driver date format.

Group

published

Links
TADPhysADSDriverLink Class, TADPhysADSDriverLink Members, uADPhysADS Namespace, published, See Also
Description

Use the DateFormat property to specify the default date format for FireDAC Advantage driver.

The format is used for dates represented as character strings. This allows control of date formatting for applications being used internationally. This setting affects how the Advantage interprets all date strings passed to the Advantage from the calling application. It also defines how the Advantage formats all dates passed back from the Advantage to the calling application. DateFormat can also be used to specify separators in the date format. For example, 'DD/MM/YYYY' and 'DD-MM-YYYY' are both valid date formats. The default value is "MM/DD/YYYY".

Syntax
property DateFormat: AnsiString;
See Also

Epoch, Decimals

What do you think about this topic? Send feedback!


TADPhysADSDriverLink.Decimals Property

TADPhysADSDriverLink.Decimals Property
TADPhysADSDriverLink Class TADPhysADSDriverLink Members uADPhysADS Namespace published See Also Send Feedback

Specifies the default number of digits after decimal point.

Group

published

Links
TADPhysADSDriverLink Class, TADPhysADSDriverLink Members, uADPhysADS Namespace, published, See Also
Description

Use the Decimals property to specify the default number of digits after decimal point for FireDAC Advantage driver.

The property controls the resulting number of decimal places in a division, modulus, or exponentiation operation in an index or filter expression evaluated in the expression engine. The default value is 2.

Syntax
property Decimals: Word;
See Also

DateFormat, Epoch

What do you think about this topic? Send feedback!


TADPhysADSDriverLink.DefaultPath Property

TADPhysADSDriverLink.DefaultPath Property
TADPhysADSDriverLink Class TADPhysADSDriverLink Members uADPhysADS Namespace published See Also Send Feedback

Specifies the default path for the free tables.

Group

published

Links
TADPhysADSDriverLink Class, TADPhysADSDriverLink Members, uADPhysADS Namespace, published, See Also
Description

Use the DefaultPath property to specify the default path for the opening and creating tables for FireDAC Advantage driver. If a path is given, then subsequent CREATE TABLE or Open calls will look first in the given path (if no path is provided with the table name). This setting affects open/creation of indexes in the same manner. DefaultPath does not result in a connection to the server, nor verifies the existence of the server of the given path.

The default path is used for path resolution when opening and creating tables. If an application creates or opens a table, and it does not supply a path with the table name, then the default path is used as the path for opening the table. If the table name has no path, no default path, or no search path (see SearchPath), then the current working directory of the application is used. Only a single path can be used.

The default value is the application current folder.

Syntax
property DefaultPath: AnsiString;
See Also

SearchPath

What do you think about this topic? Send feedback!


TADPhysADSDriverLink.Epoch Property

TADPhysADSDriverLink.Epoch Property
TADPhysADSDriverLink Class TADPhysADSDriverLink Members uADPhysADS Namespace published See Also Send Feedback

Specifies the default epoch for dates with two year digits.

Group

published

Links
TADPhysADSDriverLink Class, TADPhysADSDriverLink Members, uADPhysADS Namespace, published, See Also
Description

Use the Epoch to specify the default epoch for the textual dates with two year digits for FireDAC Advantage driver.

Epoch determines how date strings are interpreted that contain only two year digits. For example, if a date is given as "5/15/98", then the Epoch value will be used to determine the full four digit year. If a date is given as "5/15/1998", then the Epoch setting is not used. The Epoch setting will be interpreted as the 100-year range for the two digit year. For example, if the Epoch value is 1970, a two digit year of "96" will be interpreted as 1996, while a two digit year of "12" will be interpreted as 2012.

The default epoch value is 1900.

Syntax
property Epoch: Word;
See Also

DateFormat, Decimals

What do you think about this topic? Send feedback!


TADPhysADSDriverLink.Exact Property

TADPhysADSDriverLink.Exact Property
TADPhysADSDriverLink Class TADPhysADSDriverLink Members uADPhysADS Namespace published Send Feedback

Specifies the default string comparison mode.

Group

published

Links
TADPhysADSDriverLink Class, TADPhysADSDriverLink Members, uADPhysADS Namespace, published
Description

Use the Exact to specify how string comparisons are performed with the relational operators =, >, <, >=, and <=.

The exact equal, ==, operator is not affected by this setting. In general, if the Exact setting is True, trailing spaces are ignored during the comparison. The Exact setting is not that simple, however. It is somewhat complex and affects the various relational operators differently. See Expression Engine Operators for detailed information on how the Exact setting affects relational operators.

Exact will affect string comparisons for all currently opened tables and all tables opened in the future for all connections. Changing the set exact setting via Exact also affects all string comparisons in index expressions.

The default value is False.

Syntax
property Exact: Boolean;
What do you think about this topic? Send feedback!


TADPhysADSDriverLink.SearchPath Property

TADPhysADSDriverLink.SearchPath Property
TADPhysADSDriverLink Class TADPhysADSDriverLink Members uADPhysADS Namespace published See Also Send Feedback

Specifies the search path for the free tables.

Group

published

Links
TADPhysADSDriverLink Class, TADPhysADSDriverLink Members, uADPhysADS Namespace, published, See Also
Description

Use the SearchPath property to specify the search path for free tables for FireDAC Advantage driver.

If the opening table does not have a fully qualified path, and the table is not found in the default path (see DefaultPath), then each directory in the search path is searched for the table. For CREATE TABLE, the default path is used if supplied, otherwise the first search path will be used. For example, if there is no default path and the search path is "f:\data; g:\data", then CREATE TABLE will create tables in f:\data.

When using a search path, the existence check for the file is done on the client so that it does not have to attempt to open the table on each server in the search path. If there is no search path, then no existence check is made on the client and the table is assumed to exist in the default path.

When using the Advantage Internet Server, the use of a search path can cause the Advantage to connect to each server in the search path because a connection is required before the existence check can be made. For example, if the search path is "\\server1\vol1\data; \\server2\vol1\data", then the Advantage will connect to both server1 and server2 if a table exists on server2 and not on server1. If this is not desired, then an application should avoid using search paths and either use DefaultPath or supply a full path with each open or create request.

Syntax
property SearchPath: AnsiString;
See Also

DefaultPath

What do you think about this topic? Send feedback!


TADPhysADSDriverLink.ShowDeleted Property

TADPhysADSDriverLink.ShowDeleted Property
TADPhysADSDriverLink Class TADPhysADSDriverLink Members uADPhysADS Namespace published Send Feedback

Specifies the deleted records visibility mode.

Group

published

Links
TADPhysADSDriverLink Class, TADPhysADSDriverLink Members, uADPhysADS Namespace, published
Description

Use the ShowDeleted to specify the deleted records visibility mode for FireDAC Advantage driver.

In DBF tables, deleted records still physically exist inside tables so they can be returned to client applications. ShowDeleted controls whether the Advantage filters out records that are marked for deletion in DBF tables. If ShowDeleted is False, then the server will filter the deleted records, and the client will never "see" those records. This call also affects all currently connected servers and all server connections that are made after the call.

ShowDeleted has no effect upon Advantage proprietary ADT tables. Records that are deleted in ADT tables can never be retrieved by a client application.

The default value is True.

Syntax
property ShowDeleted: Boolean;
What do you think about this topic? Send feedback!


uADPhysASA Namespace

uADPhysASA Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains Sybase SQL Anywhere driver and services components.

Classes
Class | Description
TADASABackup | The class implementing SQL Anywhere backup database service.
TADASAService | The base class for all Sybase SQL Anywhere service classes.
TADASAValidate | The class implementing SQL Anywhere database validate service.
TADPhysASADriverLink | Use the TADPhysASADriverLink component to link the Sybase SQL Anywhere driver to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysASA unit contains:

  • Sybase SQL Anywhere driver implementation;
  • TADPhysASADriverLink - component to link the driver and setup CLI library.
  • TADASABackup - backup DB service component;
  • TADASAValidate - DB validation service component.
See Also

Configuring Drivers, Connect to Sybase SQL Anywhere

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysASA Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADASABackup | The class implementing SQL Anywhere backup database service.
TADASAService | The base class for all Sybase SQL Anywhere service classes.
TADASAValidate | The class implementing SQL Anywhere database validate service.
TADPhysASADriverLink | Use the TADPhysASADriverLink component to link the Sybase SQL Anywhere driver to an application and setup it.
Namespace

uADPhysASA Namespace

Links
Classes, uADPhysASA Namespace, Legend
What do you think about this topic? Send feedback!


TADASABackup Class

TADASABackup Class
public published TADASABackup Members Example Classes See Also Send Feedback

The class implementing SQL Anywhere backup database service.

Group

Classes

Class Hierarchy
  uADPhysASA_TADASABackupuADPhysASA_TADASABackupuADPhysASA_TADASABackupuADPhysASA_TADASABackup
File

uADPhysASA

Links
public, published, TADASABackup Members, Example, Classes, See Also
Description

Use the TADASABackup component to add a backup database capability to an application. This is a programmatic method to invoke the dbbackup tool as a thread in the DB server process.

To produce a DB backup an application should:

  • specify DriverLink;
  • specify ConnectParams;
  • specify OutputDir;
  • call Backup method.

Other properties and methods are optional.

Using the TADASABackup component on a running database is equivalent to copying the database files when the database is not running. You can use the Backup utility to back up the database while other applications or users are using it.

To communicate with an user or application the SQL Anywhere DB tool is using OnProgress event. To ask for confirmation the event will be fired with AKind = tmConfirm. The OnProgress event also may be used to produce a DB backup log.

Syntax
TADASABackup = class(TADASAService);
See Also

TADASAService.OnProgress

Example
ADASABackup1.DriverLink := ADPhysASADriverLink1;
ADASABackup1.ConnectParams := 'ENG=addemo_asa11;DBN=addemo_asa11;UID=DBA;PWD=sql';
ADASABackup1.OutputDir := 'c:\temp\db';
ADASABackup1.Flags := [bfBackupDB, bfBackupLog];
ADASABackup1.OnProgress := ADASABackup1Progress;
ADASABackup1.Backup;
What do you think about this topic? Send feedback!


TADASABackup Members

TADASABackup Members
Events TADASABackup Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADASABackup.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADASABackup Class

Methods
Method | Description
Backup | Starts the backup task.
Properties
Property | Description
CheckpointLogType | Control copying of checkpoint log.
CliObj | Returns a reference to the driver CLI object.
ConnectParams | Specify connection parameters.
DriverLink | Specifies the DriverLink.
Flags | Specifies additional backup flags.
HotlogFilename | Specifies the file name for the live backup file.
OnProgress | Specifies the event handler allowing to communicate with the DB server.
OutputDir | Specifies the directory the backup files are copied to.
PageBlocksize | Specifies the maximum block size to be used to transfer pages from the database server to dbbackup.
StartLine | Specifies the start line.
ToolLib | Reference to the tool library.
Links
Events, TADASABackup Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADASABackup Class Legend Methods Send Feedback

The public members of the TADASABackup class are listed here.

Class

TADASABackup Class

Methods
Method | Description
Backup | Starts the backup task.
Links
TADASABackup Class, Legend, Methods
What do you think about this topic? Send feedback!


TADASABackup.Backup Method

TADASABackup.Backup Method
TADASABackup Class TADASABackup Members uADPhysASA Namespace public See Also Send Feedback

Starts the backup task.

Group

public

Links
TADASABackup Class, TADASABackup Members, uADPhysASA Namespace, public, See Also
Description

Use the Backup method to start the backup task on the DB server host using DB tools.

To perform a backup task an application must specify the ConnectParams and OutputDir. This is a programmatic method to invoke the dbbackup tool as a thread in the DB server process.

Syntax
procedure Backup;
See Also

ConnectParams, StartLine, OutputDir

What do you think about this topic? Send feedback!


published

published
TADASABackup Class Legend Properties Send Feedback

The published members of the TADASABackup class are listed here.

Class

TADASABackup Class

Properties
Property | Description
CheckpointLogType | Control copying of checkpoint log.
ConnectParams | Specify connection parameters.
Flags | Specifies additional backup flags.
HotlogFilename | Specifies the file name for the live backup file.
OutputDir | Specifies the directory the backup files are copied to.
PageBlocksize | Specifies the maximum block size to be used to transfer pages from the database server to dbbackup.
StartLine | Specifies the start line.
Links
TADASABackup Class, Legend, Properties
What do you think about this topic? Send feedback!


TADASABackup.CheckpointLogType Property

TADASABackup.CheckpointLogType Property
TADASABackup Class TADASABackup Members uADPhysASA Namespace published Send Feedback

Control copying of checkpoint log.

Group

published

Links
TADASABackup Class, TADASABackup Members, uADPhysASA Namespace, published
Description

Use the CheckpointLogType to control copying of checkpoint log. Corresponds to -k checkpoint-log-copy-option.

Syntax
property CheckpointLogType: TASABackupCheckpointLogType;
What do you think about this topic? Send feedback!


TADASABackup.ConnectParams Property

TADASABackup.ConnectParams Property
TADASABackup Class TADASABackup Members uADPhysASA Namespace published See Also Send Feedback

Specify connection parameters.

Group

published

Links
TADASABackup Class, TADASABackup Members, uADPhysASA Namespace, published, See Also
Description

Use the ConnectParams to specify connection parameters. The user ID must have DBA authority or REMOTE DBA authority to connect to the database. Corresponds to -c "keyword=value; ...".

Syntax
property ConnectParams: AnsiString;
See Also

StartLine

What do you think about this topic? Send feedback!


TADASABackup.Flags Property

TADASABackup.Flags Property
TADASABackup Class TADASABackup Members uADPhysASA Namespace published See Also Send Feedback

Specifies additional backup flags.

Group

published

Links
TADASABackup Class, TADASABackup Members, uADPhysASA Namespace, published, See Also
Description

Use the Flags property to specify additional backup flags.

Flag | Description
bfBackupDB | Back up the database file or not. Corresponds to -d.
bfBackupLog | Back up the transaction log file or not. Corresponds to -t.
bfNoConfirm | Operate with or without confirmation. Corresponds to -y.
bfQuiet | Operate without printing messages, or print messages. Corresponds to -q.
bfRenameLog | Rename the transaction log. Corresponds to -r.
bfTruncateLog | Delete the transaction log. Corresponds to -x.
bfRenameLocalLog | Rename the local backup of the transaction log. Corresponds to -n.
bfServerBackup | Rename the local backup of the transaction log. Corresponds to -n.
Syntax
property Flags: TASABackupFlags;
See Also

HotlogFilename

What do you think about this topic? Send feedback!


TADASABackup.HotlogFilename Property

TADASABackup.HotlogFilename Property
TADASABackup Class TADASABackup Members uADPhysASA Namespace published See Also Send Feedback

Specifies the file name for the live backup file.

Group

published

Links
TADASABackup Class, TADASABackup Members, uADPhysASA Namespace, published, See Also
Description

Use the HotlogFilename to specify the file name for the live backup file. Corresponds to -l filename.

Syntax
property HotlogFilename: AnsiString;
See Also

Flags

What do you think about this topic? Send feedback!


TADASABackup.OutputDir Property

TADASABackup.OutputDir Property
TADASABackup Class TADASABackup Members uADPhysASA Namespace published Send Feedback

Specifies the directory the backup files are copied to.

Group

published

Links
TADASABackup Class, TADASABackup Members, uADPhysASA Namespace, published
Description

Use the OutputDir to specify the directory the backup files are copied to. If the directory does not exist, it is created. However, the parent directory must exist. Corresponds to target-directory.

Syntax
property OutputDir: AnsiString;
What do you think about this topic? Send feedback!


TADASABackup.PageBlocksize Property

TADASABackup.PageBlocksize Property
TADASABackup Class TADASABackup Members uADPhysASA Namespace published See Also Send Feedback

Specifies the maximum block size to be used to transfer pages from the database server to dbbackup.

Group

published

Links
TADASABackup Class, TADASABackup Members, uADPhysASA Namespace, published, See Also
Description

Use the PageBlockSize property to specify the maximum block size (in number of pages) to be used to transfer pages from the database server to dbbackup. Corresponds to -b block-size.

Syntax
property PageBlocksize: Longword;
See Also

Flags

What do you think about this topic? Send feedback!


TADASABackup.StartLine Property

TADASABackup.StartLine Property
TADASABackup Class TADASABackup Members uADPhysASA Namespace published See Also Send Feedback

Specifies the start line.

Group

published

Links
TADASABackup Class, TADASABackup Members, uADPhysASA Namespace, published, See Also
Description

Use the StartLine to specify SQL Anywhere start line. May be used for SQL Anywhere v 9 or less only.

Syntax
property StartLine: AnsiString;
See Also

ConnectParams

What do you think about this topic? Send feedback!


TADASAService Class

TADASAService Class
public published TADASAService Members Classes Send Feedback

The base class for all Sybase SQL Anywhere service classes.

Group

Classes

Class Hierarchy
  uADPhysASA_TADASAServiceuADPhysASA_TADASAServiceuADPhysASA_TADASAService
File

uADPhysASA

Links
public, published, TADASAService Members, Classes
Description

The TADASAService class is used as a base class for all Sybase SQL Anywhere service classes and should not be used directly. The class contains the common properties, like the DriverLink, OnProgress.

Syntax
TADASAService = class(TADPhysODBCBaseService);
What do you think about this topic? Send feedback!


TADASAService Members

TADASAService Members
Events TADASAService Class Legend Properties Send Feedback

The following tables list the members exposed by TADASAService.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADASAService Class

Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
OnProgress | Specifies the event handler allowing to communicate with the DB server.
ToolLib | Reference to the tool library.
Links
Events, TADASAService Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADASAService Class Legend Properties Send Feedback

The public members of the TADASAService class are listed here.

Class

TADASAService Class

Properties
Property | Description
ToolLib | Reference to the tool library.
Links
TADASAService Class, Legend, Properties
What do you think about this topic? Send feedback!


TADASAService.ToolLib Property

TADASAService.ToolLib Property
TADASAService Class TADASAService Members uADPhysASA Namespace public Send Feedback

Reference to the tool library.

Group

public

Links
TADASAService Class, TADASAService Members, uADPhysASA Namespace, public
Description

Returns a reference to the tool library object.

Syntax
property ToolLib: TASAToolLib;
What do you think about this topic? Send feedback!


published

published
TADASAService Class Legend Properties Send Feedback

The published members of the TADASAService class are listed here.

Class

TADASAService Class

Properties
Property | Description
DriverLink | Specifies the DriverLink.
OnProgress | Specifies the event handler allowing to communicate with the DB server.
Links
TADASAService Class, Legend, Properties
What do you think about this topic? Send feedback!


TADASAService.DriverLink Property

TADASAService.DriverLink Property
TADASAService Class TADASAService Members uADPhysASA Namespace published Send Feedback

Specifies the DriverLink.

Group

published

Links
TADASAService Class, TADASAService Members, uADPhysASA Namespace, published
Description

Use the DriverLink property to specify the driver link. This property must be specified for any service operation.

Syntax
property DriverLink: TADPhysASADriverLink;
What do you think about this topic? Send feedback!


TADASAService.OnProgress Property

TADASAService.OnProgress Property
TADASAService Class TADASAService Members uADPhysASA Namespace Example published Send Feedback

Specifies the event handler allowing to communicate with the DB server.

Group

published

Links
TADASAService Class, TADASAService Members, uADPhysASA Namespace, Example, published
Description

Use the OnProgress event handler to communicate with the DB server. The event handler receives arguments:

  • AMessage - message from a DB services;
  • AKind - message kind;
  • AResult - respond from a handler.
Syntax
property OnProgress: TADASAProgressEvent;
Example
procedure TForm1.ADASABackup1Progress(ASender: TObject; AMessage: string;
  AKind: TASAToolMessageKind; var AResult: Integer);
begin
  if Memo1 <> nil then
    Memo1.Lines.Add(AMessage);
  if AKind = tmConfirm then
    if MessageDlg(AMessage, mtConfirmation, mbYesNo, -1) = mrYes then
      AResult := 1
    else
      AResult := 0;
end;
What do you think about this topic? Send feedback!


TADASAValidate Class

TADASAValidate Class
public published TADASAValidate Members Example Classes See Also Send Feedback

The class implementing SQL Anywhere database validate service.

Group

Classes

Class Hierarchy
  uADPhysASA_TADASAValidateuADPhysASA_TADASAValidateuADPhysASA_TADASAValidateuADPhysASA_TADASAValidate
File

uADPhysASA

Links
public, published, TADASAValidate Members, Example, Classes, See Also
Description

Use the TADASAValidate component to add a database validate capability to an application. This is a programmatic method to invoke the dbvalid tool as a thread in the DB server process.

To validate and or repair a database an application should:

  • specify DriverLink;
  • specify ConnectParams;
  • call Validate method.

To produce a DB validate log an application should use OnProgress event.

Syntax
TADASAValidate = class(TADASAService);
See Also

TADASAService.OnProgress

Example
ADASAValidate1.DriverLink := ADPhysASADriverLink1;
ADASAValidate1.ConnectParams := 'ENG=addemo_asa11;DBN=addemo_asa11;UID=DBA;PWD=sql';
ADASAValidate1.ValidateType := vtNormal;
ADASAValidate1.Flags := [];
ADASAValidate1.OnProgress := ADASABackup1Progress;
ADASAValidate1.Validate;
What do you think about this topic? Send feedback!


TADASAValidate Members

TADASAValidate Members
Events TADASAValidate Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADASAValidate.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADASAValidate Class

Methods
Method | Description
Validate | Starts the validation task.
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
ConnectParams | Specify connection parameters.
DriverLink | Specifies the DriverLink.
Flags | Specifies additional validate flags.
OnProgress | Specifies the event handler allowing to communicate with the DB server.
StartLine | Specifies the start line.
Tables | Specifies the table or materialized view list to validate.
ToolLib | Reference to the tool library.
ValidateType | Specifies the database validation mode.
Links
Events, TADASAValidate Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADASAValidate Class Legend Methods Send Feedback

The public members of the TADASAValidate class are listed here.

Class

TADASAValidate Class

Methods
Method | Description
Validate | Starts the validation task.
Links
TADASAValidate Class, Legend, Methods
What do you think about this topic? Send feedback!


TADASAValidate.Validate Method

TADASAValidate.Validate Method
TADASAValidate Class TADASAValidate Members uADPhysASA Namespace public See Also Send Feedback

Starts the validation task.

Group

public

Links
TADASAValidate Class, TADASAValidate Members, uADPhysASA Namespace, public, See Also
Description

Use the Validate method to start the validation task on the DB server host using DB tools.

To perform a validation task an application must specify the ConnectParams. This is a programmatic method to invoke the dbvalid tool as a thread in the DB server process.

Syntax
procedure Validate;
See Also

ConnectParams, StartLine

What do you think about this topic? Send feedback!


published

published
TADASAValidate Class Legend Properties Send Feedback

The published members of the TADASAValidate class are listed here.

Class

TADASAValidate Class

Properties
Property | Description
ConnectParams | Specify connection parameters.
Flags | Specifies additional validate flags.
StartLine | Specifies the start line.
Tables | Specifies the table or materialized view list to validate.
ValidateType | Specifies the database validation mode.
Links
TADASAValidate Class, Legend, Properties
What do you think about this topic? Send feedback!


TADASAValidate.ConnectParams Property

TADASAValidate.ConnectParams Property
TADASAValidate Class TADASAValidate Members uADPhysASA Namespace published See Also Send Feedback

Specify connection parameters.

Group

published

Links
TADASAValidate Class, TADASAValidate Members, uADPhysASA Namespace, published, See Also
Description

Use the ConnectParams to specify connection parameters. The user ID must have DBA authority or VALIDATE authority. Corresponds to -c "keyword=value; ...".

Syntax
property ConnectParams: AnsiString;
See Also

StartLine

What do you think about this topic? Send feedback!


TADASAValidate.Flags Property

TADASAValidate.Flags Property
TADASAValidate Class TADASAValidate Members uADPhysASA Namespace published See Also Send Feedback

Specifies additional validate flags.

Group

published

Links
TADASAValidate Class, TADASAValidate Members, uADPhysASA Namespace, published, See Also
Description

Use the Flags property to specify additional validate flags.

Flag | Description
vfQuiet | Operate without printing messages, or print messages. Corresponds to -q.
vfIndex | Validate indexes. Corresponds to -i when included, to -t when excluded.
Syntax
property Flags: TASAValidateFlags;
See Also

ValidateType, Tables

What do you think about this topic? Send feedback!


TADASAValidate.StartLine Property

TADASAValidate.StartLine Property
TADASAValidate Class TADASAValidate Members uADPhysASA Namespace published See Also Send Feedback

Specifies the start line.

Group

published

Links
TADASAValidate Class, TADASAValidate Members, uADPhysASA Namespace, published, See Also
Description

Use the StartLine to specify SQL Anywhere start line. May be used for SQL Anywhere v 9 or less only.

Syntax
property StartLine: AnsiString;
See Also

ConnectParams

What do you think about this topic? Send feedback!


TADASAValidate.Tables Property

TADASAValidate.Tables Property
TADASAValidate Class TADASAValidate Members uADPhysASA Namespace published See Also Send Feedback

Specifies the table or materialized view list to validate.

Group

published

Links
TADASAValidate Class, TADASAValidate Members, uADPhysASA Namespace, published, See Also
Description

Use the Tables property to specify the table or materialized view list to validate. When vfIndex is included into Flags, then Tables specifies index names to validate. Corresponds to object-name.

Syntax
property Tables: TStrings;
See Also

Flags

What do you think about this topic? Send feedback!


TADASAValidate.ValidateType Property

TADASAValidate.ValidateType Property
TADASAValidate Class TADASAValidate Members uADPhysASA Namespace published See Also Send Feedback

Specifies the database validation mode.

Group

published

Links
TADASAValidate Class, TADASAValidate Members, uADPhysASA Namespace, published, See Also
Description

Use the ValidateType to specifiy the database validation mode. Corresponds to -d, -fx, -s.

Syntax
property ValidateType: TASAValidateType;
See Also

Flags, Tables

What do you think about this topic? Send feedback!


TADPhysASADriverLink Class

TADPhysASADriverLink Class
published TADPhysASADriverLink Members Example Classes See Also Send Feedback

Use the TADPhysASADriverLink component to link the Sybase SQL Anywhere driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysASA_TADPhysASADriverLinkuADPhysASA_TADPhysASADriverLinkuADPhysASA_TADPhysASADriverLink
File

uADPhysASA

Links
published, TADPhysASADriverLink Members, Example, Classes, See Also
Description

Use the TADPhysASADriverLink component to link the Sybase SQL Anywhere driver to an application. In general it is enough to only include uADPhysASA unit into your application uses clause.

The TADPhysASADriverLink component may be used to specify:

  • ODBCDriver - Sybase SQL Anywhere ODBC driver name;
  • ODBCAdvanced - Sybase SQL Anywhere ODBC driver connection parameter common for all connections;
  • VendorLib - ODBC driver manager. By default it is odbc32.dll and for most cases should remain unchanged.

All properties have default values appropriate for most case. To have an effect all property changes must be performed when FireDAC manager is inactive.

Syntax
TADPhysASADriverLink = class(TADPhysODBCBaseDriverLink);
See Also

Configuring Drivers, Connect to Sybase SQL Anywhere

Example
ADPhysASADriverLink1.ODBCAdvanced := 'AutoStart=Yes;CharSet=Windows-1251';
ADPhysASADriverLink1.ODBCDriver := 'Sybase SQL Anywhere 5.0';
What do you think about this topic? Send feedback!


TADPhysASADriverLink Members

TADPhysASADriverLink Members
Events TADPhysASADriverLink Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADPhysASADriverLink.

Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.
Class

TADPhysASADriverLink Class

Methods
Method | Description
GetDrivers | Returns the list of ODBC driver names.
GetDSNs | Returns the list of ODBC data source names.
Release | Releases the driver resources, allowing to initialize the driver with different parameters.
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
ODBCAdvanced | The ODBC driver common parameters.
ODBCDriver | The ODBC driver name.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
ToolLib | Specifies the path to the DBTOOLn.DLL.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.
Links
Events, TADPhysASADriverLink Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
TADPhysASADriverLink Class Legend Properties Send Feedback

The published members of the TADPhysASADriverLink class are listed here.

Class

TADPhysASADriverLink Class

Properties
Property | Description
ToolLib | Specifies the path to the DBTOOLn.DLL.
Links
TADPhysASADriverLink Class, Legend, Properties
What do you think about this topic? Send feedback!


TADPhysASADriverLink.ToolLib Property

TADPhysASADriverLink.ToolLib Property
TADPhysASADriverLink Class TADPhysASADriverLink Members uADPhysASA Namespace published Send Feedback

Specifies the path to the DBTOOLn.DLL.

Group

published

Links
TADPhysASADriverLink Class, TADPhysASADriverLink Members, uADPhysASA Namespace, published
Description

Use the ToolLib property to specify the path and name for the DBTOOLn.DLL library. This library is used by all SQL Anywhere service classes.

Syntax
property ToolLib: String;
What do you think about this topic? Send feedback!


uADPhysDataSnap Namespace

uADPhysDataSnap Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains Multi-Tier DataSnap driver for RAD Studio XE2 Enterprise and higher.

Classes
Class | Description
TADPhysDataSnapDriverLink | Use the TADPhysDataSnapDriverLink component to link the Multi-Tier DataSnap driver to an application.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysDataSnap unit contains:

  • Multi-Tier DataSnap driver implementation;
  • TADPhysDataSnapDriverLink - component to link the driver.
See Also

Configuring Drivers, Connect to DataSnap server

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysDataSnap Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysDataSnapDriverLink | Use the TADPhysDataSnapDriverLink component to link the Multi-Tier DataSnap driver to an application.
Namespace

uADPhysDataSnap Namespace

Links
Classes, uADPhysDataSnap Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysDataSnapDriverLink Class

TADPhysDataSnapDriverLink Class
Classes See Also Send Feedback

Use the TADPhysDataSnapDriverLink component to link the Multi-Tier DataSnap driver to an application.

Group

Classes

Class Hierarchy
  uADPhysDataSnap_TADPhysDataSnapDriverLink
File

uADPhysDataSnap

Links
Classes, See Also
Description

Use the TADPhysDataSnapDriverLink component to link the Multi-Tier DataSnap driver to an application. In general it is enough to only include uADPhysDataSnap unit into your application uses clause.

TADPhysDataSnapDriverLink does not use VendorLib and VendorHome properties in the current FireDAC version.

DataSnap driver is supported only on RAD Studio XE2 and higher.

Syntax
TADPhysDataSnapDriverLink = class(TADPhysTDBXBaseDriverLink);
See Also

Configuring Drivers, Connect to DataSnap server

What do you think about this topic? Send feedback!


uADPhysDB2 Namespace

uADPhysDB2 Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains IBM DB2 driver and services components.

Classes
Class | Description
EDB2NativeException | Class representing a IBM DB2 driver exception.
TADPhysDB2DriverLink | Use the TADPhysDB2DriverLink component to link the IBM DB2 driver to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysDB2 unit contains:

  • IBM DB2 driver implementation;
  • TADPhysDB2DriverLink - component to link the driver and setup CLI library.
See Also

Configuring Drivers, Connect to IBM DB2 Server

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysDB2 Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
EDB2NativeException | Class representing a IBM DB2 driver exception.
TADPhysDB2DriverLink | Use the TADPhysDB2DriverLink component to link the IBM DB2 driver to an application and setup it.
Namespace

uADPhysDB2 Namespace

Links
Classes, uADPhysDB2 Namespace, Legend
What do you think about this topic? Send feedback!


EDB2NativeException Class

EDB2NativeException Class
Example Classes See Also Send Feedback

Class representing a IBM DB2 driver exception.

Group

Classes

Class Hierarchy
  uADPhysDB2_EDB2NativeException
File

uADPhysDB2

Links
Example, Classes, See Also
Description

The FireDAC DB2 driver raises exceptions of EDB2NativeException class. Use this class to handle driver specific errors.

Syntax
EDB2NativeException = class(EODBCNativeException);
See Also

EODBCNativeException, TADPhysDB2DriverLink, Connect to IBM DB2 Server

Example
try
  ADConnection1.Connected := True;
except
  on E: EDB2NativeException do
    // perform DB2 error specific actions
end;
What do you think about this topic? Send feedback!


TADPhysDB2DriverLink Class

TADPhysDB2DriverLink Class
Example Classes See Also Send Feedback

Use the TADPhysDB2DriverLink component to link the IBM DB2 driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysDB2_TADPhysDB2DriverLinkuADPhysDB2_TADPhysDB2DriverLinkuADPhysDB2_TADPhysDB2DriverLink
File

uADPhysDB2

Links
Example, Classes, See Also
Description

Use the TADPhysDB2DriverLink component to link the IBM DB2 driver to an application. In general it is enough to only include uADPhysDB2 unit into your application uses clause.

The TADPhysDB2DriverLink component may be used to specify:

  • ODBCDriver - DB2 ODBC driver name;
  • ODBCAdvanced - DB2 ODBC driver connection parameter common for all connections;
  • VendorLib - ODBC driver manager. By default it is odbc32.dll and for most cases should remain unchanged.

All properties have default values appropriate for most case. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysDB2DriverLink = class(TADPhysODBCBaseDriverLink);
See Also

Configuring Drivers, Connect to IBM DB2 Server

Example
ADPhysDB2DriverLink1.ODBCAdvanced := 'IGNOREWARNINGS=1';
ADPhysDB2DriverLink1.ODBCDriver := 'IBM DB2 ODBC DRIVER - DB2COPY1';
What do you think about this topic? Send feedback!


uADPhysDBExp Namespace

uADPhysDBExp Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains dbExpress v 1-3 bridge driver.

Classes
Class | Description
TADPhysDBXDriverLink | Use the TADPhysDBXDriverLink component to link the dbExpress v 1-3 bridge driver to an application.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysDBExp unit contains:

  • dbExpress v 1-3 bridge driver implementation;
  • TADPhysDBXDriverLink - component to link the driver.
See Also

Configuring Drivers, Connect to dbExpress data source

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysDBExp Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysDBXDriverLink | Use the TADPhysDBXDriverLink component to link the dbExpress v 1-3 bridge driver to an application.
Namespace

uADPhysDBExp Namespace

Links
Classes, uADPhysDBExp Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysDBXDriverLink Class

TADPhysDBXDriverLink Class
Classes See Also Send Feedback

Use the TADPhysDBXDriverLink component to link the dbExpress v 1-3 bridge driver to an application.

Group

Classes

Class Hierarchy
  uADPhysDBExp_TADPhysDBXDriverLinkuADPhysDBExp_TADPhysDBXDriverLink
File

uADPhysDBExp

Links
Classes, See Also
Description

Use the TADPhysDBXDriverLink component to link the dbExpress v 1-3 bridge driver to an application. In general it is enough to only include uADPhysDBExp unit into your application uses clause.

TADPhysDBXDriverLink does not use VendorLib and VendorHome properties in current FireDAC version.

Syntax
TADPhysDBXDriverLink = class(TADPhysDriverLink);
See Also

Configuring Drivers, Connect to dbExpress data source

What do you think about this topic? Send feedback!


uADPhysIB Namespace

uADPhysIB Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains Firebird and Interbase driver and services components.

Classes
Class | Description
TADIBBackup | The class implementing FB/IB backup database service.
TADIBNBackup | The class implementing Firebird-only backup database service.
TADIBNRestore | The class implementing Firebird-only restored database service.
TADIBRestore | The class implementing FB/IB service restoring a database from a backup.
TADIBSecurity | The class implementing FB/IB database security management service.
TADIBService | The base class for all FB/IB service classes.
TADIBTrace | The class implementing Firebird database trace service.
TADIBValidate | The class implementing FB/IB database validate and repair service.
TADPhysIBDriverLink | Use the TADPhysIBDriverLink component to link the FB/IB driver to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysIB unit contains:

  • Firebird and Interbase driver implementation;
  • TADPhysIBDriverLink - component to link the driver and setup CLI library;
  • TADIBBackup - backup DB service component;
  • TADIBNBackup - backup DB service component, using NBackup;
  • TADIBRestore - restore DB service component;
  • TADIBNRestore - restore DB service component, using NBackup;
  • TADIBValidate - DB validation and repair service component;
  • TADIBTrace - Firebird trace service component;
  • TADIBSecurity - security service component.
See Also

Configuring Drivers, Connect to Interbase or Firebird

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysIB Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADIBBackup | The class implementing FB/IB backup database service.
TADIBNBackup | The class implementing Firebird-only backup database service.
TADIBNRestore | The class implementing Firebird-only restored database service.
TADIBRestore | The class implementing FB/IB service restoring a database from a backup.
TADIBSecurity | The class implementing FB/IB database security management service.
TADIBService | The base class for all FB/IB service classes.
TADIBTrace | The class implementing Firebird database trace service.
TADIBValidate | The class implementing FB/IB database validate and repair service.
TADPhysIBDriverLink | Use the TADPhysIBDriverLink component to link the FB/IB driver to an application and setup it.
Namespace

uADPhysIB Namespace

Links
Classes, uADPhysIB Namespace, Legend
What do you think about this topic? Send feedback!


TADIBBackup Class

TADIBBackup Class
public published TADIBBackup Members Example Classes See Also Send Feedback

The class implementing FB/IB backup database service.

Group

Classes

Class Hierarchy
  uADPhysIB_TADIBBackupuADPhysIB_TADIBBackupuADPhysIB_TADIBBackup
File

uADPhysIB

Links
public, published, TADIBBackup Members, Example, Classes, See Also
Description

Use the TADIBBackup component to add a backup FB/IB database capability to an application. This is a programmatic method to invoke the gbak tool as a thread in the DB server process.

To produce a DB backup an application should:

  • specify DriverLink, UserName, Password, Host;
  • specify Database - a primary database file to backup;
  • specify BackupFiles - the file names to backup a database into;
  • call Backup method.

Other properties and methods are optional.

Paths of backup files are relative to the server. Because the TADIBBackup executes backup on the DB server host, the DB Service Manager writes backup files on the server host. The DB Services Manager also creates files in the context of the server.

To produce a DB backup log an application should set Verbose to True and use OnProgress event.

The TADIBNBackup component may be used for an incremental backup. To restore an backup performed by TADIBBackup use the TADIBRestore component.

Syntax
TADIBBackup = class(TADIBService);
See Also

TADIBNBackup, TADIBRestore

Example
ADIBBackup1.DriverLink := ADPhysIBDriverLink1;

ADIBBackup1.UserName := 'sysdba';
ADIBBackup1.Password := 'masterkey';
ADIBBackup1.Host := 'db_srv_host';
ADIBBackup1.Protocol := ipTCPIP;

ADIBBackup1.Database := 'e:\ib\addemo.fdb';
ADIBBackup1.BackupFiles.Add('e:\ib\addemo.backup');

ADIBBackup1.Backup;
What do you think about this topic? Send feedback!


TADIBBackup Members

TADIBBackup Members
Events TADIBBackup Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADIBBackup.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.
Class

TADIBBackup Class

Methods
Method | Description
Backup | Starts the backup task.
Properties
Property | Description
BackupFiles | Specifies the backup files.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to backup.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Options | Specifies backup options.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Verbose | Controls the DB Service Manager feedback.
Links
Events, TADIBBackup Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADIBBackup Class Legend Methods Send Feedback

The public members of the TADIBBackup class are listed here.

Class

TADIBBackup Class

Methods
Method | Description
Backup | Starts the backup task.
Links
TADIBBackup Class, Legend, Methods
What do you think about this topic? Send feedback!


TADIBBackup.Backup Method

TADIBBackup.Backup Method
TADIBBackup Class TADIBBackup Members uADPhysIB Namespace public See Also Send Feedback

Starts the backup task.

Group

public

Links
TADIBBackup Class, TADIBBackup Members, uADPhysIB Namespace, public, See Also
Description

Use the Backup method to start the backup task on the DB server host using Service Manager.

To perform a backup task an application must specify the connection parameters, Database and BackupFiles. This is a programmatic method to invoke the gbak tool as a thread in the DB server process.

Syntax
procedure Backup;
See Also

TADIBService.Host, TADIBService.UserName, TADIBService.Password, Database, BackupFiles

What do you think about this topic? Send feedback!


published

published
TADIBBackup Class Legend Properties Send Feedback

The published members of the TADIBBackup class are listed here.

Class

TADIBBackup Class

Properties
Property | Description
BackupFiles | Specifies the backup files.
Database | Specifies a database file to backup.
Options | Specifies backup options.
Verbose | Controls the DB Service Manager feedback.
Links
TADIBBackup Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIBBackup.BackupFiles Property

TADIBBackup.BackupFiles Property
TADIBBackup Class TADIBBackup Members uADPhysIB Namespace Example 1 Example 2 published See Also Send Feedback

Specifies the backup files.

Group

published

Links
TADIBBackup Class, TADIBBackup Members, uADPhysIB Namespace, Example 1, Example 2, published, See Also
Description

Use the BackupFiles property to specify one or more backup output files.

The paths are relative to the DB server host. When few files are specified, that corresponds to gsplit functionality. Each file must be specified on a separated line.

Optionally BackupFiles allows to specify length in bytes of the backup output file. You may specify one length value for each output file except the last. The length may be specified after a backup file name, separated by '='.

Syntax
property BackupFiles: TStrings;
See Also

Database, TADIBRestore

Example 1

Specifying multiple files with length:

with ADIBBackup1.BackupFiles do begin
  Clear;
  Add('/tmp/addemo.backup1=10000000');
  Add('/tmp/addemo.backup2=10000000');
  Add('/tmp/addemo.backup3');
end;
Example 2

Specifying single file:

ADIBBackup1.BackupFiles.Text := 'e:\temp\addemo.backup';
What do you think about this topic? Send feedback!


TADIBBackup.Database Property

TADIBBackup.Database Property
TADIBBackup Class TADIBBackup Members uADPhysIB Namespace published See Also Send Feedback

Specifies a database file to backup.

Group

published

Links
TADIBBackup Class, TADIBBackup Members, uADPhysIB Namespace, published, See Also
Description

Use the Database property to specify a path of the primary file of the database to backup. The path is relative to a DB server.

Syntax
property Database: String;
See Also

BackupFiles

What do you think about this topic? Send feedback!


TADIBBackup.Options Property

TADIBBackup.Options Property
TADIBBackup Class TADIBBackup Members uADPhysIB Namespace published Send Feedback

Specifies backup options.

Group

published

Links
TADIBBackup Class, TADIBBackup Members, uADPhysIB Namespace, published
Description

Use the Options property to specify additional options controlling the backup task. The default value is empty set.

Option | Description
boIgnoreChecksum | Ignore checksums during backup. Corresponds to gbak -ignore.
boIgnoreLimbo | Ignore limbo transactions during backup. Corresponds to gbak -limbo.
boMetadataOnly | Output backup file for metadata only with empty tables. Corresponds to gbak -metadata.
boNoGarbageCollect | Suppress normal garbage collection during backup. Improves performance on some databases. Corresponds to gbak -garbage_collect.
boOldDescriptions | Output metadata in pre-4.0 format. Corresponds to gbak -old_descriptions.
boNonTransportable | Output backup file format with non-XDR data format. Improves space and performance by a negligible amount. Corresponds to gbak -nt.
boConvert | Convert external table data to internal tables. Corresponds to gbak -convert.
boExpand | Undocumented and unimplemented in Firebird.
Syntax
property Options: TIBBackupOptions;
What do you think about this topic? Send feedback!


TADIBBackup.Verbose Property

TADIBBackup.Verbose Property
TADIBBackup Class TADIBBackup Members uADPhysIB Namespace published See Also Send Feedback

Controls the DB Service Manager feedback.

Group

published

Links
TADIBBackup Class, TADIBBackup Members, uADPhysIB Namespace, published, See Also
Description

Use the Verbose property to control the DB Service Manager output. When is True, the TADIBBackup will fire OnProgress event and submit a backup task status. The default value is False. Corresponds to gbak -verbose.

Syntax
property Verbose: Boolean;
See Also

TADIBService.OnProgress

What do you think about this topic? Send feedback!


TADIBNBackup Class

TADIBNBackup Class
public published TADIBNBackup Members Example Classes See Also Send Feedback

The class implementing Firebird-only backup database service.

Group

Classes

Class Hierarchy
  uADPhysIB_TADIBNBackupuADPhysIB_TADIBNBackupuADPhysIB_TADIBNBackup
File

uADPhysIB

Links
public, published, TADIBNBackup Members, Example, Classes, See Also
Description

Use the TADIBNBackup component to add a Firebird-only backup database capability to an application. This is a programmatic method to invoke the nbackup tool as a thread in the DB server process to backup a database.

To produce a DB backup an application should:

  • specify DriverLink, UserName, Password, Host;
  • specify Database - a primary database file to backup;
  • specify BackupFiles - the file name to backup a database into;
  • specify Level - the incremental level or full backup mode;
  • call Backup method.

Other properties and methods are optional.

Paths of backup files are relative to the server. Because the TADIBNBackup executes backup on the DB server host, the DB Service Manager writes backup files on the server host. The DB Services Manager also creates files in the context of the server.

To restore an backup performed by TADIBNBackup use the TADIBNRestore component.

Read [image] http://www.firebirdsql.org/manual/nbackup.html for more details.

Syntax
TADIBNBackup = class(TADIBService);
See Also

TADIBBackup, TADIBNRestore

Example
ADIBNBackup1.DriverLink := ADPhysIBDriverLink1;

ADIBNBackup1.UserName := 'sysdba';
ADIBNBackup1.Password := 'masterkey';
ADIBNBackup1.Host := 'db_srv_host';
ADIBNBackup1.Protocol := ipTCPIP;

ADIBNBackup1.Database := 'e:\ib\addemo.fdb';
ADIBNBackup1.BackupFile := 'e:\ib\addemo.backup';
ADIBNBackup1.Level := 0; // full backup

ADIBNBackup1.Backup;
What do you think about this topic? Send feedback!


TADIBNBackup Members

TADIBNBackup Members
Events TADIBNBackup Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADIBNBackup.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.
Class

TADIBNBackup Class

Methods
Method | Description
Backup | Starts the backup task.
Properties
Property | Description
BackupFile | Specifies a backup file.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to backup.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Level | Specifies the backup level.
Options | Specifies backup options.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADIBNBackup Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADIBNBackup Class Legend Methods Send Feedback

The public members of the TADIBNBackup class are listed here.

Class

TADIBNBackup Class

Methods
Method | Description
Backup | Starts the backup task.
Links
TADIBNBackup Class, Legend, Methods
What do you think about this topic? Send feedback!


TADIBNBackup.Backup Method

TADIBNBackup.Backup Method
TADIBNBackup Class TADIBNBackup Members uADPhysIB Namespace public See Also Send Feedback

Starts the backup task.

Group

public

Links
TADIBNBackup Class, TADIBNBackup Members, uADPhysIB Namespace, public, See Also
Description

Use the Backup method to start the backup task on the DB server host using Service Manager.

To perform a backup task an application must specify the connection parameters, Database and BackupFile. This is a programmatic method to invoke the nbackup tool as a thread in the DB server process.

Syntax
procedure Backup;
See Also

TADIBService.Host, TADIBService.UserName, TADIBService.Password, Database, BackupFile

What do you think about this topic? Send feedback!


published

published
TADIBNBackup Class Legend Properties Send Feedback

The published members of the TADIBNBackup class are listed here.

Class

TADIBNBackup Class

Properties
Property | Description
BackupFile | Specifies a backup file.
Database | Specifies a database file to backup.
Level | Specifies the backup level.
Options | Specifies backup options.
Links
TADIBNBackup Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIBNBackup.BackupFile Property

TADIBNBackup.BackupFile Property
TADIBNBackup Class TADIBNBackup Members uADPhysIB Namespace Example published See Also Send Feedback

Specifies a backup file.

Group

published

Links
TADIBNBackup Class, TADIBNBackup Members, uADPhysIB Namespace, Example, published, See Also
Description

Use the BackupFiles property to specify a backup output file. The path is relative to the DB server host.

Syntax
property BackupFile: String;
See Also

Database, TADIBNRestore

Example
ADIBNBackup1.BackupFile := 'e:\temp\addemo.backup';
What do you think about this topic? Send feedback!


TADIBNBackup.Database Property

TADIBNBackup.Database Property
TADIBNBackup Class TADIBNBackup Members uADPhysIB Namespace published See Also Send Feedback

Specifies a database file to backup.

Group

published

Links
TADIBNBackup Class, TADIBNBackup Members, uADPhysIB Namespace, published, See Also
Description

Use the Database property to specify a path of the primary file of the database to backup. The path is relative to a DB server.

Syntax
property Database: String;
See Also

BackupFile

What do you think about this topic? Send feedback!


TADIBNBackup.Level Property

TADIBNBackup.Level Property
TADIBNBackup Class TADIBNBackup Members uADPhysIB Namespace published See Also Send Feedback

Specifies the backup level.

Group

published

Links
TADIBNBackup Class, TADIBNBackup Members, uADPhysIB Namespace, published, See Also
Description

Use the Level property to specify the backup task level.

The 0 means the full backup.

To make an incremental (“differential”) backup specify a backup level greater than 0. An incremental backup of level N always contains the database mutations since the most recent level N-1 backup.

Syntax
property Level: Integer;
See Also

BackupFile, Database

What do you think about this topic? Send feedback!


TADIBNBackup.Options Property

TADIBNBackup.Options Property
TADIBNBackup Class TADIBNBackup Members uADPhysIB Namespace published Send Feedback

Specifies backup options.

Group

published

Links
TADIBNBackup Class, TADIBNBackup Members, uADPhysIB Namespace, published
Description

Use the Options property to specify additional options controlling the backup task. The default value is empty set.

Option | Description
noNoTriggers | Firebird 2.1 introduced the concept of database triggers. To keep these database triggers from firing during an nbackup run, use noNoTriggers option. Corresponds to nbackup -T or gbak -nodbtriggers.
Syntax
property Options: TIBNBackupOptions;
What do you think about this topic? Send feedback!


TADIBNRestore Class

TADIBNRestore Class
public published TADIBNRestore Members Example Classes See Also Send Feedback

The class implementing Firebird-only restored database service.

Group

Classes

Class Hierarchy
  uADPhysIB_TADIBNRestoreuADPhysIB_TADIBNRestoreuADPhysIB_TADIBNRestore
File

uADPhysIB

Links
public, published, TADIBNRestore Members, Example, Classes, See Also
Description

Use the TADIBNRestore component to add a Firebird-only a restoring database from backup capability to an application. This is a programmatic method to invoke the nbackup tool as a thread in the DB server process to restore a database.

To restore a database from a DB backup an application should:

  • specify DriverLink, UserName, Password, Host;
  • specify Database - a primary database file to restore;
  • specify BackupFiles - the file names to restored a database from;
  • call Restore method.

Other properties and methods are optional.

Paths of backup files are relative to the server. Because the TADIBNBackup restores backup on the DB server host, the DB Service Manager reads backup files on the server host.

To produce a DB restore log an application should set Verbose to True and use OnProgress event.

Read [image] http://www.firebirdsql.org/manual/nbackup.html for more details.

Syntax
TADIBNRestore = class(TADIBService);
See Also

TADIBNBackup, TADIBBackup

Example
ADIBNRestore1.DriverLink := ADPhysIBDriverLink1;

ADIBNRestore1.UserName := 'sysdba';
ADIBNRestore1.Password := 'masterkey';
ADIBNRestore1.Host := 'db_srv_host';
ADIBNRestore1.Protocol := ipTCPIP;

ADIBNRestore1.Database := 'e:\ib\addemo.fdb';
ADIBNRestore1.BackupFile := 'e:\ib\addemo.backup';

ADIBNRestore1.Restore;
What do you think about this topic? Send feedback!


TADIBNRestore Members

TADIBNRestore Members
Events TADIBNRestore Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADIBNRestore.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.
Class

TADIBNRestore Class

Methods
Method | Description
Restore | Starts the restore task.
Properties
Property | Description
BackupFiles | Specifies the backup files.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to restore.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Options | Specifies restore options.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADIBNRestore Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADIBNRestore Class Legend Methods Send Feedback

The public members of the TADIBNRestore class are listed here.

Class

TADIBNRestore Class

Methods
Method | Description
Restore | Starts the restore task.
Links
TADIBNRestore Class, Legend, Methods
What do you think about this topic? Send feedback!


TADIBNRestore.Restore Method

TADIBNRestore.Restore Method
TADIBNRestore Class TADIBNRestore Members uADPhysIB Namespace public See Also Send Feedback

Starts the restore task.

Group

public

Links
TADIBNRestore Class, TADIBNRestore Members, uADPhysIB Namespace, public, See Also
Description

Use the Restore method to start the restore task on the DB server host using Service Manager.

To perform a restore task an application must specify the connection parameters, Database and BackupFiles. This is a programmatic method to invoke the nbackup tool as a thread in the DB server process.

Syntax
procedure Restore;
See Also

TADIBService.Host, TADIBService.UserName, TADIBService.Password, Database, BackupFiles

What do you think about this topic? Send feedback!


published

published
TADIBNRestore Class Legend Properties Send Feedback

The published members of the TADIBNRestore class are listed here.

Class

TADIBNRestore Class

Properties
Property | Description
BackupFiles | Specifies the backup files.
Database | Specifies a database file to restore.
Options | Specifies restore options.
Links
TADIBNRestore Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIBNRestore.BackupFiles Property

TADIBNRestore.BackupFiles Property
TADIBNRestore Class TADIBNRestore Members uADPhysIB Namespace Example published See Also Send Feedback

Specifies the backup files.

Group

published

Links
TADIBNRestore Class, TADIBNRestore Members, uADPhysIB Namespace, Example, published, See Also
Description

Use the BackupFiles property to specify one or more backup input files.

The paths are relative to the DB server host. When few files are specified, each file must be specified on a separate line.

Syntax
property BackupFiles: TStrings;
See Also

List here...

Example
What do you think about this topic? Send feedback!


TADIBNRestore.Database Property

TADIBNRestore.Database Property
TADIBNRestore Class TADIBNRestore Members uADPhysIB Namespace published See Also Send Feedback

Specifies a database file to restore.

Group

published

Links
TADIBNRestore Class, TADIBNRestore Members, uADPhysIB Namespace, published, See Also
Description

Use the Database property to specify a path of the primary file of the database to restore. The path is relative to a DB server.

Syntax
property Database: String;
See Also

BackupFiles

What do you think about this topic? Send feedback!


TADIBNRestore.Options Property

TADIBNRestore.Options Property
TADIBNRestore Class TADIBNRestore Members uADPhysIB Namespace published Send Feedback

Specifies restore options.

Group

published

Links
TADIBNRestore Class, TADIBNRestore Members, uADPhysIB Namespace, published
Description

Use the Options property to specify additional options controlling the restore task. The default value is empty set.

Option | Description
noNoTriggers | Firebird 2.1 introduced the concept of database triggers. To keep these database triggers from firing during an nbackup run, use noNoTriggers option. Corresponds to nbackup -T or gbak -nodbtriggers.
Syntax
property Options: TIBNBackupOptions;
What do you think about this topic? Send feedback!


TADIBRestore Class

TADIBRestore Class
public published TADIBRestore Members Example Classes See Also Send Feedback

The class implementing FB/IB service restoring a database from a backup.

Group

Classes

Class Hierarchy
  uADPhysIB_TADIBRestoreuADPhysIB_TADIBRestoreuADPhysIB_TADIBRestore
File

uADPhysIB

Links
public, published, TADIBRestore Members, Example, Classes, See Also
Description

Use the TADIBRestore component to add a restoring database from backup capability to an application. This is a programmatic method to invoke the gbak tool as a thread in the DB server process.

To restore a database from a DB backup an application should:

  • specify DriverLink, UserName, Password, Host;
  • specify Database - a primary database file to restore;
  • specify BackupFiles - the file names to restore a database from;
  • call Restore method.

Other properties and methods are optional.

Paths of backup files are relative to the server. Because the TADIBRestore restores backup on the DB server host, the DB Service Manager reads backup files on the server host.

To produce a DB restore log an application should set Verbose to True and use OnProgress event.

The TADIBNRestore component should be used to restored an incremental backup.

Syntax
TADIBRestore = class(TADIBService);
See Also

TADIBNRestore, TADIBBackup

Example
ADIBRestore1.DriverLink := ADPhysIBDriverLink1;

ADIBRestore1.UserName := 'sysdba';
ADIBRestore1.Password := 'masterkey';
ADIBRestore1.Host := 'db_srv_host';
ADIBRestore1.Protocol := ipTCPIP;

ADIBRestore1.Database := 'e:\ib\addemo.fdb';
ADIBRestore1.BackupFiles.Add('e:\ib\addemo.backup');

ADIBRestore1.Restore;
What do you think about this topic? Send feedback!


TADIBRestore Members

TADIBRestore Members
Events TADIBRestore Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADIBRestore.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.
Class

TADIBRestore Class

Methods
Method | Description
Restore | Starts the restore task.
Properties
Property | Description
BackupFiles | Specifies the backup files.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to restore.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Options | Specifies restore options.
PageSize | Specifies the page size for a restored database.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Verbose | Controls the DB Service Manager feedback.
Links
Events, TADIBRestore Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADIBRestore Class Legend Methods Send Feedback

The public members of the TADIBRestore class are listed here.

Class

TADIBRestore Class

Methods
Method | Description
Restore | Starts the restore task.
Links
TADIBRestore Class, Legend, Methods
What do you think about this topic? Send feedback!


TADIBRestore.Restore Method

TADIBRestore.Restore Method
TADIBRestore Class TADIBRestore Members uADPhysIB Namespace public See Also Send Feedback

Starts the restore task.

Group

public

Links
TADIBRestore Class, TADIBRestore Members, uADPhysIB Namespace, public, See Also
Description

Use the Restore method to start the restore task on the DB server host using Service Manager.

To perform a restore task an application must specify the connection parameters, Database and BackupFiles. This is a programmatic method to invoke the gbak tool as a thread in the DB server process.

Syntax
procedure Restore;
See Also

TADIBService.Host, TADIBService.UserName, TADIBService.Password, Database, BackupFiles

What do you think about this topic? Send feedback!


published

published
TADIBRestore Class Legend Properties Send Feedback

The published members of the TADIBRestore class are listed here.

Class

TADIBRestore Class

Properties
Property | Description
BackupFiles | Specifies the backup files.
Database | Specifies a database file to restore.
Options | Specifies restore options.
PageSize | Specifies the page size for a restored database.
Verbose | Controls the DB Service Manager feedback.
Links
TADIBRestore Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIBRestore.BackupFiles Property

TADIBRestore.BackupFiles Property
TADIBRestore Class TADIBRestore Members uADPhysIB Namespace published See Also Send Feedback

Specifies the backup files.

Group

published

Links
TADIBRestore Class, TADIBRestore Members, uADPhysIB Namespace, published, See Also
Description

Use the BackupFiles property to specify one or more backup input files.

The paths are relative to the DB server host. When few files are specified, each file must be specified on a separate line.

Syntax
property BackupFiles: TStrings;
See Also

Database

What do you think about this topic? Send feedback!


TADIBRestore.Database Property

TADIBRestore.Database Property
TADIBRestore Class TADIBRestore Members uADPhysIB Namespace published See Also Send Feedback

Specifies a database file to restore.

Group

published

Links
TADIBRestore Class, TADIBRestore Members, uADPhysIB Namespace, published, See Also
Description

Use the Database property to specify a path of the primary file of the database to restore. The path is relative to a DB server.

Syntax
property Database: String;
See Also

BackupFiles

What do you think about this topic? Send feedback!


TADIBRestore.Options Property

TADIBRestore.Options Property
TADIBRestore Class TADIBRestore Members uADPhysIB Namespace published See Also Send Feedback

Specifies restore options.

Group

published

Links
TADIBRestore Class, TADIBRestore Members, uADPhysIB Namespace, published, See Also
Description

Use the Options property to specify additional options controlling the restore task. The default value is empty set.

Option | Description
roDeactivateIdx | Do not build user indexes during restore. Corresponds to gbak -inactive.
roNoShadow | Do not recreate shadow files during restore. Corresponds to gbak -kill.
roNoValidity | Do not enforce validity conditions (for example, NOT NULL) during restore. Corresponds to gbak -no_validity.
roOneAtATime | Commit after completing restore of each table. Corresponds to gbak -one_at_a_time.
roReplace | Replace database, if one exists. Corresponds to gbak -replace. For a restore you must supply either roReplace or roCreate.
roCreate | Restore but do not overwrite an existing database. Corresponds to gbak -create. For a restore you must supply either roReplace or roCreate.
roUseAllSpace | Do not reserve 20 percent of each data page for future record versions. Useful for read-only databases. Corresponds to gbak -use_all_space.
roValidate | Enables validation during a restore. Corresponds to gbak -validate.
Syntax
property Options: TIBRestoreOptions;
See Also

PageSize

What do you think about this topic? Send feedback!


TADIBRestore.PageSize Property

TADIBRestore.PageSize Property
TADIBRestore Class TADIBRestore Members uADPhysIB Namespace published See Also Send Feedback

Specifies the page size for a restored database.

Group

published

Links
TADIBRestore Class, TADIBRestore Members, uADPhysIB Namespace, published, See Also
Description

Use the PageSize property to specify the page size for a restored database. The default value is 0, means a value is not specified. Corresponds to gbak -page_size.

Syntax
property PageSize: LongWord;
See Also

Options

What do you think about this topic? Send feedback!


TADIBRestore.Verbose Property

TADIBRestore.Verbose Property
TADIBRestore Class TADIBRestore Members uADPhysIB Namespace published See Also Send Feedback

Controls the DB Service Manager feedback.

Group

published

Links
TADIBRestore Class, TADIBRestore Members, uADPhysIB Namespace, published, See Also
Description

Use the Verbose property to control the DB Service Manager output. When is True, the TADIBRestore will fire OnProgress event and submit a restore task status. The default value is False. Corresponds to gbak -verbose.

Syntax
property Verbose: Boolean;
See Also

TADIBService.OnProgress

What do you think about this topic? Send feedback!


TADIBSecurity Class

TADIBSecurity Class
public published TADIBSecurity Members Example 1 Example 2 Example 3 Classes Send Feedback

The class implementing FB/IB database security management service.

Group

Classes

Class Hierarchy
  uADPhysIB_TADIBSecurityuADPhysIB_TADIBSecurityuADPhysIB_TADIBSecurity
File

uADPhysIB

Links
public, published, TADIBSecurity Members, Example 1, Example 2, Example 3, Classes
Description

Use the TADIBSecurity component to add a database security management capabilities to an application.

To manage a security an application should:

  • specify DriverLink, UserName, Password, Host;
  • optionally specify AUserName;
  • call AddUser / DeleteUser / ModifyUser / DisplayUser / DisplayUsers method.
Syntax
TADIBSecurity = class(TADIBService);
Example 1

Adding a user:

ADIBSecurity1.DriverLink := ADPhysIBDriverLink1;

ADIBSecurity1.UserName := 'sysdba';
ADIBSecurity1.Password := 'masterkey';
ADIBSecurity1.Host := 'db_srv_host';
ADIBSecurity1.Protocol := ipTCPIP;

ADIBSecurity1.AUserName := 'user1';
ADIBSecurity1.APassword := '12345';
ADIBSecurity1.AFirstName := 'Bill';
ADIBSecurity1.ALastName := 'Scott';

ADIBSecurity1.AddUser;
Example 2

Change a user password:

ADIBSecurity1.DriverLink := ADPhysIBDriverLink1;

ADIBSecurity1.UserName := 'sysdba';
ADIBSecurity1.Password := 'masterkey';
ADIBSecurity1.Host := 'db_srv_host';
ADIBSecurity1.Protocol := ipTCPIP;

ADIBSecurity1.AUserName := 'user1';
ADIBSecurity1.APassword := '12345';

ADIBSecurity1.ModifyUser;
Example 3

List all users using TADMemTable:

ADIBSecurity1.DriverLink := ADPhysIBDriverLink1;

ADIBSecurity1.UserName := 'sysdba';
ADIBSecurity1.Password := 'masterkey';
ADIBSecurity1.Host := 'db_srv_host';
ADIBSecurity1.Protocol := ipTCPIP;

ADIBSecurity1.DisplayUsers;
ADMemTable1.AttachTable(ADIBSecurity1.Users, nil);
ADMemTable1.Open;
What do you think about this topic? Send feedback!


TADIBSecurity Members

TADIBSecurity Members
Events TADIBSecurity Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADIBSecurity.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.
Class

TADIBSecurity Class

Methods
Method | Description
AddUser | Adds a new user to FB/IB security database.
DeleteUser | Deletes an existing user from FB/IB security database.
DisplayUser | Fetches an existing user properties from FB/IB security database.
DisplayUsers | Fetches all user list from FB/IB security database.
ModifyUser | Modifies an existing user in FB/IB security database.
Properties
Property | Description
AFirstName | A person first name.
AGroupID | A person group ID.
AGroupName | A person group name.
ALastName | A person last name.
AMiddleName | A person middle name.
APassword | A person password.
ARoleName | A person role name.
AUserID | A person ID.
AUserName | A person SQL user name.
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Modified | A list of modified user attributes.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Users | The reference to the all users list.
Links
Events, TADIBSecurity Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADIBSecurity Class Legend Methods Properties Send Feedback

The public members of the TADIBSecurity class are listed here.

Class

TADIBSecurity Class

Methods
Method | Description
AddUser | Adds a new user to FB/IB security database.
DeleteUser | Deletes an existing user from FB/IB security database.
DisplayUser | Fetches an existing user properties from FB/IB security database.
DisplayUsers | Fetches all user list from FB/IB security database.
ModifyUser | Modifies an existing user in FB/IB security database.
Properties
Property | Description
Users | The reference to the all users list.
Links
TADIBSecurity Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADIBSecurity.Users Property

TADIBSecurity.Users Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace Example public See Also Send Feedback

The reference to the all users list.

Group

public

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, Example, public, See Also
Description

Use the Users property to read the all existing user list. The property is filled after the call to DisplayUsers method.

Syntax
property Users: TADDatSTable;
See Also

DisplayUsers

Example
ADIBSecurity.DisplayUsers;
ADMemTable1.AttachTable(ADIBSecurity.Users, nil);
ADMemTable1.Open;
What do you think about this topic? Send feedback!


TADIBSecurity.AddUser Method

TADIBSecurity.AddUser Method
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace public See Also Send Feedback

Adds a new user to FB/IB security database.

Group

public

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, public, See Also
Description

Use the AddUser method to add a new user to the FB/IB security database. To add a user an application must specifiy AUserName and APassword properties. Other AXxxx properties are optional.

Syntax
procedure AddUser;
See Also

ModifyUser, DeleteUser

What do you think about this topic? Send feedback!


TADIBSecurity.DeleteUser Method

TADIBSecurity.DeleteUser Method
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace public See Also Send Feedback

Deletes an existing user from FB/IB security database.

Group

public

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, public, See Also
Description

Use the DeleteUser method to delete an existing user from FB/IB security database. To delete a user an application must specifiy AUserName.

Syntax
procedure DeleteUser;
See Also

AddUser, ModifyUser

What do you think about this topic? Send feedback!


TADIBSecurity.DisplayUser Method

TADIBSecurity.DisplayUser Method
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace public See Also Send Feedback

Fetches an existing user properties from FB/IB security database.

Group

public

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, public, See Also
Description

Use the DisplayUser method to fetch an existing user properties from FB/IB security database. To describe a user an application must specifiy AUserName. After the DisplayUser call the application may check the AXxxx properties for the user properties.

Syntax
procedure DisplayUser;
See Also

DisplayUsers

What do you think about this topic? Send feedback!


TADIBSecurity.DisplayUsers Method

TADIBSecurity.DisplayUsers Method
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace public See Also Send Feedback

Fetches all user list from FB/IB security database.

Group

public

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, public, See Also
Description

Use the DisplayUsers method to fetch all existing users list from the FB/IB security database. No additional properties should be specified.

The list of the existing properties will be stored in the Users table.

Syntax
procedure DisplayUsers;
See Also

DisplayUser

What do you think about this topic? Send feedback!


TADIBSecurity.ModifyUser Method

TADIBSecurity.ModifyUser Method
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace Example public See Also Send Feedback

Modifies an existing user in FB/IB security database.

Group

public

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, Example, public, See Also
Description

Use the ModifyUser method to modify an existing user in the FB/IB security database. To modify a user an application must specify AUserName property. Other AXxxx properties are optional. The user name cannot be changed.

Syntax
procedure ModifyUser;
See Also

List here...

Example
What do you think about this topic? Send feedback!


published

published
TADIBSecurity Class Legend Properties Send Feedback

The published members of the TADIBSecurity class are listed here.

Class

TADIBSecurity Class

Properties
Property | Description
AFirstName | A person first name.
AGroupID | A person group ID.
AGroupName | A person group name.
ALastName | A person last name.
AMiddleName | A person middle name.
APassword | A person password.
ARoleName | A person role name.
AUserID | A person ID.
AUserName | A person SQL user name.
Modified | A list of modified user attributes.
Links
TADIBSecurity Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIBSecurity.AFirstName Property

TADIBSecurity.AFirstName Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A person first name.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

Use the AFirstName property to specify an optional first name of the person identified by AUserName.

Syntax
property AFirstName: String;
What do you think about this topic? Send feedback!


TADIBSecurity.AGroupID Property

TADIBSecurity.AGroupID Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A person group ID.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

Use the AGroupID property to specify an optional grop ID of the person identified by AUserName.

Syntax
property AGroupID: Integer;
What do you think about this topic? Send feedback!


TADIBSecurity.AGroupName Property

TADIBSecurity.AGroupName Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A person group name.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

Use the AGroupName property to specify an optional group name of the person identified by AUserName.

Syntax
property AGroupName: String;
What do you think about this topic? Send feedback!


TADIBSecurity.ALastName Property

TADIBSecurity.ALastName Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A person last name.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

Use the ALastName property to specify an optional last name of the person identified by AUserName.

Syntax
property ALastName: String;
What do you think about this topic? Send feedback!


TADIBSecurity.AMiddleName Property

TADIBSecurity.AMiddleName Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A person middle name.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

Use the AMiddleName property to specify an optional middle name of the person identified by AUserName.

Syntax
property AMiddleName: String;
What do you think about this topic? Send feedback!


TADIBSecurity.APassword Property

TADIBSecurity.APassword Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A person password.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

Use the APassword property to specify an password of the person identified by AUserName.

Syntax
property APassword: String;
What do you think about this topic? Send feedback!


TADIBSecurity.ARoleName Property

TADIBSecurity.ARoleName Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A person role name.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

Use the ARoleName property to specify an optional SQL role name of the person identified by AUserName.

Syntax
property ARoleName: String;
What do you think about this topic? Send feedback!


TADIBSecurity.AUserID Property

TADIBSecurity.AUserID Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A person ID.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

Use the AUserID property to specify an optional user ID of the person identified by AUserName.

Syntax
property AUserID: Integer;
What do you think about this topic? Send feedback!


TADIBSecurity.AUserName Property

TADIBSecurity.AUserName Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A person SQL user name.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

Use the AUserName property to specify a SQL user name to create / modify / delete / retrieve information.

Syntax
property AUserName: String;
What do you think about this topic? Send feedback!


TADIBSecurity.Modified Property

TADIBSecurity.Modified Property
TADIBSecurity Class TADIBSecurity Members uADPhysIB Namespace published Send Feedback

A list of modified user attributes.

Group

published

Links
TADIBSecurity Class, TADIBSecurity Members, uADPhysIB Namespace, published
Description

The Modified property is automatically updated, when an application is updating the AXxxx properties. The AddUser and ModifyUsermethods will use just AXxxx property values, which have corresponding flags in the Modified property value.

Syntax
property Modified: TIBSecurityValues;
What do you think about this topic? Send feedback!


TADIBService Class

TADIBService Class
published TADIBService Members Classes Send Feedback

The base class for all FB/IB service classes.

Group

Classes

Class Hierarchy
  uADPhysIB_TADIBServiceuADPhysIB_TADIBService
File

uADPhysIB

Links
published, TADIBService Members, Classes
Description

The TADIBService class is used as a base class for all FB/IB service classes and should not be used directly. The class contains the common properties, like the DriverLink, Host, Protocol, UserName and Password.

Syntax
TADIBService = class(TADPhysDriverService);
What do you think about this topic? Send feedback!


TADIBService Members

TADIBService Members
Events TADIBService Class Legend Properties Send Feedback

The following tables list the members exposed by TADIBService.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.
Class

TADIBService Class

Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADIBService Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
Events TADIBService Class Legend Properties Send Feedback

The published members of the TADIBService class are listed here.

Events
Event | Description
OnProgress | Specifies the event handler allowing to handle the DB server feedback.
Class

TADIBService Class

Properties
Property | Description
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADIBService Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIBService.DriverLink Property

TADIBService.DriverLink Property
TADIBService Class TADIBService Members uADPhysIB Namespace published Send Feedback

Specifies the DriverLink.

Group

published

Links
TADIBService Class, TADIBService Members, uADPhysIB Namespace, published
Description

Use the DriverLink property to specify the FB/IB driver link. This property must be specified for any service operation.

Syntax
property DriverLink: TADPhysIBDriverLink;
What do you think about this topic? Send feedback!


TADIBService.Host Property

TADIBService.Host Property
TADIBService Class TADIBService Members uADPhysIB Namespace published See Also Send Feedback

Specifies the host name with the DB server.

Group

published

Links
TADIBService Class, TADIBService Members, uADPhysIB Namespace, published, See Also
Description

Use the Host property to specify the host name where the DB server is running. This property must be specified for any service operation.

Syntax
property Host: String;
See Also

Protocol

What do you think about this topic? Send feedback!


TADIBService.OnProgress Event

TADIBService.OnProgress Event
TADIBService Class TADIBService Members uADPhysIB Namespace Example published Send Feedback

Specifies the event handler allowing to handle the DB server feedback.

Group

published

Links
TADIBService Class, TADIBService Members, uADPhysIB Namespace, Example, published
Description

Use the OnProgress event handler to handle the DB server feedback, produced by the different services.

Additionally is required to set TADIBBackup.Verbose or TADIBRestore.Verbose to True.

Syntax
property OnProgress: TADPhysServiceProgressEvent;
Example
ADIBBackup1.DriverLink := ADPhysIBDriverLink1;
// set host, database, etc properties
ADIBBackup1.Verbose := True;
ADIBBackup1.OnProgress := Form1Progress;

procedure TForm1.Form1Progress(ASender: TADPhysDriverService; const AMessage: String);
begin
  Memo1.Lines.Add(AMessage);
  Application.ProcessMessages;
end;
What do you think about this topic? Send feedback!


TADIBService.Password Property

TADIBService.Password Property
TADIBService Class TADIBService Members uADPhysIB Namespace published See Also Send Feedback

Specifies the SQL user password to connect to the DB server.

Group

published

Links
TADIBService Class, TADIBService Members, uADPhysIB Namespace, published, See Also
Description

Use the Password property to specify the SQL user password to connect to the DB server. This property must be specified for any service operation.

Syntax
property Password: String;
See Also

UserName, SqlRoleName

What do you think about this topic? Send feedback!


TADIBService.Protocol Property

TADIBService.Protocol Property
TADIBService Class TADIBService Members uADPhysIB Namespace published See Also Send Feedback

Specifies the protocol used to connect to the DB server.

Group

published

Links
TADIBService Class, TADIBService Members, uADPhysIB Namespace, published, See Also
Description

Use the Protocol property to specify the network protocol used to connect to the DB server.

Syntax
property Protocol: TADIBProtocol;
See Also

Host

What do you think about this topic? Send feedback!


TADIBService.QueryTimeout Property

TADIBService.QueryTimeout Property
TADIBService Class TADIBService Members uADPhysIB Namespace Example published See Also Send Feedback

Add a short summary here...

Group

published

Links
TADIBService Class, TADIBService Members, uADPhysIB Namespace, Example, published, See Also
Description

Add a description here...

Syntax
property QueryTimeout: LongWord;
See Also

List here...

Example
What do you think about this topic? Send feedback!


TADIBService.SqlRoleName Property

TADIBService.SqlRoleName Property
TADIBService Class TADIBService Members uADPhysIB Namespace published See Also Send Feedback

Specifies the SQL role name to connect to the DB server.

Group

published

Links
TADIBService Class, TADIBService Members, uADPhysIB Namespace, published, See Also
Description

Use the SqlRoleName property to specify the SQL role name to connect to the DB server.

Syntax
property SqlRoleName: String;
See Also

UserName, Password

What do you think about this topic? Send feedback!


TADIBService.UserName Property

TADIBService.UserName Property
TADIBService Class TADIBService Members uADPhysIB Namespace published See Also Send Feedback

Specifies the SQL user name to connect to the DB server.

Group

published

Links
TADIBService Class, TADIBService Members, uADPhysIB Namespace, published, See Also
Description

Use the UserName property to specify the SQL user name to connect to the DB server. This property must be specified for any service operation.

Syntax
property UserName: String;
See Also

Password, SqlRoleName

What do you think about this topic? Send feedback!


TADIBTrace Class

TADIBTrace Class
public published TADIBTrace Members Example Classes Send Feedback

The class implementing Firebird database trace service.

Group

Classes

Class Hierarchy
  uADPhysIB_TADIBTraceuADPhysIB_TADIBTraceuADPhysIB_TADIBTrace
File

uADPhysIB

Links
public, published, TADIBTrace Members, Example, Classes
Description

Use the TADIBTrace component to add a DBMS trace capabilities to an application.

To manage a trace an application should:

  • specify DriverLink, UserName, Password, Host;
  • optionally specify SessionName / SessionID;
  • call Start / Stop / etc method.

For more details check [image] this article.

Syntax
TADIBTrace = class(TADIBService);
Example

Start trace:

ADIBTrace1.DriverLink := ADPhysIBDriverLink1;

ADIBTrace1.UserName := 'sysdba';
ADIBTrace1.Password := 'masterkey';
ADIBTrace1.Host := 'db_srv_host';
ADIBTrace1.Protocol := ipTCPIP;

ADIBTrace1.SessionName := 'trace1';

ADIBTrace1.Start;
What do you think about this topic? Send feedback!


TADIBTrace Members

TADIBTrace Members
Events TADIBTrace Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADIBTrace.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.
Class

TADIBTrace Class

Methods
Method | Description
List | Produces a list of trace sessions.
Resume | Resumes a trace session.
Start | Starts new trace session.
Stop | Stops a trace session.
Suspend | Suspends a trace session.
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Config | Specifies the trace session configuration.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SessionID | The trace session ID.
SessionName | The trace session name.
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADIBTrace Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADIBTrace Class Legend Methods Send Feedback

The public members of the TADIBTrace class are listed here.

Class

TADIBTrace Class

Methods
Method | Description
List | Produces a list of trace sessions.
Resume | Resumes a trace session.
Start | Starts new trace session.
Stop | Stops a trace session.
Suspend | Suspends a trace session.
Links
TADIBTrace Class, Legend, Methods
What do you think about this topic? Send feedback!


TADIBTrace.List Method

TADIBTrace.List Method
TADIBTrace Class TADIBTrace Members uADPhysIB Namespace public See Also Send Feedback

Produces a list of trace sessions.

Group

public

Links
TADIBTrace Class, TADIBTrace Members, uADPhysIB Namespace, public, See Also
Description

The the List method to get a list of all active trace session on Firebird server.

To receive the list an application should use an OnProgress event handler.

Syntax
procedure List;
See Also

OnProgress

What do you think about this topic? Send feedback!


TADIBTrace.Resume Method

TADIBTrace.Resume Method
TADIBTrace Class TADIBTrace Members uADPhysIB Namespace public See Also Send Feedback

Resumes a trace session.

Group

public

Links
TADIBTrace Class, TADIBTrace Members, uADPhysIB Namespace, public, See Also
Description

Use the Resume method to resume a trace session specified by SessionID property and previously suspended by the Suspendmethod.

Syntax
procedure Resume;
See Also

Suspend, SessionID

What do you think about this topic? Send feedback!


TADIBTrace.Start Method

TADIBTrace.Start Method
TADIBTrace Class TADIBTrace Members uADPhysIB Namespace public See Also Send Feedback

Starts new trace session.

Group

public

Links
TADIBTrace Class, TADIBTrace Members, uADPhysIB Namespace, public, See Also
Description

Use the Start method to start a new trace session on Firebird server, identified by SessionName.

After successful call of this method the SessionID property will get a new session ID value. To process trace output an application should use an OnProgress event handler.

To stop the session, use the Stop method. To suspend it temporarily, use the Suspend method.

Syntax
procedure Start;
See Also

OnProgress, SessionName, SessionID, Stop, Suspend

What do you think about this topic? Send feedback!


TADIBTrace.Stop Method

TADIBTrace.Stop Method
TADIBTrace Class TADIBTrace Members uADPhysIB Namespace public See Also Send Feedback

Stops a trace session.

Group

public

Links
TADIBTrace Class, TADIBTrace Members, uADPhysIB Namespace, public, See Also
Description

Use the Stop method to permanently stop a trace session specified by SessionID property.

Syntax
procedure Stop;
See Also

Start, SessionID

What do you think about this topic? Send feedback!


TADIBTrace.Suspend Method

TADIBTrace.Suspend Method
TADIBTrace Class TADIBTrace Members uADPhysIB Namespace public See Also Send Feedback

Suspends a trace session.

Group

public

Links
TADIBTrace Class, TADIBTrace Members, uADPhysIB Namespace, public, See Also
Description

Use the Suspend method to temporarily suspend a trace session, specified by SessionID property.

Syntax
procedure Suspend;
See Also

SessionID, Resume

What do you think about this topic? Send feedback!


published

published
TADIBTrace Class Legend Properties Send Feedback

The published members of the TADIBTrace class are listed here.

Class

TADIBTrace Class

Properties
Property | Description
Config | Specifies the trace session configuration.
SessionID | The trace session ID.
SessionName | The trace session name.
Links
TADIBTrace Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIBTrace.Config Property

TADIBTrace.Config Property
TADIBTrace Class TADIBTrace Members uADPhysIB Namespace published Send Feedback

Specifies the trace session configuration.

Group

published

Links
TADIBTrace Class, TADIBTrace Members, uADPhysIB Namespace, published
Description

Use the Config property to specify the trace session configuration. A template file named fbtrace.conf is provided in Firebird's root directory as a guide to the contents of this string.

Syntax
property Config: TStrings;
What do you think about this topic? Send feedback!


TADIBTrace.SessionID Property

TADIBTrace.SessionID Property
TADIBTrace Class TADIBTrace Members uADPhysIB Namespace published See Also Send Feedback

The trace session ID.

Group

published

Links
TADIBTrace Class, TADIBTrace Members, uADPhysIB Namespace, published, See Also
Description

Use the SessionID to specify a trace session ID, which will be used by the Resume, Stop, Suspend methods to identify a trace session. After calling the Start method the SessionID property will be filled automatically by the new trace session ID value.

Syntax
property SessionID: Integer;
See Also

SessionName, Resume, Stop, Suspend

What do you think about this topic? Send feedback!


TADIBTrace.SessionName Property

TADIBTrace.SessionName Property
TADIBTrace Class TADIBTrace Members uADPhysIB Namespace published See Also Send Feedback

The trace session name.

Group

published

Links
TADIBTrace Class, TADIBTrace Members, uADPhysIB Namespace, published, See Also
Description

Use the SessionName property to specify the trace session name used by the Start method call only. After calling the Startmethod, the SessionID method will receive corresponding value.

Syntax
property SessionName: String;
See Also

Start, SessionID

What do you think about this topic? Send feedback!


TADIBValidate Class

TADIBValidate Class
public published TADIBValidate Members Example Classes Send Feedback

The class implementing FB/IB database validate and repair service.

Group

Classes

Class Hierarchy
  uADPhysIB_TADIBValidateuADPhysIB_TADIBValidateuADPhysIB_TADIBValidate
File

uADPhysIB

Links
public, published, TADIBValidate Members, Example, Classes
Description

Use the TADIBValidate component to add a database validate and repair capability to an application. This is a programmatic method to invoke the gfix tool as a thread in the DB server process.

To validate and or repair a database an application should:

  • specify DriverLink, UserName, Password, Host;
  • specify Database - a database file to validate;
  • call Analyze, CheckOnly, Repair or Sweep method.

To produce a DB validate or repair log an application should use OnProgress event.

Syntax
TADIBValidate = class(TADIBService);
Example
ADIBValidate1.DriverLink := ADPhysIBDriverLink1;

ADIBValidate1.UserName := 'sysdba';
ADIBValidate1.Password := 'masterkey';
ADIBValidate1.Host := 'db_srv_host';
ADIBValidate1.Protocol := ipTCPIP;

ADIBValidate1.Database := 'e:\ib\addemo.fdb';

ADIBValidate1.Repair;
What do you think about this topic? Send feedback!


TADIBValidate Members

TADIBValidate Members
Events TADIBValidate Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADIBValidate.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.
Class

TADIBValidate Class

Methods
Method | Description
Analyze | Starts the statistics gathering task.
CheckOnly | Starts the read-only validate database task.
Repair | Starts the repair task.
Sweep | Starts the sweep task.
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to validate / repair.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Options | Specifies validate / repair options.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Links
Events, TADIBValidate Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADIBValidate Class Legend Methods Send Feedback

The public members of the TADIBValidate class are listed here.

Class

TADIBValidate Class

Methods
Method | Description
Analyze | Starts the statistics gathering task.
CheckOnly | Starts the read-only validate database task.
Repair | Starts the repair task.
Sweep | Starts the sweep task.
Links
TADIBValidate Class, Legend, Methods
What do you think about this topic? Send feedback!


TADIBValidate.Analyze Method

TADIBValidate.Analyze Method
TADIBValidate Class TADIBValidate Members uADPhysIB Namespace public See Also Send Feedback

Starts the statistics gathering task.

Group

public

Links
TADIBValidate Class, TADIBValidate Members, uADPhysIB Namespace, public, See Also
Parameters
Parameters | Description
const ATable: String = '' | A database table name.
const AIndex: String = '' | A database index name.
Description

Use the Analyze method to start the database statistics gathering task.

To perform a statistics gathering task an application must specify the connection parameters and Database. This is a programmatic method to invoke the SET STATISTICS INDEX command. Depending on the specified arguments the method modes are:

  • AIndex only - analyzes the specified index.
  • ATable only - analyzes all indexes for the specified table.
  • None specified - analyzes all indexes for all tables in the database.
Syntax
procedure Analyze(const ATable: String = ''; const AIndex: String = '');
See Also

CheckOnly, Sweep

What do you think about this topic? Send feedback!


TADIBValidate.CheckOnly Method

TADIBValidate.CheckOnly Method
TADIBValidate Class TADIBValidate Members uADPhysIB Namespace public See Also Send Feedback

Starts the read-only validate database task.

Group

public

Links
TADIBValidate Class, TADIBValidate Members, uADPhysIB Namespace, public, See Also
Description

Use the CheckOnly method to start the read-only validate database task on the DB server host using Service Manager.

To perform a validation task an application must specify the connection parameters and Database. This is a programmatic method to invoke the gfix -no_update tool as a thread in the DB server process.

Syntax
procedure CheckOnly;
See Also

Repair, Sweep

What do you think about this topic? Send feedback!


TADIBValidate.Repair Method

TADIBValidate.Repair Method
TADIBValidate Class TADIBValidate Members uADPhysIB Namespace public See Also Send Feedback

Starts the repair task.

Group

public

Links
TADIBValidate Class, TADIBValidate Members, uADPhysIB Namespace, public, See Also
Description

Use the Repair method to start the validate and repair database task on the DB server host using Service Manager.

To perform a repair task an application must specify the connection parameters and Database. This is a programmatic method to invoke the gfix tool as a thread in the DB server process.

Syntax
procedure Repair;
See Also

CheckOnly, Sweep

What do you think about this topic? Send feedback!


TADIBValidate.Sweep Method

TADIBValidate.Sweep Method
TADIBValidate Class TADIBValidate Members uADPhysIB Namespace public See Also Send Feedback

Starts the sweep task.

Group

public

Links
TADIBValidate Class, TADIBValidate Members, uADPhysIB Namespace, public, See Also
Description

Use the Sweep method to start the database sweep task on the DB server host using Service Manager.

To perform a sweep task an application must specify the connection parameters and Database. This is a programmatic method to invoke the gfix -sweep tool as a thread in the DB server process.

Syntax
procedure Sweep;
See Also

CheckOnly, Repair

What do you think about this topic? Send feedback!


published

published
TADIBValidate Class Legend Properties Send Feedback

The published members of the TADIBValidate class are listed here.

Class

TADIBValidate Class

Properties
Property | Description
Database | Specifies a database file to validate / repair.
Options | Specifies validate / repair options.
Links
TADIBValidate Class, Legend, Properties
What do you think about this topic? Send feedback!


TADIBValidate.Database Property

TADIBValidate.Database Property
TADIBValidate Class TADIBValidate Members uADPhysIB Namespace published Send Feedback

Specifies a database file to validate / repair.

Group

published

Links
TADIBValidate Class, TADIBValidate Members, uADPhysIB Namespace, published
Description

Use the Database property to specify a path of the primary file of the database to validate or repair. The path is relative to a DB server.

Syntax
property Database: String;
What do you think about this topic? Send feedback!


TADIBValidate.Options Property

TADIBValidate.Options Property
TADIBValidate Class TADIBValidate Members uADPhysIB Namespace published See Also Send Feedback

Specifies validate / repair options.

Group

published

Links
TADIBValidate Class, TADIBValidate Members, uADPhysIB Namespace, published, See Also
Description

Use the Options property to specify additional options controlling the validate or repair task. The default value is empty set. The Options are used only by CheckOnly and Repair methods.

Option | Description
roValidateFull | Check record and page structures, releasing unassigned record fragments. Corresponds to gfix -full.
roValidatePages | Locate and release pages that are allocated but unassigned to any data structures. Corresponds to gfix -validate.
roMendRecords | Mark corrupted records as unavailable, so subsequent operations skip them. Corresponds to gfix -mend.
roIgnoreChecksum | Ignore all checksum errors. Corresponds to gfix -ignore.
roKillShadows | Remove references to unavailable shadow files. Corresponds to gfix -kill.
Syntax
property Options: TIBRepairOptions;
See Also

CheckOnly, Repair

What do you think about this topic? Send feedback!


TADPhysIBDriverLink Class

TADPhysIBDriverLink Class
Example Classes See Also Send Feedback

Use the TADPhysIBDriverLink component to link the FB/IB driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysIB_TADPhysIBDriverLinkuADPhysIB_TADPhysIBDriverLink
File

uADPhysIB

Links
Example, Classes, See Also
Description

Use the TADPhysIBDriverLink component to link the FB/IB driver to an application. In general it is enough to only include uADPhysIB unit into your application uses clause.

The TADPhysIBDriverLink component may be used to specify:

  • VendorHome - the Firebird / Interbase installation root folder;
  • VendorLib - the name and optional path to the Firebird / Interbase client library.

All properties have default values appropriate for most case. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysIBDriverLink = class(TADPhysDriverLink);
See Also

Configuring Drivers, Connect to Interbase or Firebird

Example
ADPhysIBDriverLink1.VendorLib := 'c:\fb\fb25\bin\fbclient.dll';
What do you think about this topic? Send feedback!


uADPhysManager Namespace

uADPhysManager Namespace
Classes FireDAC Legend Topics Send Feedback

Contains FireDAC driver and services base classes.

Classes
Class | Description
TADPhysDriverLink | The TADPhysDriverLink component is a base class for all driver link components.
TADPhysDriverService | The TADPhysDriverService component is a base class for all driver service components.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, Topics
Description

The uADPhysManager unit contains:

  • FireDAC driver base implementation classes;
  • TADPhysDriverLink - the base class for FireDAC driver link components;
  • TADPhysDriverService - the base class for FireDAC driver service components.
What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysManager Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysDriverLink | The TADPhysDriverLink component is a base class for all driver link components.
TADPhysDriverService | The TADPhysDriverService component is a base class for all driver service components.
Namespace

uADPhysManager Namespace

Links
Classes, uADPhysManager Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysDriverLink Class

TADPhysDriverLink Class
public published TADPhysDriverLink Members Classes See Also Send Feedback

The TADPhysDriverLink component is a base class for all driver link components.

Group

Classes

Class Hierarchy
  uADPhysManager_TADPhysDriverLink
File

uADPhysManager

Links
public, published, TADPhysDriverLink Members, Classes, See Also
Description

The TADPhysDriverLink component is a base class for all driver link components. It implements the ability:

  • to link an FireDAC DBMS driver into an application.
  • to configure an FireDAC DBMS driver at runtime, using the VendorHome and VendorLib properties and Release method.
  • to create an FireDAC virtual driver at runtime, using the DriverID, BaseDriverID and ActualDriverID properties.
  • to give access to an FireDAC driver API and live cycle, using DriverIntf, DriverState, OnDriverCreated and OnDriverDestroying properties.
  • to manage the FireDAC DBMS specific services, using Services and ServicesCount properties.

An application should not use the TADPhysDriverLink component directly. But it may use one of the many descendants, for example, TADPhysOracleDriverLink or TADPhysSQLiteDriverLink.

To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysDriverLink = class(TADComponent);
See Also

Configuring Drivers, Database Connectivity

What do you think about this topic? Send feedback!


TADPhysDriverLink Members

TADPhysDriverLink Members
Events TADPhysDriverLink Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADPhysDriverLink.

Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.
Class

TADPhysDriverLink Class

Methods
Method | Description
Release | Releases the driver resources, allowing to initialize the driver with different parameters.
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.
Links
Events, TADPhysDriverLink Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADPhysDriverLink Class Legend Methods Properties Send Feedback

The public members of the TADPhysDriverLink class are listed here.

Class

TADPhysDriverLink Class

Methods
Method | Description
Release | Releases the driver resources, allowing to initialize the driver with different parameters.
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
Links
TADPhysDriverLink Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADPhysDriverLink.ActualDriverID Property

TADPhysDriverLink.ActualDriverID Property
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace public See Also Send Feedback

The driver link actual driver ID.

Group

public

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, public, See Also
Description

Use the ActualDriverID property to get an ID derived from current BaseDriverID and DriverID property values.

Syntax
property ActualDriverID: String;
See Also

BaseDriverID, DriverID

What do you think about this topic? Send feedback!


TADPhysDriverLink.DriverIntf Property

TADPhysDriverLink.DriverIntf Property
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace public See Also Send Feedback

The driver Phys interface reference.

Group

public

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, public, See Also
Description

Use the DriverIntf property to get the driver IADPhysDriver interface reference.

Syntax
property DriverIntf: IADPhysDriver;
See Also

DriverState

What do you think about this topic? Send feedback!


TADPhysDriverLink.DriverState Property

TADPhysDriverLink.DriverState Property
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace public See Also Send Feedback

The driver state.

Group

public

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, public, See Also
Description

Use the DriverState property to get the current driver state.

Syntax
property DriverState: TADPhysDriverState;
See Also

DriverIntf

What do you think about this topic? Send feedback!


TADPhysDriverLink.Services Property

TADPhysDriverLink.Services Property
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace public See Also Send Feedback

The services attached to this driver link.

Group

public

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, public, See Also
Description

Use the Services property to get access to the service components attached to this driver link.

Syntax
property Services [AIndex: Integer]: TADPhysDriverService;
See Also

TADPhysDriverService

What do you think about this topic? Send feedback!


TADPhysDriverLink.ServicesCount Property

TADPhysDriverLink.ServicesCount Property
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace public See Also Send Feedback

The number of services attached to this driver link.

Group

public

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, public, See Also
Description

Use the ServicesCount property to get the number of service components attached to this driver link.

Syntax
property ServicesCount: Integer;
See Also

Services

What do you think about this topic? Send feedback!


TADPhysDriverLink.Release Method

TADPhysDriverLink.Release Method
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace Example public See Also Send Feedback

Releases the driver resources, allowing to initialize the driver with different parameters.

Group

public

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, Example, public, See Also
Description

Use the Release method to release all driver resources and unload the DBMS client library.

The next connection established after the Release call will initialize driver and load the DBMS client library using the current driver parameters. So, after changing VendorHome and VendorLib property values, call Release method to force DBMS client reloading.

Before calling Release method an application must close all connections made through this driver. Otherwise an exception will be raised. When there were no connections made through this driver, then application may avoid Release call, because driver is not initialized and DBMS client library is not loaded.

Syntax
procedure Release;
See Also

VendorHome, VendorLib

Example
ADConnection1.Close;
...
ADConnectionN.Close;

ADPhysIBDriverLink.VendorLib := 'c:\fbclient.dll';
ADPhysIBDriverLink.Release;

ADConnection1.Open;
...
ADConnectionN.Open;
What do you think about this topic? Send feedback!


published

published
Events TADPhysDriverLink Class Legend Properties Send Feedback

The published members of the TADPhysDriverLink class are listed here.

Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.
Class

TADPhysDriverLink Class

Properties
Property | Description
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.
Links
Events, TADPhysDriverLink Class, Legend, Properties
What do you think about this topic? Send feedback!


TADPhysDriverLink.BaseDriverID Property

TADPhysDriverLink.BaseDriverID Property
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace published See Also Send Feedback

The base driver ID.

Group

published

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, published, See Also
Description

Use the BaseDriverID property to get a base driver ID. The base driver ID is constant and represents the FireDAC DBMS driver implementation.

Syntax
property BaseDriverID: String;
See Also

Configuring Drivers, DriverID

What do you think about this topic? Send feedback!


TADPhysDriverLink.DriverID Property

TADPhysDriverLink.DriverID Property
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace Example published See Also Send Feedback

Specifies the virtual driver ID.

Group

published

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, Example, published, See Also
Description

Use the DriverID to specify a virtual driver ID. If DriverID is not specified, then any changes to a driver link properties will be applied to a base driver. Otherwise the virtual driver will be created and configured.

The DriverID must be unique across an application.

Syntax
property DriverID: String;
See Also

Configuring Drivers, BaseDriverID

Example
ADPhysIBDriverLink1.DriverID := 'FB25';
ADPhysIBDriverLink1.VendorLib := 'c:\fb25_64\fbclient.dll';

ADConnection1.Params.Clear;
ADConnection1.Params.Add('DriverID=FB25');
ADConnection1.Params.Add('Database=c:\addemo.fdb');
ADConnection1.Params.Add('Server=127.0.0.1');
ADConnection1.Params.Add('Protocol=TCPIP');
ADConnection1.Connected := True;
What do you think about this topic? Send feedback!


TADPhysDriverLink.OnDriverCreated Event

TADPhysDriverLink.OnDriverCreated Event
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace published See Also Send Feedback

The event firing after the driver has been created and the CLI library was loaded.

Group

published

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, published, See Also
Description

Use the OnDriverCreate event handler to perform some actions after an FireDAC DBMS driver has been created and a DBMS CLI library was loaded. In this event the DriverIntf property value is accessible.

Syntax
property OnDriverCreated: TNotifyEvent;
See Also

OnDriverDestroying

What do you think about this topic? Send feedback!


TADPhysDriverLink.OnDriverDestroying Event

TADPhysDriverLink.OnDriverDestroying Event
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace published See Also Send Feedback

The event firing before the driver will be destroyed and the CLI library will be unloaded.

Group

published

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, published, See Also
Description

Use the OnDriverDestroying event handler to perform some actions before an FireDAC DBMS driver will be destroyed and a DBMS CLI library will be unloaded. In this event the DriverIntf property value is still accessible.

Syntax
property OnDriverDestroying: TNotifyEvent;
See Also

OnDriverCreated

What do you think about this topic? Send feedback!


TADPhysDriverLink.VendorHome Property

TADPhysDriverLink.VendorHome Property
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace Example published See Also Send Feedback

The CLI library installation folder.

Group

published

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, Example, published, See Also
Description

Use the VendorHome to specify the CLI library installation folder. Depending on a DBMS, that may be:

  • Installation Home Name for Oracle;
  • Installation root folder for the other DBMS's. The CLI library will be loaded from Bin sub-folder. For example for MySQL the VendorHome may be c:\mysql.

A VendorHome change will have an effect only before first connection through this driver or use the Release method.

The property value is platform independent and will be used for all platforms, including Win32, Win64, MacOS32, MacOS64, Linux32 and Linux64. To specify multiple platform specific values use driver configuration file.

Syntax
property VendorHome: String;
See Also

Configuring Drivers, VendorLib, Release

Example
ADConnection1.Close;
ADPhysOracleDriverLink1.Release;
ADPhysOracleDriverLink1.VendorHome := 'OracleXE';
ADConnection1.Open;
What do you think about this topic? Send feedback!


TADPhysDriverLink.VendorLib Property

TADPhysDriverLink.VendorLib Property
TADPhysDriverLink Class TADPhysDriverLink Members uADPhysManager Namespace Example published See Also Send Feedback

The CLI library path and name.

Group

published

Links
TADPhysDriverLink Class, TADPhysDriverLink Members, uADPhysManager Namespace, Example, published, See Also
Description

Use the VendorLib to specify the CLI library name and optionally path. If VendorLib and VendorHome are both specified, then VendorLib will be appended to VendorHome.

A VendorLib change will have an effect only before first connection through this driver or use the Release method.

The property value is platform independent and will be used for all platforms, including Win32, Win64, MacOS32, MacOS64, Linux32 and Linux64. To specify multiple platform specific values use driver configuration file.

Syntax
property VendorLib: String;
See Also

Configuring Drivers, VendorHome, Release

Example
ADConnection1.Close;
ADPhysIBDriverLink1.Release;
ADPhysIBDriverLink1.VendorLib := 'c:\fb25_64\fbclient.dll';
ADConnection1.Open;
What do you think about this topic? Send feedback!


TADPhysDriverService Class

TADPhysDriverService Class
public published TADPhysDriverService Members Classes Send Feedback

The TADPhysDriverService component is a base class for all driver service components.

Group

Classes

Class Hierarchy
  uADPhysManager_TADPhysDriverService
File

uADPhysManager

Links
public, published, TADPhysDriverService Members, Classes
Description

The TADPhysDriverService component is a base class for all driver service components. It implements the ability to link a service to a driver link.

An application should not use the TADPhysDriverService component directly.

Syntax
TADPhysDriverService = class(TADComponent, IADStanErrorHandler);
What do you think about this topic? Send feedback!


TADPhysDriverService Members

TADPhysDriverService Members
Events TADPhysDriverService Class Legend Properties Send Feedback

The following tables list the members exposed by TADPhysDriverService.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADPhysDriverService Class

Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Links
Events, TADPhysDriverService Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADPhysDriverService Class Legend Properties Send Feedback

The public members of the TADPhysDriverService class are listed here.

Class

TADPhysDriverService Class

Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Links
TADPhysDriverService Class, Legend, Properties
What do you think about this topic? Send feedback!


TADPhysDriverService.CliObj Property

TADPhysDriverService.CliObj Property
TADPhysDriverService Class TADPhysDriverService Members uADPhysManager Namespace public See Also Send Feedback

Returns a reference to the driver CLI object.

Group

public

Links
TADPhysDriverService Class, TADPhysDriverService Members, uADPhysManager Namespace, public, See Also
Description

Use CliObj property to get the reference to the driver CLI object.

Syntax
property CliObj: TObject;
See Also

DriverLink

What do you think about this topic? Send feedback!


published

published
Events TADPhysDriverService Class Legend Send Feedback

The published members of the TADPhysDriverService class are listed here.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADPhysDriverService Class

Links
Events, TADPhysDriverService Class, Legend
What do you think about this topic? Send feedback!


TADPhysDriverService.AfterExecute Event

TADPhysDriverService.AfterExecute Event
TADPhysDriverService Class TADPhysDriverService Members uADPhysManager Namespace published See Also Send Feedback

The event firing after the service action will be executed.

Group

published

Links
TADPhysDriverService Class, TADPhysDriverService Members, uADPhysManager Namespace, published, See Also
Description

Use the AfterExecute event handler to perform the actions after the service action is finished.

Syntax
property AfterExecute: TNotifyEvent;
See Also

BeforeExecute

What do you think about this topic? Send feedback!


TADPhysDriverService.BeforeExecute Event

TADPhysDriverService.BeforeExecute Event
TADPhysDriverService Class TADPhysDriverService Members uADPhysManager Namespace published See Also Send Feedback

The event firing before the service action will be executed.

Group

published

Links
TADPhysDriverService Class, TADPhysDriverService Members, uADPhysManager Namespace, published, See Also
Description

Use the BeforeExecute event handler to perform the actions before the service action will be executed.

Syntax
property BeforeExecute: TNotifyEvent;
See Also

AfterExecute

What do you think about this topic? Send feedback!


TADPhysDriverService.OnError Event

TADPhysDriverService.OnError Event
TADPhysDriverService Class TADPhysDriverService Members uADPhysManager Namespace published Send Feedback

The event firing in case an exception will be raised by a service.

Group

published

Links
TADPhysDriverService Class, TADPhysDriverService Members, uADPhysManager Namespace, published
Description

Use the OnError event handler to perform the actions when a service execution raising an exception

Syntax
property OnError: TADErrorEvent;
What do you think about this topic? Send feedback!


uADPhysMSAcc Namespace

uADPhysMSAcc Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains Microsoft Access driver and services components.

Classes
Class | Description
EMSAccessNativeException | Class representing a Microsoft Access driver exception.
TADMSAccessService | The class implementing Microsoft Access database create, drop, compact and repair services.
TADPhysMSAccessDriverLink | Use the TADPhysMSAccessDriverLink component to link the Microsoft Access driver to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysMSAcc unit contains:

  • Microsoft Access driver implementation;
  • TADPhysMSAccessDriverLink - component to link the driver and setup CLI library;
  • TADMSAccessService - database service component.
See Also

Configuring Drivers, Connect to Microsoft Access database

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysMSAcc Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
EMSAccessNativeException | Class representing a Microsoft Access driver exception.
TADMSAccessService | The class implementing Microsoft Access database create, drop, compact and repair services.
TADPhysMSAccessDriverLink | Use the TADPhysMSAccessDriverLink component to link the Microsoft Access driver to an application and setup it.
Namespace

uADPhysMSAcc Namespace

Links
Classes, uADPhysMSAcc Namespace, Legend
What do you think about this topic? Send feedback!


EMSAccessNativeException Class

EMSAccessNativeException Class
Example Classes See Also Send Feedback

Class representing a Microsoft Access driver exception.

Group

Classes

Class Hierarchy
  uADPhysMSAcc_EMSAccessNativeException
File

uADPhysMSAcc

Links
Example, Classes, See Also
Description

The FireDAC Microsoft Access driver raises exceptions of EMSAccessNativeException class. Use this class to handle driver specific errors.

Syntax
EMSAccessNativeException = class(EODBCNativeException);
See Also

EODBCNativeException, TADMSAccessService, Connect to Microsoft Access database

Example
try
  ADConnection1.Connected := True;
except
  on E: EMSAccessNativeException do
    // perform Access error specific actions
end;
What do you think about this topic? Send feedback!


TADMSAccessService Class

TADMSAccessService Class
public published TADMSAccessService Members Example Classes Send Feedback

The class implementing Microsoft Access database create, drop, compact and repair services.

Group

Classes

Class Hierarchy
  uADPhysMSAcc_TADMSAccessServiceuADPhysMSAcc_TADMSAccessServiceuADPhysMSAcc_TADMSAccessService
File

uADPhysMSAcc

Links
public, published, TADMSAccessService Members, Example, Classes
Description

Use the TADMSAccessService component to add a database create, drop, repair and compact capability to an application.

To validate and or repair a database an application should:

  • specify DriverLink;
  • specify Database - a database file to handle;
  • specify Password;
  • call CreateDB, Drop, Repair or Compact methods.

Read more about these features ( [image] there) and ( [image] here).

Syntax
TADMSAccessService = class(TADPhysODBCBaseService);
Example
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Repair;
What do you think about this topic? Send feedback!


TADMSAccessService Members

TADMSAccessService Members
Events TADMSAccessService Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADMSAccessService.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADMSAccessService Class

Methods
Method | Description
Compact | Compacts an Access database.
CreateDB | Creates a new Access database.
Drop | Drops an existing Access database.
Repair | Repairs an existing Access database.
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | A database file name.
DBVersion | The database format version.
DestDatabase | A destination database file name.
DriverLink | Specifies the DriverLink.
Encrypted | The database encryption mode.
Password | The database password.
ResetPassword | Whether or not to reset the database password.
SortOrder | The database sort order.
Links
Events, TADMSAccessService Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADMSAccessService Class Legend Methods Send Feedback

The public members of the TADMSAccessService class are listed here.

Class

TADMSAccessService Class

Methods
Method | Description
Compact | Compacts an Access database.
CreateDB | Creates a new Access database.
Drop | Drops an existing Access database.
Repair | Repairs an existing Access database.
Links
TADMSAccessService Class, Legend, Methods
What do you think about this topic? Send feedback!


TADMSAccessService.Compact Method

TADMSAccessService.Compact Method
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace Example 1 Example 2 Example 3 public See Also Send Feedback

Compacts an Access database.

Group

public

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, Example 1, Example 2, Example 3, public, See Also
Description

Use the Compact method to compact a database. To run Compact, an application must specify:

  • Database - the source database file name;
  • DestDatabase - the destination database file name. If it is not specified, then DestDatabase is equal to Database.

Optionally Encrypted, Password and SortOrder may be specified.

The file pointed by Database must be a valid .MDB file. DestDatabase can point to the same file as Database, in which case the file will be compacted into the same location. If DestDatabase names a different file than Database, the file named as the DestDatabase will be deleted at the time Compact is called. When the operation fails, then EMSAccessNativeException exception is raised.

Syntax
procedure Compact;
See Also

Database, DestDatabase, Encrypted, Password, SortOrder

Example 1
// Compact non-secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.DestDatabase := 'c:\test2.mdb';
ADMSAccessService1.Compact;
Example 2
// Compact secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.Compact;
Example 3
// Reset password of secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.ResetPassword := True;
ADMSAccessService1.Compact;
What do you think about this topic? Send feedback!


TADMSAccessService.CreateDB Method

TADMSAccessService.CreateDB Method
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace Example 1 Example 2 Example 3 public See Also Send Feedback

Creates a new Access database.

Group

public

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, Example 1, Example 2, Example 3, public, See Also
Description

Use the CreateDB method to create a new empty database. To run CreateDB, an application must specify Database - the source database file name. And optionally may be specified:

  • DBVersion - the database format version;
  • Password - the password to protect the database;
  • Encrypted - whether to encrypt the database;
  • SortOrder - the default database sort order.

The file pointed by Database must not exist at the time CreateDB is called. When the operation fails, then "Driver's ConfigDSN, ConfigDriver, or ConfigTranslator failed" exception is raised.

Syntax
procedure CreateDB;
See Also

Database, DBVersion, SortOrder

Example 1
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.DBVersion := avDefault;
ADMSAccessService1.CreateDB;
Example 2
// Create encrypted database
ADMSAccessService1.Database := 'c:\test.accdb';
ADMSAccessService1.DBVersion := avAccess2007;
ADMSAccessService1.Encrypted := True;
ADMSAccessService1.CreateDB;
Example 3
// Specify default sort order of database
ADMSAccessService1.Database := 'c:\test.accdb';
ADMSAccessService1.DBVersion := avAccess2007;
ADMSAccessService1.SortOrder := '0x00000409';
ADMSAccessService1.CreateDB;
What do you think about this topic? Send feedback!


TADMSAccessService.Drop Method

TADMSAccessService.Drop Method
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace public See Also Send Feedback

Drops an existing Access database.

Group

public

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, public, See Also
Description

Use the Drop method to drop an existing database. To run Drop, an application must specify Database - the database file name to drop. The database file must be not in use by an application or Microsoft Access.

Syntax
procedure Drop;
See Also

Database

What do you think about this topic? Send feedback!


TADMSAccessService.Repair Method

TADMSAccessService.Repair Method
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace public See Also Send Feedback

Repairs an existing Access database.

Group

public

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, public, See Also
Description

Use the Repair method to repair an existing database. To run Repair, an application must specify Database - the database file name to repair.

The file pointed by Database must be a valid .MDB file. For more information see Compact method.

Syntax
procedure Repair;
See Also

Database, Compact

What do you think about this topic? Send feedback!


published

published
TADMSAccessService Class Legend Properties Send Feedback

The published members of the TADMSAccessService class are listed here.

Class

TADMSAccessService Class

Properties
Property | Description
Database | A database file name.
DBVersion | The database format version.
DestDatabase | A destination database file name.
DriverLink | Specifies the DriverLink.
Encrypted | The database encryption mode.
Password | The database password.
ResetPassword | Whether or not to reset the database password.
SortOrder | The database sort order.
Links
TADMSAccessService Class, Legend, Properties
What do you think about this topic? Send feedback!


TADMSAccessService.Database Property

TADMSAccessService.Database Property
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace published See Also Send Feedback

A database file name.

Group

published

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, published, See Also
Description

Use Database property to specify the Microsoft Access database file name. The requested operation will be performed on this file. The file name may include $(<variable>) markers, where variable is a name of environment variable.

Syntax
property Database: String;
See Also

CreateDB, Drop, Compact, Repair

What do you think about this topic? Send feedback!


TADMSAccessService.DBVersion Property

TADMSAccessService.DBVersion Property
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace published See Also Send Feedback

The database format version.

Group

published

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, published, See Also
Description

Use DBVersion property to specify the database format version for the CreateDB, Compact and Repair methods:

Value | Description
avDefault | Use a default format for a Microsoft Access ODBC driver.
avAccess2 | Use Microsoft Access v 2 compatible format.
avAccess95 | Use Microsoft Access 95 compatible format.
avAccess97 | Use Microsoft Access 97 compatible format.
avAccess2000 | Use Microsoft Access 2000 compatible format.
avAccess2003 | Use Microsoft Access 2003 compatible format.
avAccess2007 | Use Microsoft Access 2003 compatible format*.

* Because of the current limitation the latest Microsoft.ACE.OLEDB.12.0 provider will be used for all operations but still the database of Microsoft Access 2003 format will be created.

Syntax
property DBVersion: TADMSAccessDBVersion;
See Also

CreateDB, Compact, Repair

What do you think about this topic? Send feedback!


TADMSAccessService.DestDatabase Property

TADMSAccessService.DestDatabase Property
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace published See Also Send Feedback

A destination database file name.

Group

published

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, published, See Also
Description

Use DestDatabase property to specify the destination database file name for Compact and Repair methods. The file name may include $(<variable>) markers, where variable is a name of environment variable.

Syntax
property DestDatabase: String;
See Also

Compact, Repair

What do you think about this topic? Send feedback!


TADMSAccessService.DriverLink Property

TADMSAccessService.DriverLink Property
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace published Send Feedback

Specifies the DriverLink.

Group

published

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, published
Description

Use DriverLink property to specify the driver link. This property must be specified for any service operation.

Syntax
property DriverLink: TADPhysMSAccessDriverLink;
What do you think about this topic? Send feedback!


TADMSAccessService.Encrypted Property

TADMSAccessService.Encrypted Property
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace published See Also Send Feedback

The database encryption mode.

Group

published

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, published, See Also
Description

Use Encrypted property to protect the database from prying eyes for CreateDB, Compact or Repair methods.

Syntax
property Encrypted: Boolean;
See Also

CreateDB, Compact, Repair

What do you think about this topic? Send feedback!


TADMSAccessService.Password Property

TADMSAccessService.Password Property
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace Example 1 Example 2 published See Also Send Feedback

The database password.

Group

published

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, Example 1, Example 2, published, See Also
Description

Use Password property to work with protected databases for CreateDB, Compact or Repair methods. This property indicates the password if the database is already secured or sets the password for the non-secured database after calling these methods.

Syntax
property Password: String;
See Also

CreateDB, Compact, Repair, ResetPassword

Example 1
// Create database and set password
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.CreateDB;
Example 2
// Set password for non-secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.Compact;
What do you think about this topic? Send feedback!


TADMSAccessService.ResetPassword Property

TADMSAccessService.ResetPassword Property
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace Example published See Also Send Feedback

Whether or not to reset the database password.

Group

published

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, Example, published, See Also
Description

Use ResetPassword property to reset the database password for Compact and Repair methods. The Password property value should be set to the current database password.

Syntax
property ResetPassword: Boolean;
See Also

Password, Compact, Repair

Example
// Reset password for secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.ResetPassword := True;
ADMSAccessService1.Compact;
What do you think about this topic? Send feedback!


TADMSAccessService.SortOrder Property

TADMSAccessService.SortOrder Property
TADMSAccessService Class TADMSAccessService Members uADPhysMSAcc Namespace Example published See Also Send Feedback

The database sort order.

Group

published

Links
TADMSAccessService Class, TADMSAccessService Members, uADPhysMSAcc Namespace, Example, published, See Also
Description

Use SortOrder property to specify the database sort order for CreateDB, Compact or Repair methods. The SortOrder value should be the one out of Locale Identifier values available ( [image] here).

Syntax
property SortOrder: String;
See Also

CreateDB, Compact, Repair

Example
// Set SortOrder to German Phone Book
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.SortOrder := '0x00010407';
ADMSAccessService1.CreateDB;
What do you think about this topic? Send feedback!


TADPhysMSAccessDriverLink Class

TADPhysMSAccessDriverLink Class
Example Classes See Also Send Feedback

Use the TADPhysMSAccessDriverLink component to link the Microsoft Access driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysMSAcc_TADPhysMSAccessDriverLinkuADPhysMSAcc_TADPhysMSAccessDriverLinkuADPhysMSAcc_TADPhysMSAccessDriverLink
File

uADPhysMSAcc

Links
Example, Classes, See Also
Description

Use the TADPhysMSAccessDriverLink component to link the Microsoft Access driver to an application. In general it is enough to only include uADPhysMSAcc unit into your application uses clause.

The TADPhysMSAccessDriverLink component may be used to specify:

  • ODBCDriver - Access ODBC driver name;
  • ODBCAdvanced - Access ODBC driver connection parameter common for all connections;
  • VendorLib - ODBC driver manager. By default it is odbc32.dll and for most cases should remain unchanged.

All properties have default values appropriate for most case. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysMSAccessDriverLink = class(TADPhysODBCBaseDriverLink);
See Also

Configuring Drivers, Connect to Microsoft Access database

Example
ADPhysMSAccessDriverLink1.ODBCAdvanced := 'IMPLICITCOMMITSYNC=NO';
ADPhysMSAccessDriverLink1.ODBCDriver := 'Microsoft Access Driver (*.mdb)';
What do you think about this topic? Send feedback!


uADPhysMSSQL Namespace

uADPhysMSSQL Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains Microsoft SQL Server driver and services components.

Classes
Class | Description
EMSSQLNativeException | Class representing a Microsoft SQL Server driver exception.
TADMSSQLError | TADMSSQLError represents FireDAC SQL Server errors, warnings and messages for the EMSSQLNAtiveException exception class.
TADPhysMSSQLDriverLink | Use the TADPhysMSSQLDriverLink component to link the Microsoft SQL Server driver to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysMSSQL unit contains:

  • Microsoft SQL Server driver implementation;
  • TADPhysMSSQLDriverLink - component to link the driver and setup CLI library.
See Also

Configuring Drivers, Connect to Microsoft SQL Server

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysMSSQL Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
EMSSQLNativeException | Class representing a Microsoft SQL Server driver exception.
TADMSSQLError | TADMSSQLError represents FireDAC SQL Server errors, warnings and messages for the EMSSQLNAtiveException exception class.
TADPhysMSSQLDriverLink | Use the TADPhysMSSQLDriverLink component to link the Microsoft SQL Server driver to an application and setup it.
Namespace

uADPhysMSSQL Namespace

Links
Classes, uADPhysMSSQL Namespace, Legend
What do you think about this topic? Send feedback!


EMSSQLNativeException Class

EMSSQLNativeException Class
public EMSSQLNativeException Members Example Classes See Also Send Feedback

Class representing a Microsoft SQL Server driver exception.

Group

Classes

Class Hierarchy
  uADPhysMSSQL_EMSSQLNativeException
File

uADPhysMSSQL

Links
public, EMSSQLNativeException Members, Example, Classes, See Also
Description

The FireDAC Microsoft SQL Server driver raises exceptions of EMSSQLNativeException class. Use this class to handle driver specific errors.

Syntax
EMSSQLNativeException = class(EODBCNativeException);
See Also

EODBCNativeException, TADPhysMSSQLDriverLink, Connect to Microsoft SQL Server

Example
try
  ADConnection1.Connected := True;
except
  on E: EMSSQLNativeException do
    // perform SQL Server error specific actions
end;
What do you think about this topic? Send feedback!


EMSSQLNativeException Members

EMSSQLNativeException Members
EMSSQLNativeException Class Legend Properties Send Feedback

The following tables list the members exposed by EMSSQLNativeException.

Class

EMSSQLNativeException Class

Properties
Property | Description
Errors | Returns an error item.
Links
EMSSQLNativeException Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
EMSSQLNativeException Class Legend Properties Send Feedback

The public members of the EMSSQLNativeException class are listed here.

Class

EMSSQLNativeException Class

Properties
Property | Description
Errors | Returns an error item.
Links
EMSSQLNativeException Class, Legend, Properties
What do you think about this topic? Send feedback!


EMSSQLNativeException.Errors Property

EMSSQLNativeException.Errors Property
EMSSQLNativeException Class EMSSQLNativeException Members uADPhysMSSQL Namespace public See Also Send Feedback

Returns an error item.

Group

public

Links
EMSSQLNativeException Class, EMSSQLNativeException Members, uADPhysMSSQL Namespace, public, See Also
Description

Use Errors property to get access to an error item from the collection of errors, associated with this exception object.

Syntax
property Errors [Index: Integer]: TADMSSQLError;
See Also

TADMSSQLError, TADDBError

What do you think about this topic? Send feedback!


TADMSSQLError Class

TADMSSQLError Class
Classes See Also Send Feedback

TADMSSQLError represents FireDAC SQL Server errors, warnings and messages for the EMSSQLNAtiveException exception class.

Group

Classes

Class Hierarchy
  uADPhysMSSQL_TADMSSQLError
File

uADPhysMSSQL

Links
Classes, See Also
Description

The TADMSSQLError object is a container for the information pertaining to one database error, warning or message. One or more TADMSSQLErrorobjects are contained in the Errors property of the EMSSQLNativeException object. TADMSSQLError class represents SQL Server specific error attributes additionally to TADDBError.

Syntax
TADMSSQLError = class(TADODBCNativeError);
See Also

TADDBError

What do you think about this topic? Send feedback!


TADPhysMSSQLDriverLink Class

TADPhysMSSQLDriverLink Class
Example Classes See Also Send Feedback

Use the TADPhysMSSQLDriverLink component to link the Microsoft SQL Server driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysMSSQL_TADPhysMSSQLDriverLinkuADPhysMSSQL_TADPhysMSSQLDriverLinkuADPhysMSSQL_TADPhysMSSQLDriverLink
File

uADPhysMSSQL

Links
Example, Classes, See Also
Description

Use the TADPhysMSSQLDriverLink component to link the Microsoft SQL Server driver to an application. In general it is enough to only include uADPhysMSSQL unit into your application uses clause.

The TADPhysMSSQLDriverLink component may be used to specify:

  • ODBCDriver - SQL Server ODBC driver name;
  • ODBCAdvanced - SQL Server ODBC driver connection parameter common for all connections;
  • VendorLib - ODBC driver manager. By default it is odbc32.dll and for most cases should remain unchanged.

All properties have default values appropriate for most case. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysMSSQLDriverLink = class(TADPhysODBCBaseDriverLink);
See Also

Configuring Drivers, Connect to Microsoft SQL Server

Example
ADPhysMSSQLDriverLink1.ODBCAdvanced := 'MARS_Connection=no;Regional=yes';
ADPhysMSSQLDriverLink1.ODBCDriver := 'SQL Native Client';
What do you think about this topic? Send feedback!


uADPhysMySQL Namespace

uADPhysMySQL Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains MySQL Server driver and services components.

Classes
Class | Description
TADPhysMySQLDriverLink | Use the TADPhysMySQLDriverLink component to link the MySQL Server driver to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysMySQL unit contains:

  • MySQL Server driver implementation;
  • TADPhysMySQLDriverLink - component to link the driver and setup CLI library.
See Also

Configuring Drivers, Connect to MySQL Server

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysMySQL Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysMySQLDriverLink | Use the TADPhysMySQLDriverLink component to link the MySQL Server driver to an application and setup it.
Namespace

uADPhysMySQL Namespace

Links
Classes, uADPhysMySQL Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysMySQLDriverLink Class

TADPhysMySQLDriverLink Class
published TADPhysMySQLDriverLink Members Example Classes See Also Send Feedback

Use the TADPhysMySQLDriverLink component to link the MySQL Server driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysMySQL_TADPhysMySQLDriverLinkuADPhysMySQL_TADPhysMySQLDriverLink
File

uADPhysMySQL

Links
published, TADPhysMySQLDriverLink Members, Example, Classes, See Also
Description

Use the TADPhysMySQLDriverLink component to link the MySQL Server driver to an application. In general it is enough to only include uADPhysMySQL unit into your application uses clause.

The TADPhysMySQLDriverLink component may be used to specify:

  • VendorHome - the MySQL installation root folder;
  • VendorLib - the name and optional path to the MySQL client library.

All properties have default values appropriate for most case. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysMySQLDriverLink = class(TADPhysDriverLink);
See Also

Configuring Drivers, Connect to MySQL Server

Example
ADPhysMySQLDriverLink1.VendorLib := 'E:\mysql\5-0-27\bin\libmySQL.dll';
What do you think about this topic? Send feedback!


TADPhysMySQLDriverLink Members

TADPhysMySQLDriverLink Members
Events TADPhysMySQLDriverLink Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADPhysMySQLDriverLink.

Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.
Class

TADPhysMySQLDriverLink Class

Methods
Method | Description
Release | Releases the driver resources, allowing to initialize the driver with different parameters.
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
EmbeddedArgs | Specifies the MySQL Embedded server arguments.
EmbeddedGroups | Specifies the MySQL Embedded server argument groups.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.
Links
Events, TADPhysMySQLDriverLink Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


published

published
TADPhysMySQLDriverLink Class Legend Properties Send Feedback

The published members of the TADPhysMySQLDriverLink class are listed here.

Class

TADPhysMySQLDriverLink Class

Properties
Property | Description
EmbeddedArgs | Specifies the MySQL Embedded server arguments.
EmbeddedGroups | Specifies the MySQL Embedded server argument groups.
Links
TADPhysMySQLDriverLink Class, Legend, Properties
What do you think about this topic? Send feedback!


TADPhysMySQLDriverLink.EmbeddedArgs Property

TADPhysMySQLDriverLink.EmbeddedArgs Property
TADPhysMySQLDriverLink Class TADPhysMySQLDriverLink Members uADPhysMySQL Namespace published See Also Send Feedback

Specifies the MySQL Embedded server arguments.

Group

published

Links
TADPhysMySQLDriverLink Class, TADPhysMySQLDriverLink Members, uADPhysMySQL Namespace, published, See Also
Description

Use the EmbeddedArgs property to specify the MySQL Embedded server arguments, as they are specified in Connect to MySQL Server.

Syntax
property EmbeddedArgs: TStrings;
See Also

EmbeddedGroups

What do you think about this topic? Send feedback!


TADPhysMySQLDriverLink.EmbeddedGroups Property

TADPhysMySQLDriverLink.EmbeddedGroups Property
TADPhysMySQLDriverLink Class TADPhysMySQLDriverLink Members uADPhysMySQL Namespace published See Also Send Feedback

Specifies the MySQL Embedded server argument groups.

Group

published

Links
TADPhysMySQLDriverLink Class, TADPhysMySQLDriverLink Members, uADPhysMySQL Namespace, published, See Also
Description

Use the EmbeddedGroups property to specify the MySQL Embedded server argument groups, as they are specified in Connect to MySQL Server.

Syntax
property EmbeddedGroups: TStrings;
See Also

EmbeddedArgs

What do you think about this topic? Send feedback!


uADPhysODBC Namespace

uADPhysODBC Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains ODBC bridge driver.

Classes
Class | Description
TADPhysODBCDriverLink | Use the TADPhysODBCDriverLink component to link the ODBC bridge driver to an application.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysODBC unit contains:

  • ODBC bridge driver implementation;
  • TADPhysODBCDriverLink - component to link the driver.
See Also

Configuring Drivers, Connect to ODBC data source

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysODBC Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysODBCDriverLink | Use the TADPhysODBCDriverLink component to link the ODBC bridge driver to an application.
Namespace

uADPhysODBC Namespace

Links
Classes, uADPhysODBC Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysODBCDriverLink Class

TADPhysODBCDriverLink Class
Example Classes See Also Send Feedback

Use the TADPhysODBCDriverLink component to link the ODBC bridge driver to an application.

Group

Classes

Class Hierarchy
  uADPhysODBC_TADPhysODBCDriverLinkuADPhysODBC_TADPhysODBCDriverLinkuADPhysODBC_TADPhysODBCDriverLink
File

uADPhysODBC

Links
Example, Classes, See Also
Description

Use the TADPhysODBCDriverLink component to link the ODBC bridge driver to an application. In general it is enough to only include uADPhysODBC unit into your application uses clause.

The TADPhysODBCDriverLink component may be used to specify:

  • ODBCDriver - ODBC driver name;
  • ODBCAdvanced - ODBC driver connection parameter common for all connections;
  • VendorLib - ODBC driver manager. By default it is odbc32.dll and for most cases should remain unchanged.

All properties have default values appropriate for most case. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysODBCDriverLink = class(TADPhysODBCBaseDriverLink);
See Also

Configuring Drivers, Connect to ODBC data source

Example
ADPhysODBCDriverLink1.DriverID := 'Informix';
ADPhysODBCDriverLink1.ODBCAdvanced := 'CLOC=en_US.CP1252;DLOC=en_US.819';
ADPhysODBCDriverLink1.ODBCDriver := 'IBM INFORMIX ODBC DRIVER';
What do you think about this topic? Send feedback!


uADPhysODBCBase Namespace

uADPhysODBCBase Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains FireDAC driver and services base classes for all ODBC based drivers.

Classes
Class | Description
TADPhysODBCBaseDriverLink | The TADPhysODBCBaseDriverLink component is a base class for all ODBC based driver link components.
TADPhysODBCBaseService | The TADPhysODBCBaseService component is a base class for all ODBC based driver service components.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysODBCBase unit contains:

  • FireDAC driver base implementation classes for all ODBC based drivers;
  • TADPhysODBCBaseDriverLink - the base class for FireDAC ODBC based driver link components;
  • TADPhysODBCBaseService - the base class for FireDAC ODBC based driver service components.
See Also

uADPhysODBC Namespace

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysODBCBase Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysODBCBaseDriverLink | The TADPhysODBCBaseDriverLink component is a base class for all ODBC based driver link components.
TADPhysODBCBaseService | The TADPhysODBCBaseService component is a base class for all ODBC based driver service components.
Namespace

uADPhysODBCBase Namespace

Links
Classes, uADPhysODBCBase Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysODBCBaseDriverLink Class

TADPhysODBCBaseDriverLink Class
public published TADPhysODBCBaseDriverLink Members Classes Send Feedback

The TADPhysODBCBaseDriverLink component is a base class for all ODBC based driver link components.

Group

Classes

Class Hierarchy
  uADPhysODBCBase_TADPhysODBCBaseDriverLinkuADPhysODBCBase_TADPhysODBCBaseDriverLink
File

uADPhysODBCBase

Links
public, published, TADPhysODBCBaseDriverLink Members, Classes
Description

The TADPhysODBCBaseDriverLink component is a base class for all ODBC based driver link components. It allows to configure a DBMS driver at runtime, using the ODBCAdvanced and ODBCDriver properties.

An application should not use the TADPhysODBCBaseDriverLink component directly. But it may use one of the many descendants, for example, TADPhysMSSQLDriverLink or TADPhysMSAccessDriverLink.

Syntax
TADPhysODBCBaseDriverLink = class(TADPhysDriverLink);
What do you think about this topic? Send feedback!


TADPhysODBCBaseDriverLink Members

TADPhysODBCBaseDriverLink Members
Events TADPhysODBCBaseDriverLink Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADPhysODBCBaseDriverLink.

Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.
Class

TADPhysODBCBaseDriverLink Class

Methods
Method | Description
GetDrivers | Returns the list of ODBC driver names.
GetDSNs | Returns the list of ODBC data source names.
Release | Releases the driver resources, allowing to initialize the driver with different parameters.
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
ODBCAdvanced | The ODBC driver common parameters.
ODBCDriver | The ODBC driver name.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.
Links
Events, TADPhysODBCBaseDriverLink Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADPhysODBCBaseDriverLink Class Legend Methods Send Feedback

The public members of the TADPhysODBCBaseDriverLink class are listed here.

Class

TADPhysODBCBaseDriverLink Class

Methods
Method | Description
GetDrivers | Returns the list of ODBC driver names.
GetDSNs | Returns the list of ODBC data source names.
Links
TADPhysODBCBaseDriverLink Class, Legend, Methods
What do you think about this topic? Send feedback!


TADPhysODBCBaseDriverLink.GetDrivers Method

TADPhysODBCBaseDriverLink.GetDrivers Method
TADPhysODBCBaseDriverLink Class TADPhysODBCBaseDriverLink Members uADPhysODBCBase Namespace Example public See Also Send Feedback

Returns the list of ODBC driver names.

Group

public

Links
TADPhysODBCBaseDriverLink Class, TADPhysODBCBaseDriverLink Members, uADPhysODBCBase Namespace, Example, public, See Also
Parameters
Parameters | Description
AList: TStrings | A list to fill by the driver names.
Description

Use GetDrivers method to get the list of installed ODBC driver names.

Syntax
procedure GetDrivers(AList: TStrings);
See Also

GetDSNs

Example
ADPhysODBCDriverLink1.GetDrivers(Memo1.Lines);
What do you think about this topic? Send feedback!


TADPhysODBCBaseDriverLink.GetDSNs Method

TADPhysODBCBaseDriverLink.GetDSNs Method
TADPhysODBCBaseDriverLink Class TADPhysODBCBaseDriverLink Members uADPhysODBCBase Namespace Example public See Also Send Feedback

Returns the list of ODBC data source names.

Group

public

Links
TADPhysODBCBaseDriverLink Class, TADPhysODBCBaseDriverLink Members, uADPhysODBCBase Namespace, Example, public, See Also
Parameters
Parameters | Description
AList: TStrings | A list to fill by the DSN names.
AWithDescription: Boolean = False | Set to True to return the list with descriptions.
Description

Use GetDSNs method to get the list of known ODBC data source names. Set AWithDescription to True to return the list with descriptions in format <DSN name>=<description>.

Syntax
procedure GetDSNs(AList: TStrings; AWithDescription: Boolean = False);
See Also

GetDrivers

Example
ADPhysODBCDriverLink1.GetDSNs(Memo1.Lines, False);
What do you think about this topic? Send feedback!


published

published
TADPhysODBCBaseDriverLink Class Legend Properties Send Feedback

The published members of the TADPhysODBCBaseDriverLink class are listed here.

Class

TADPhysODBCBaseDriverLink Class

Properties
Property | Description
ODBCAdvanced | The ODBC driver common parameters.
ODBCDriver | The ODBC driver name.
Links
TADPhysODBCBaseDriverLink Class, Legend, Properties
What do you think about this topic? Send feedback!


TADPhysODBCBaseDriverLink.ODBCAdvanced Property

TADPhysODBCBaseDriverLink.ODBCAdvanced Property
TADPhysODBCBaseDriverLink Class TADPhysODBCBaseDriverLink Members uADPhysODBCBase Namespace published See Also Send Feedback

The ODBC driver common parameters.

Group

published

Links
TADPhysODBCBaseDriverLink Class, TADPhysODBCBaseDriverLink Members, uADPhysODBCBase Namespace, published, See Also
Description

Use the ODBCAdvanced to specify the ODBC driver parameters. The specified ODBC driver parameters will be used by all connections through this FireDAC driver. The parameters may be overridden at the connection level.

Syntax
property ODBCAdvanced: String;
See Also

Configuring Drivers, ODBCDriver

What do you think about this topic? Send feedback!


TADPhysODBCBaseDriverLink.ODBCDriver Property

TADPhysODBCBaseDriverLink.ODBCDriver Property
TADPhysODBCBaseDriverLink Class TADPhysODBCBaseDriverLink Members uADPhysODBCBase Namespace published See Also Send Feedback

The ODBC driver name.

Group

published

Links
TADPhysODBCBaseDriverLink Class, TADPhysODBCBaseDriverLink Members, uADPhysODBCBase Namespace, published, See Also
Description

Use the ODBCDriver to specify the ODBC driver name. Although application may assign any value to this property, only drivers of the same family, compatible with the DBMS driver must be assigned. Eg only SQL Server driver names must be assigned to TADPhysMSSQLDriverLink.ODBCDriver.

A ODBCDriver change will have an effect only before first connection through this driver. Also you can use the Release method.

The specified ODBC driver will be used by all connections through this FireDAC driver. It is impossible to specify a ODBC driver for a connection.

Syntax
property ODBCDriver: String;
See Also

Configuring Drivers, ODBCAdvanced, Release

What do you think about this topic? Send feedback!


TADPhysODBCBaseService Class

TADPhysODBCBaseService Class
Classes Send Feedback

The TADPhysODBCBaseService component is a base class for all ODBC based driver service components.

Group

Classes

Class Hierarchy
  uADPhysODBCBase_TADPhysODBCBaseServiceuADPhysODBCBase_TADPhysODBCBaseService
File

uADPhysODBCBase

Links
Classes
Description

The TADPhysODBCBaseService component is a base class for all ODBC based driver link components.

An application should not use the TADPhysODBCBaseService component directly.

Syntax
TADPhysODBCBaseService = class(TADPhysDriverService);
What do you think about this topic? Send feedback!


uADPhysOracle Namespace

uADPhysOracle Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains Oracle Database driver and services components.

Classes
Class | Description
TADPhysOracleDriverLink | Use the TADPhysOracleDriverLink component to link the Oracle Database driver to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysOracle unit contains:

  • Oracle Database driver implementation;
  • TADPhysOracleDriverLink - component to link the driver and setup CLI library.
See Also

Connect to Oracle Server, Using Oracle with FireDAC, Configuring Drivers

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysOracle Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysOracleDriverLink | Use the TADPhysOracleDriverLink component to link the Oracle Database driver to an application and setup it.
Namespace

uADPhysOracle Namespace

Links
Classes, uADPhysOracle Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysOracleDriverLink Class

TADPhysOracleDriverLink Class
public published TADPhysOracleDriverLink Members Example Classes See Also Send Feedback

Use the TADPhysOracleDriverLink component to link the Oracle Database driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysOracle_TADPhysOracleDriverLinkuADPhysOracle_TADPhysOracleDriverLink
File

uADPhysOracle

Links
public, published, TADPhysOracleDriverLink Members, Example, Classes, See Also
Description

Use the TADPhysOracleDriverLink component to link the Oracle Database driver to an application. In general it is enough to only include uADPhysOracle unit into your application uses clause.

The TADPhysOracleDriverLink component may be used to specify:

  • VendorHome - the Oracle Home name;
  • VendorLib - the name and optional path to the Oracle client library;
  • NLSLang - the Oracle client NLS_LANG environment value;
  • TNSAdmin - the Oracle client TNS_ADMIN environment value;
  • Threaded - the OCI threading mode.

All properties have default values appropriate for most case. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysOracleDriverLink = class(TADPhysDriverLink);
See Also

Configuring Drivers, Connect to Oracle Server, Using Oracle with FireDAC

Example
ADPhysOracleDriverLink1.VendorHome := 'Oracle11_Home';
What do you think about this topic? Send feedback!


TADPhysOracleDriverLink Members

TADPhysOracleDriverLink Members
Events TADPhysOracleDriverLink Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADPhysOracleDriverLink.

Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.
Class

TADPhysOracleDriverLink Class

Methods
Method | Description
GetOracleHomes | Returns the list of installed Oracle homes.
GetTNSServices | Returns the list of TNS aliases.
Release | Releases the driver resources, allowing to initialize the driver with different parameters.
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
NLSLang | Allows to specify the NLS_LANG environment variable value.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
Threaded | Allows to specify OCI multi-threaded initialization mode.
TNSAdmin | Allows to specify the TNS_ADMIN environment variable value.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.
Links
Events, TADPhysOracleDriverLink Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADPhysOracleDriverLink Class Legend Methods Send Feedback

The public members of the TADPhysOracleDriverLink class are listed here.

Class

TADPhysOracleDriverLink Class

Methods
Method | Description
GetOracleHomes | Returns the list of installed Oracle homes.
GetTNSServices | Returns the list of TNS aliases.
Links
TADPhysOracleDriverLink Class, Legend, Methods
What do you think about this topic? Send feedback!


TADPhysOracleDriverLink.GetOracleHomes Method

TADPhysOracleDriverLink.GetOracleHomes Method
TADPhysOracleDriverLink Class TADPhysOracleDriverLink Members uADPhysOracle Namespace Example public See Also Send Feedback

Returns the list of installed Oracle homes.

Group

public

Links
TADPhysOracleDriverLink Class, TADPhysOracleDriverLink Members, uADPhysOracle Namespace, Example, public, See Also
Parameters
Parameters | Description
AList: TStrings | A list of names.
Description

Use the GetOracleHomes method to get a list of installed Oracle Home names.

Syntax
class procedure GetOracleHomes(AList: TStrings);
See Also

GetTNSServices

Example
ADPhysOracleDriverLink1.GetOracleHomes(Memo1.Lines);
What do you think about this topic? Send feedback!


TADPhysOracleDriverLink.GetTNSServices Method

TADPhysOracleDriverLink.GetTNSServices Method
TADPhysOracleDriverLink Class TADPhysOracleDriverLink Members uADPhysOracle Namespace Example public See Also Send Feedback

Returns the list of TNS aliases.

Group

public

Links
TADPhysOracleDriverLink Class, TADPhysOracleDriverLink Members, uADPhysOracle Namespace, Example, public, See Also
Parameters
Parameters | Description
AList: TStrings | A list of aliases.
Description

Use the GetTNSServices method to get a list of TNS aliases in current or specified Oracle Home.

Syntax
procedure GetTNSServices(AList: TStrings);
See Also

GetOracleHomes

Example
ADPhysOracleDriverLink1.GetTNSServices(Memo1.Lines);
What do you think about this topic? Send feedback!


published

published
TADPhysOracleDriverLink Class Legend Properties Send Feedback

The published members of the TADPhysOracleDriverLink class are listed here.

Class

TADPhysOracleDriverLink Class

Properties
Property | Description
NLSLang | Allows to specify the NLS_LANG environment variable value.
Threaded | Allows to specify OCI multi-threaded initialization mode.
TNSAdmin | Allows to specify the TNS_ADMIN environment variable value.
Links
TADPhysOracleDriverLink Class, Legend, Properties
What do you think about this topic? Send feedback!


TADPhysOracleDriverLink.NLSLang Property

TADPhysOracleDriverLink.NLSLang Property
TADPhysOracleDriverLink Class TADPhysOracleDriverLink Members uADPhysOracle Namespace Example published See Also Send Feedback

Allows to specify the NLS_LANG environment variable value.

Group

published

Links
TADPhysOracleDriverLink Class, TADPhysOracleDriverLink Members, uADPhysOracle Namespace, Example, published, See Also
Description

Use the NLSLang property to specify the Oracle client NLS_LANG environment variable value.

When you have the Oracle full client installed, the best way to specify the NLS_LANG is to set the NLS_LANG registry value in HKLM\Software\Oracle\<Oracle home>.

When you are using Oracle instant client, the best way is to use NLSLang property. If you will leave it as is the NLS_LANG registry value in HKLM\Software\Oracle will be used. If it is empty, then AMERICAN_AMERICA.US7ASCII will be used.

Syntax
property NLSLang: String;
See Also

TNSAdmin

Example
ADPhysOracleDriverLink1.NLSLang := 'AMERICAN_AMERICA.UTF8';
What do you think about this topic? Send feedback!


TADPhysOracleDriverLink.Threaded Property

TADPhysOracleDriverLink.Threaded Property
TADPhysOracleDriverLink Class TADPhysOracleDriverLink Members uADPhysOracle Namespace published Send Feedback

Allows to specify OCI multi-threaded initialization mode.

Group

published

Links
TADPhysOracleDriverLink Class, TADPhysOracleDriverLink Members, uADPhysOracle Namespace, published
Description

Use Threaded property to specify should FireDAC initialize OCI in multi-threaded (True) or single-threaded (False) initialization mode. The default value is True.

Setting Threaded to False, when your application does not use connection pooling and has only single thread working with an Oracle database, will improve general data access performance.

Setting Threaded to True is required for when multiple threads will access to an Oracle database. This is equivalent to setting OCI_THREADED or OCI_NO_MUTEX in [image] OCI environment initialization call.

Syntax
property Threaded: Boolean;
What do you think about this topic? Send feedback!


TADPhysOracleDriverLink.TNSAdmin Property

TADPhysOracleDriverLink.TNSAdmin Property
TADPhysOracleDriverLink Class TADPhysOracleDriverLink Members uADPhysOracle Namespace Example published See Also Send Feedback

Allows to specify the TNS_ADMIN environment variable value.

Group

published

Links
TADPhysOracleDriverLink Class, TADPhysOracleDriverLink Members, uADPhysOracle Namespace, Example, published, See Also
Description

Use the TNSAdmin property to specify the Oracle client TNS_ADMIN environment variable value.

When you have the Oracle full client installed, the best way to specify the TNS_ADMIN is to set the TNS_ADMIN registry value in HKLM\Software\Oracle\<Oracle home>. Or just leave it as is, then the default path <Oracle home folder>\NETWORK\Admin is used.

When you are using Oracle instant client, the best way is to use TNSAdmin property. Or just leave it as is, because the default path is application EXE folder.

Syntax
property TNSAdmin: String;
See Also

NLSLang

Example
ADPhysOracleDriverLink1.TNSAdmin := 'c:\Program Files\MyApp\Config';
What do you think about this topic? Send feedback!


uADPhysPG Namespace

uADPhysPG Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains PostgreSQL driver and services components.

Classes
Class | Description
TADPhysPgDriverLink | Use the TADPhysPgDriverLink component to link the PostgreSQL driver to an application and setup it.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysPG unit contains:

  • PostgreSQL driver implementation;
  • TADPhysPgDriverLink - component to link the driver and setup CLI library.
See Also

Configuring Drivers, Connect to PostgreSQL

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysPG Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysPgDriverLink | Use the TADPhysPgDriverLink component to link the PostgreSQL driver to an application and setup it.
Namespace

uADPhysPG Namespace

Links
Classes, uADPhysPG Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysPgDriverLink Class

TADPhysPgDriverLink Class
Example Classes See Also Send Feedback

Use the TADPhysPgDriverLink component to link the PostgreSQL driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysPG_TADPhysPgDriverLinkuADPhysPG_TADPhysPgDriverLink
File

uADPhysPG

Links
Example, Classes, See Also
Description

Use the TADPhysPgDriverLink component to link the PostgreSQL driver to an application. In general it is enough to only include uADPhysPG unit into your application uses clause.

The TADPhysPgDriverLink component may be used to specify:

  • VendorHome - the PostgreSQL installation root folder;
  • VendorLib - the name and optional path to the PostgreSQL client library.

All properties have default values appropriate for most case. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysPgDriverLink = class(TADPhysDriverLink);
See Also

Configuring Drivers, Connect to PostgreSQL

Example
ADPhysPgDriverLink1.VendorLib := 'E:\PostgreSQL\9.0\bin\libpq.dll';
What do you think about this topic? Send feedback!


uADPhysSQLite Namespace

uADPhysSQLite Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains SQLite driver and services components.

Classes
Class | Description
TADPhysSQLiteDriverLink | Use the TADPhysSQLiteDriverLink component to link the SQLite driver to an application and setup it.
TADSQLiteBackup | The class implementing SQLite backup, restore, copy database functionality.
TADSQLiteCollation | The class implementing custom SQLite collation.
TADSQLiteFunction | The class implementing custom SQLite function.
TADSQLiteRTree | The class implementing custom SQLite RTree module.
TADSQLiteSecurity | The class allowing to manage SQLite database encryption.
TADSQLiteService | The base class for all SQLite service classes.
TADSQLiteValidate | The class implementing SQLite database validate service.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysSQLite unit contains:

  • SQLite driver implementation;
  • TADPhysSQLiteDriverLink - component to link the driver and setup CLI library for dynamic linking;
  • TADSQLiteBackup - backup database component;
  • TADSQLiteCollation - database custom collation setup component;
  • TADSQLiteFunction - database custom function setup component;
  • TADSQLiteRTree - database custom RTree module setup component;
  • TADSQLiteValidate - DB validation service component;
  • TADSQLiteSecurity - database encryption control component.
See Also

Connect to SQLite database, Using SQLite with FireDAC, Configuring Drivers

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysSQLite Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysSQLiteDriverLink | Use the TADPhysSQLiteDriverLink component to link the SQLite driver to an application and setup it.
TADSQLiteBackup | The class implementing SQLite backup, restore, copy database functionality.
TADSQLiteCollation | The class implementing custom SQLite collation.
TADSQLiteFunction | The class implementing custom SQLite function.
TADSQLiteRTree | The class implementing custom SQLite RTree module.
TADSQLiteSecurity | The class allowing to manage SQLite database encryption.
TADSQLiteService | The base class for all SQLite service classes.
TADSQLiteValidate | The class implementing SQLite database validate service.
Namespace

uADPhysSQLite Namespace

Links
Classes, uADPhysSQLite Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysSQLiteDriverLink Class

TADPhysSQLiteDriverLink Class
Classes See Also Send Feedback

Use the TADPhysSQLiteDriverLink component to link the SQLite driver to an application and setup it.

Group

Classes

Class Hierarchy
  uADPhysSQLite_TADPhysSQLiteDriverLinkuADPhysSQLite_TADPhysSQLiteDriverLink
File

uADPhysSQLite

Links
Classes, See Also
Description

Use the TADPhysSQLiteDriverLink component to link the SQLite driver to an application. In general it is enough to only include uADPhysSQLite unit into your application uses clause.

The TADPhysSQLiteDriverLink component may be used to specify SQLite client library to the driver, when the dynamic linking is used. To have an effect all property changes must be performed before first connection through this driver or use the Release method.

Syntax
TADPhysSQLiteDriverLink = class(TADPhysDriverLink);
See Also

Configuring Drivers, Connect to SQLite database, Using SQLite with FireDAC

What do you think about this topic? Send feedback!


TADSQLiteBackup Class

TADSQLiteBackup Class
public published TADSQLiteBackup Members Example 1 Example 2 Classes Send Feedback

The class implementing SQLite backup, restore, copy database functionality.

Group

Classes

Class Hierarchy
  uADPhysSQLite_TADSQLiteBackupuADPhysSQLite_TADSQLiteBackupuADPhysSQLite_TADSQLiteBackup
File

uADPhysSQLite

Links
public, published, TADSQLiteBackup Members, Example 1, Example 2, Classes
Description

Use the TADSQLiteBackup component to add a backup, restore, copy database capability to an application.

To produce a DB backup an application should:

  • specify DriverLink;
  • specify Database or DatabaseObj - a source database file name or object to backup;
  • specify DestDatabase or DestDatabaseObj - a destination database file name or object to put a database backup file;
  • optionally specify WaitForLocks and BusyTimeout to avoid locking conflicts;
  • call Backup method.

Other properties and methods are optional.

The SQLite backup actually copies the specified database to a new file. The copying is consistent and does not depend on the currently connected users.

Also the copying may be performed not only between files, but also between memory and file or backward. In this case use DatabaseObj or DestDatabaseObj to specify connected memory database.

Syntax
TADSQLiteBackup = class(TADSQLiteService);
Example 1
ADSQLiteBackup1.Database := 'c:\addemo.sdb';
ADSQLiteBackup1.DestDatabase := 'c:\addemo.backup';
ADSQLiteBackup1.Backup;
Example 2
// create SQLite in-memory database
with ADConnection1.Params do begin
  Clear;
  Add('DriverID=SQLite');
  Add('Database=:memory:');
end;
ADConnection1.Connected := True;

// populate the in-memory database
ADConnection1.ExecSQL('create table aaa (f1 integer, f2 text)');
ADConnection1.ExecSQL('insert into aaa values (1, ''qqq'')');
ADConnection1.ExecSQL('insert into aaa values (2, ''www'')');
ADConnection1.ExecSQL('insert into aaa values (3, ''eee'')');

// specify the in-memory database objects as a backup source
ADSQLiteBackup1.DatabaseObj := ADConnection1.CliObj;
// specify database file name as a backup destination
ADSQLiteBackup1.DestDatabase := 'c:\db.sdb';
// copy the in-memory database to the file
ADSQLiteBackup1.Backup;
What do you think about this topic? Send feedback!


TADSQLiteBackup Members

TADSQLiteBackup Members
Events TADSQLiteBackup Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADSQLiteBackup.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | The event firing after each copying step.
Class

TADSQLiteBackup Class

Methods
Method | Description
Backup | Executes the backup or copy operation.
Properties
Property | Description
BusyTimeout | Controls the timeout of waiting for a locks to be released.
Catalog | The name of source attached database.
CliObj | Returns a reference to the driver CLI object.
Database | A source database file name.
DatabaseObj | A source database object.
DestCatalog | The name of destination attached database.
DestDatabase | A destination database file name.
DestDatabaseObj | A destination database object.
DestMode | The destination database open mode.
DestPassword | The password for destination database.
DriverLink | Specifies the DriverLink.
PageCount | The total number of pages to copy.
PagesPerStep | Number of pages per single copy step.
Password | The password for source database.
Remaining | The remaining number of pages to copy.
WaitForLocks | Controls the waiting for a locks to be released.
Links
Events, TADSQLiteBackup Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADSQLiteBackup Class Legend Methods Properties Send Feedback

The public members of the TADSQLiteBackup class are listed here.

Class

TADSQLiteBackup Class

Methods
Method | Description
Backup | Executes the backup or copy operation.
Properties
Property | Description
DatabaseObj | A source database object.
DestDatabaseObj | A destination database object.
PageCount | The total number of pages to copy.
Remaining | The remaining number of pages to copy.
Links
TADSQLiteBackup Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADSQLiteBackup.DatabaseObj Property

TADSQLiteBackup.DatabaseObj Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace Example public See Also Send Feedback

A source database object.

Group

public

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, Example, public, See Also
Description

Use the DatabaseObj property to specify the source SQLite database object of an API wrapping class. The object may be obtained from the TADConnection.CliObj property. There ADConnection must be connected to a SQLite database.

Note, when a source database is an in-memory database then DatabaseObj must be used instead of Database property.

Syntax
property DatabaseObj: TSQLiteDatabase;
See Also

Database, DestDatabaseObj

Example
ADSQLiteBackup1.DatabaseObj := ADConnection1.CliObj;
ADSQLiteBackup1.DestDatabase := 'c:\backup.sdb';
ADSQLiteBackup1.Backup;
What do you think about this topic? Send feedback!


TADSQLiteBackup.DestDatabaseObj Property

TADSQLiteBackup.DestDatabaseObj Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace Example public See Also Send Feedback

A destination database object.

Group

public

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, Example, public, See Also
Description

Use the DestDatabaseObj property to specify the destination SQLite database object of an API wrapping class. The object may be obtained from the TADConnection.CliObj property. There ADConnection must be connected to a SQLite database.

Note, when a destination database is an in-memory database then DestDatabaseObj must be used instead of DestDatabase property.

Syntax
property DestDatabaseObj: TSQLiteDatabase;
See Also

DestDatabase, Database, BusyTimeout, WaitForLocks

Example
ADSQLiteBackup1.Database := 'c:\db.sdb';
ADSQLiteBackup1.DestDatabaseObj := ADConnection1.CliObj;
ADSQLiteBackup1.Backup;
What do you think about this topic? Send feedback!


TADSQLiteBackup.PageCount Property

TADSQLiteBackup.PageCount Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace public See Also Send Feedback

The total number of pages to copy.

Group

public

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, public, See Also
Description

Use the PageCount property to get the total number of pages to copy.

Syntax
property PageCount: Integer;
See Also

Remaining, OnProgress

What do you think about this topic? Send feedback!


TADSQLiteBackup.Remaining Property

TADSQLiteBackup.Remaining Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace public See Also Send Feedback

The remaining number of pages to copy.

Group

public

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, public, See Also
Description

Use the Remaining property to get the remaining number of pages to copy.

Syntax
property Remaining: Integer;
See Also

PageCount, OnProgress

What do you think about this topic? Send feedback!


TADSQLiteBackup.Backup Method

TADSQLiteBackup.Backup Method
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace public See Also Send Feedback

Executes the backup or copy operation.

Group

public

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, public, See Also
Description

Call the Backup method to run the copy operation from Database source database to the DestDatabase destination database. For feedback an application may use the OnProgress event.

Syntax
procedure Backup;
See Also

Database, DestDatabase, OnProgress

What do you think about this topic? Send feedback!


published

published
Events TADSQLiteBackup Class Legend Properties Send Feedback

The published members of the TADSQLiteBackup class are listed here.

Events
Event | Description
OnProgress | The event firing after each copying step.
Class

TADSQLiteBackup Class

Properties
Property | Description
BusyTimeout | Controls the timeout of waiting for a locks to be released.
Catalog | The name of source attached database.
Database | A source database file name.
DestCatalog | The name of destination attached database.
DestDatabase | A destination database file name.
DestMode | The destination database open mode.
DestPassword | The password for destination database.
PagesPerStep | Number of pages per single copy step.
Password | The password for source database.
WaitForLocks | Controls the waiting for a locks to be released.
Links
Events, TADSQLiteBackup Class, Legend, Properties
What do you think about this topic? Send feedback!


TADSQLiteBackup.BusyTimeout Property

TADSQLiteBackup.BusyTimeout Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

Controls the timeout of waiting for a locks to be released.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use BusyTimeout property to specify the time in msecs that FireDAC should wait for a lock on source or destination database will be released. The property will be used together with WaitForLocks.

The default value is 10000.

Syntax
property BusyTimeout: Integer;
See Also

WaitForLocks

What do you think about this topic? Send feedback!


TADSQLiteBackup.Catalog Property

TADSQLiteBackup.Catalog Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

The name of source attached database.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use the Catalog to specify a name of source attached database.

Syntax
property Catalog: String;
See Also

DestCatalog

What do you think about this topic? Send feedback!


TADSQLiteBackup.Database Property

TADSQLiteBackup.Database Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

A source database file name.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use the Database property to specify the source SQLite database file name. The file name may include $(<variable>) markers, where variable is a name of environment variable.

Syntax
property Database: String;
See Also

DatabaseObj, DestDatabase

What do you think about this topic? Send feedback!


TADSQLiteBackup.DestCatalog Property

TADSQLiteBackup.DestCatalog Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

The name of destination attached database.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use the DestCatalog to specify a name of destination attached database.

Syntax
property DestCatalog: String;
See Also

Catalog, DestDatabase

What do you think about this topic? Send feedback!


TADSQLiteBackup.DestDatabase Property

TADSQLiteBackup.DestDatabase Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

A destination database file name.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use the DestDatabase property to specify the destination SQLite database file name. The file name may include $(<variable>) markers, where variable is a name of environment variable.

Syntax
property DestDatabase: String;
See Also

DestDatabaseObj, Database, BusyTimeout, WaitForLocks

What do you think about this topic? Send feedback!


TADSQLiteBackup.DestMode Property

TADSQLiteBackup.DestMode Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

The destination database open mode.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use the DestMode to specify the destination database open mode.

The default value is smCreate, what means - create a new database if it does not exists, otherwise use an existing database.

Syntax
property DestMode: TSQLiteDatabaseMode;
See Also

DestDatabase

What do you think about this topic? Send feedback!


TADSQLiteBackup.DestPassword Property

TADSQLiteBackup.DestPassword Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

The password for destination database.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use the DestPassword to specify an password for the destination database. The password may be different from the source database password.

You can specify the cipher algorithm prefix in the DestPassword property value using format: <prefix>:<password>.

Syntax
property DestPassword: String;
See Also

Connect to SQLite database, Password, DestDatabase

What do you think about this topic? Send feedback!


TADSQLiteBackup.OnProgress Event

TADSQLiteBackup.OnProgress Event
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

The event firing after each copying step.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use the OnProgress event handler to provide the copy operation feedback.

For calculating the amount of work done, the event handler may use PageCount and Remaining properties.

Syntax
property OnProgress: TADPhysServiceProgressEvent;
See Also

PageCount, Remaining

What do you think about this topic? Send feedback!


TADSQLiteBackup.PagesPerStep Property

TADSQLiteBackup.PagesPerStep Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

Number of pages per single copy step.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use the PagesPerStep property to specify the number of pages, which will be copied per single copying operation step. After each step the OnProgress event is fired.

The default value is -1, what means all database pages.

Syntax
property PagesPerStep: Integer;
See Also

OnProgress

What do you think about this topic? Send feedback!


TADSQLiteBackup.Password Property

TADSQLiteBackup.Password Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace Example published See Also Send Feedback

The password for source database.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, Example, published, See Also
Description

Use the Password to specify a password for the source database. The destination password may be different from the source database password.

You can specify the cipher algorithm prefix in the Password property value using format: <prefix>:<password>. See example.

Note, if a source database file was created with a non-default cipher algorithm (aes-256) by specifying:

  • the Encrypt connection definition parameter,
  • or a cipher algorithm prefix for the Password connection definition parameter,

then prefix must be specified, otherwise "Out of memory" exception will be raised.

Syntax
property Password: String;
See Also

Connect to SQLite database, Database, DestPassword

Example
// DB is encrypted using aes-ecb-128 cipher algorithm
ADConnection1.Params.Add('Password=aes-ecb-128:12345');
ADConnection1.Connected  := True;
....
// specify aes-ecb-128 cipher algorithm for source database
ADSQLiteBackup1.Password := 'aes-ecb-128:12345';
What do you think about this topic? Send feedback!


TADSQLiteBackup.WaitForLocks Property

TADSQLiteBackup.WaitForLocks Property
TADSQLiteBackup Class TADSQLiteBackup Members uADPhysSQLite Namespace published See Also Send Feedback

Controls the waiting for a locks to be released.

Group

published

Links
TADSQLiteBackup Class, TADSQLiteBackup Members, uADPhysSQLite Namespace, published, See Also
Description

Use WaitForLocks property to specify should copying operation wait for a lock on source or destination database will be released. When True, then Backup method will wait. Use the BusyTimeout property to specify the timeout. When False, then an exception will be raised immediately after a lock will be found.

The default value is True.

Syntax
property WaitForLocks: Boolean;
See Also

BusyTimeout

What do you think about this topic? Send feedback!


TADSQLiteCollation Class

TADSQLiteCollation Class
published TADSQLiteCollation Members Example 1 Example 2 Classes See Also Send Feedback

The class implementing custom SQLite collation.

Group

Classes

Class Hierarchy
  uADPhysSQLite_TADSQLiteCollationuADPhysSQLite_TADSQLiteCollationuADPhysSQLite_TADSQLiteCollation
File

uADPhysSQLite

Links
published, TADSQLiteCollation Members, Example 1, Example 2, Classes, See Also
Description

Use the TADSQLiteCollation to register a custom [image] SQLite collation. A registered collation then may be used in any place in SQL command, where a collation may be specified. For example:

SELECT * FROM "Employees" ORDER BY LastName COLLATE UTF16NoCase

Each collation must have an unique name specified by CollationName. And one of the three collation kinds specified as the additional properties:

  • CollationKind = scCompareString. The collation will use Win32 / Win64 API [image] CompareStringW. To setup it properties use the Locale and Flags properties.
  • CollationKind = scCustomUTF8. To compare strings application should use OnCompare event, which will receive strings in UTF8 encoding.
  • CollationKind = scCustomUTF16. Similar to scCustomUTF8, but strings will be in UTF16 encoding.

After setting up the collation it must be activated using Active property. To use a collation in a SQLite connection, application must activate the collation before opening a database connection.

Syntax
TADSQLiteCollation = class(TADSQLiteService);
See Also

Using SQLite with FireDAC

Example 1
ADSQLiteCollation1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteCollation1.CollationName := 'UTF16NoCase';
ADSQLiteCollation1.CollationKind := scCompareString;
ADSQLiteCollation1.Flags := [sfIgnoreCase];
ADSQLiteCollation1.Active := True;
Example 2

See <FireDAC>\Samples\DBMS Specific\SQLite\UserCollation

What do you think about this topic? Send feedback!


TADSQLiteCollation Members

TADSQLiteCollation Members
Events TADSQLiteCollation Class Legend Properties Send Feedback

The following tables list the members exposed by TADSQLiteCollation.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADSQLiteCollation Class

Properties
Property | Description
Active | Activates and registers a collation.
CliObj | Returns a reference to the driver CLI object.
CollationKind | The collation implementation kind.
CollationName | The unique collation name.
DriverLink | Specifies the DriverLink.
Flags | The scCompareString collation kind collation flags.
Locale | The scCompareString collation kind collation.
OnCompare | The scCustomXxx compare strings event.
Links
Events, TADSQLiteCollation Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADSQLiteCollation Class Legend Properties Send Feedback

The published members of the TADSQLiteCollation class are listed here.

Class

TADSQLiteCollation Class

Properties
Property | Description
Active | Activates and registers a collation.
CollationKind | The collation implementation kind.
CollationName | The unique collation name.
Flags | The scCompareString collation kind collation flags.
Locale | The scCompareString collation kind collation.
OnCompare | The scCustomXxx compare strings event.
Links
TADSQLiteCollation Class, Legend, Properties
What do you think about this topic? Send feedback!


TADSQLiteCollation.Active Property

TADSQLiteCollation.Active Property
TADSQLiteCollation Class TADSQLiteCollation Members uADPhysSQLite Namespace published Send Feedback

Activates and registers a collation.

Group

published

Links
TADSQLiteCollation Class, TADSQLiteCollation Members, uADPhysSQLite Namespace, published
Description

Use the Active property to activate the collation and register it at with SQLite engine.

All active connections may use this collation. Setting Active to False will unregister the collation. Note, that SQLite actually has problems with collation unregistration. So, in general, leave the collation registered until application finish.

Changing any of the collation properties will set Active to False.

Syntax
property Active;
What do you think about this topic? Send feedback!


TADSQLiteCollation.CollationKind Property

TADSQLiteCollation.CollationKind Property
TADSQLiteCollation Class TADSQLiteCollation Members uADPhysSQLite Namespace published See Also Send Feedback

The collation implementation kind.

Group

published

Links
TADSQLiteCollation Class, TADSQLiteCollation Members, uADPhysSQLite Namespace, published, See Also
Description

Use the CollationKind property to specify the collation implementation kind.

In general, the collation may use the Win32 / Win64 API CompareStringW or the application OnCompare event handler. The OnCompare event handler may receive as strings UTF8 encoded, as UTF16 encoded. The default value is scCompareString.

For scCompareString collations, the application should specify Flags and Locale properties. For scCustomUTF8 and scCustomUTF16, the application should implement the OnCompare event handler.

Kind | Description
scCompareString | The collation will use Win32 / Win64 API CompareStringW. The application should specify Flags and Locale properties.
scCustomUTF8 | The collation will use OnCompare event handler. The strings in the event handler will be UTF8 encoded.
scCustomUTF16 | The collation will use OnCompare event handler. The strings in the event handler will be UTF16 encoded.
Syntax
property CollationKind: TADSQLiteCollationKind;
See Also

Flags, Locale, OnCompare

What do you think about this topic? Send feedback!


TADSQLiteCollation.CollationName Property

TADSQLiteCollation.CollationName Property
TADSQLiteCollation Class TADSQLiteCollation Members uADPhysSQLite Namespace published See Also Send Feedback

The unique collation name.

Group

published

Links
TADSQLiteCollation Class, TADSQLiteCollation Members, uADPhysSQLite Namespace, published, See Also
Description

Use the CollationName to specify the collation name. It must be unique across the application. The collation name must follow to the SQLite identifier rules.

Syntax
property CollationName: String;
See Also

CollationKind

What do you think about this topic? Send feedback!


TADSQLiteCollation.Flags Property

TADSQLiteCollation.Flags Property
TADSQLiteCollation Class TADSQLiteCollation Members uADPhysSQLite Namespace published See Also Send Feedback

The scCompareString collation kind collation flags.

Group

published

Links
TADSQLiteCollation Class, TADSQLiteCollation Members, uADPhysSQLite Namespace, published, See Also
Description

Use the Flags property to specify the flags for the CollationKind = scCompareString. The meaning of each flag may be derived from the [image] CompareStringW MSDN documentation, dwCmpFlags parameter description.

Syntax
property Flags: TADSQLiteCollationFlags;
See Also

Locale

What do you think about this topic? Send feedback!


TADSQLiteCollation.Locale Property

TADSQLiteCollation.Locale Property
TADSQLiteCollation Class TADSQLiteCollation Members uADPhysSQLite Namespace published See Also Send Feedback

The scCompareString collation kind collation.

Group

published

Links
TADSQLiteCollation Class, TADSQLiteCollation Members, uADPhysSQLite Namespace, published, See Also
Description

Use the Locale property to specify the locale for the CollationKind = scCompareString. The meaning of this property may be derived from the [image] CompareStringW MSDN documentation, Collate parameter description.

Syntax
property Locale: TADLocalID;
See Also

Flags

What do you think about this topic? Send feedback!


TADSQLiteCollation.OnCompare Property

TADSQLiteCollation.OnCompare Property
TADSQLiteCollation Class TADSQLiteCollation Members uADPhysSQLite Namespace published See Also Send Feedback

The scCustomXxx compare strings event.

Group

published

Links
TADSQLiteCollation Class, TADSQLiteCollation Members, uADPhysSQLite Namespace, published, See Also
Description

Use the OnCompare event handler to compare strings for the CollationKind = scCompareUTF8 or UTF16. The event handler will receive the strings in the specified by CollationKind encodings, should compare them, and return a comparison result in AResult.

Syntax
property OnCompare: TSQLiteCollationEvent;
See Also

CollationKind

What do you think about this topic? Send feedback!


TADSQLiteFunction Class

TADSQLiteFunction Class
published TADSQLiteFunction Members Example 1 Example 2 Classes See Also Send Feedback

The class implementing custom SQLite function.

Group

Classes

Class Hierarchy
  uADPhysSQLite_TADSQLiteFunctionuADPhysSQLite_TADSQLiteFunctionuADPhysSQLite_TADSQLiteFunction
File

uADPhysSQLite

Links
published, TADSQLiteFunction Members, Example 1, Example 2, Classes, See Also
Description

Use the TADSQLiteFunction to register a custom SQLite function. A registered function then may be used in any place in SQL command, where an expression may be used.

Syntax
TADSQLiteFunction = class(TADSQLiteService);
See Also

Using SQLite with FireDAC

Example 1
ADSQLiteFunction1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteFunction1.FunctionName := 'MyFunc';
ADSQLiteFunction1.ArgumentsCount := 2;
ADSQLiteFunction1.Active := True;
ADSQLiteFunction1.OnCalculate := ADSQLiteFunction1Calculate;

procedure TForm1.ADSQLiteFunction1Calculate(AFunc: TSQLiteFunction;
  AInputs: TSQLiteInputs; AOutput: TSQLiteOutput; var AUserData: TObject);
begin
  AOutput.AsInteger := AInputs[0].AsInteger * AInputs[1].AsInteger;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  // demo query
  ADQuery1.Open('select RegionID, 'MyFunc'(RegionID, 10) from "Region"');
end;
Example 2

See <FireDAC>\Samples\DBMS Specific\SQLite\UserFunction

What do you think about this topic? Send feedback!


TADSQLiteFunction Members

TADSQLiteFunction Members
Events TADSQLiteFunction Class Legend Properties Send Feedback

The following tables list the members exposed by TADSQLiteFunction.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADSQLiteFunction Class

Properties
Property | Description
Active | Activates and registers a function.
Aggregated | Controls the function mode.
ArgumentsCount | The number of formal arguments the function is awaiting.
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
FunctionName | The unique function name.
OnCalculate | The calculate function event.
Links
Events, TADSQLiteFunction Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADSQLiteFunction Class Legend Properties Send Feedback

The published members of the TADSQLiteFunction class are listed here.

Class

TADSQLiteFunction Class

Properties
Property | Description
Active | Activates and registers a function.
Aggregated | Controls the function mode.
ArgumentsCount | The number of formal arguments the function is awaiting.
FunctionName | The unique function name.
OnCalculate | The calculate function event.
Links
TADSQLiteFunction Class, Legend, Properties
What do you think about this topic? Send feedback!


TADSQLiteFunction.Active Property

TADSQLiteFunction.Active Property
TADSQLiteFunction Class TADSQLiteFunction Members uADPhysSQLite Namespace published Send Feedback

Activates and registers a function.

Group

published

Links
TADSQLiteFunction Class, TADSQLiteFunction Members, uADPhysSQLite Namespace, published
Description

Use the Active property to activate the function and register it with SQLite engine.

All active connections may use this function. Setting Active to False will unregister the function. Note, that SQLite actually has problems with function un-registration. So, in general, leave the function registered until application finish.

Changing any of the function properties will set Active to False.

Syntax
property Active;
What do you think about this topic? Send feedback!


TADSQLiteFunction.Aggregated Property

TADSQLiteFunction.Aggregated Property
TADSQLiteFunction Class TADSQLiteFunction Members uADPhysSQLite Namespace published Send Feedback

Controls the function mode.

Group

published

Links
TADSQLiteFunction Class, TADSQLiteFunction Members, uADPhysSQLite Namespace, published
Description

Use the Aggregated property to specify is the function scalar or aggregated one. The default value is False.

Syntax
property Aggregated: Boolean;
What do you think about this topic? Send feedback!


TADSQLiteFunction.ArgumentsCount Property

TADSQLiteFunction.ArgumentsCount Property
TADSQLiteFunction Class TADSQLiteFunction Members uADPhysSQLite Namespace published See Also Send Feedback

The number of formal arguments the function is awaiting.

Group

published

Links
TADSQLiteFunction Class, TADSQLiteFunction Members, uADPhysSQLite Namespace, published, See Also
Description

Use the ArgumentsCount to specify the number of arguments, which the function will receive. The arguments are unnamed and untyped. Important is the number of arguments only.

To create a custom function with the default or different number of arguments you will need to specify the same FunctionName and different number of arguments. That will register overloaded functions inside the SQLite engine.

Syntax
property ArgumentsCount: Integer;
See Also

FunctionaName, OnCalculate

What do you think about this topic? Send feedback!


TADSQLiteFunction.FunctionName Property

TADSQLiteFunction.FunctionName Property
TADSQLiteFunction Class TADSQLiteFunction Members uADPhysSQLite Namespace published See Also Send Feedback

The unique function name.

Group

published

Links
TADSQLiteFunction Class, TADSQLiteFunction Members, uADPhysSQLite Namespace, published, See Also
Description

Use the FunctionName to specify the function name. The function name must follow to the SQLite identifier rules.

To create a custom function with the default or different number of arguments you will need to specify the same FunctionName and different number of arguments. That will register overloaded functions inside the SQLite engine.

Syntax
property FunctionName: String;
See Also

ArgumentCount, OnCalculate

What do you think about this topic? Send feedback!


TADSQLiteFunction.OnCalculate Property

TADSQLiteFunction.OnCalculate Property
TADSQLiteFunction Class TADSQLiteFunction Members uADPhysSQLite Namespace published See Also Send Feedback

The calculate function event.

Group

published

Links
TADSQLiteFunction Class, TADSQLiteFunction Members, uADPhysSQLite Namespace, published, See Also
Description

Use the OnCalculate event handler to calculate the function result. The event handler will receive an array of arguments in AInputs parameter. The event handler should return a result using the AOutput parameter.

Syntax
property OnCalculate: TSQLiteFunctionCalculateEvent;
See Also

ArgumentsCount, OnFinalize

What do you think about this topic? Send feedback!


TADSQLiteRTree Class

TADSQLiteRTree Class
published TADSQLiteRTree Members Classes See Also Send Feedback

The class implementing custom SQLite RTree module.

Group

Classes

Class Hierarchy
  uADPhysSQLite_TADSQLiteRTreeuADPhysSQLite_TADSQLiteRTreeuADPhysSQLite_TADSQLiteRTree
File

uADPhysSQLite

Links
published, TADSQLiteRTree Members, Classes, See Also
Description

Use the TADSQLiteRTree to register a custom SQLite RTree module. A registered RTree then may be used MATCH SQL operator ( [image] more).

Syntax
TADSQLiteRTree = class(TADSQLiteService);
See Also

Using SQLite with FireDAC

What do you think about this topic? Send feedback!


TADSQLiteRTree Members

TADSQLiteRTree Members
Events TADSQLiteRTree Class Legend Properties Send Feedback

The following tables list the members exposed by TADSQLiteRTree.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADSQLiteRTree Class

Properties
Property | Description
Active | Activates and registers a RTree.
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
OnCalculate | The RTree match event.
RTreeName | The unique RTree module name.
Links
Events, TADSQLiteRTree Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADSQLiteRTree Class Legend Properties Send Feedback

The published members of the TADSQLiteRTree class are listed here.

Class

TADSQLiteRTree Class

Properties
Property | Description
Active | Activates and registers a RTree.
OnCalculate | The RTree match event.
RTreeName | The unique RTree module name.
Links
TADSQLiteRTree Class, Legend, Properties
What do you think about this topic? Send feedback!


TADSQLiteRTree.Active Property

TADSQLiteRTree.Active Property
TADSQLiteRTree Class TADSQLiteRTree Members uADPhysSQLite Namespace published Send Feedback

Activates and registers a RTree.

Group

published

Links
TADSQLiteRTree Class, TADSQLiteRTree Members, uADPhysSQLite Namespace, published
Description

Use the Active property to activate the RTree and register it with SQLite engine.

All active connections may use this RTree. Setting Active to False will unregister the RTree.

Changing any of the RTree properties will set Active to False.

Syntax
property Active;
What do you think about this topic? Send feedback!


TADSQLiteRTree.OnCalculate Property

TADSQLiteRTree.OnCalculate Property
TADSQLiteRTree Class TADSQLiteRTree Members uADPhysSQLite Namespace published See Also Send Feedback

The RTree match event.

Group

published

Links
TADSQLiteRTree Class, TADSQLiteRTree Members, uADPhysSQLite Namespace, published, See Also
Description

Use the OnCalculate event handler to match the coordinates to the RTree MATCH operator. The event handler will receive an array of parameters in AParams parameter and record coordinates in AColumns parameter. The event handler should return a result using the AResult parameter.

Syntax
property OnCalculate: TSQLiteRTreeCalculateEvent;
See Also

OnFinalize

What do you think about this topic? Send feedback!


TADSQLiteRTree.RTreeName Property

TADSQLiteRTree.RTreeName Property
TADSQLiteRTree Class TADSQLiteRTree Members uADPhysSQLite Namespace published See Also Send Feedback

The unique RTree module name.

Group

published

Links
TADSQLiteRTree Class, TADSQLiteRTree Members, uADPhysSQLite Namespace, published, See Also
Description

Use the RTreeName to specify the RTree module name. The RTree name must follow to the SQLite identifier rules.

Syntax
property RTreeName: String;
See Also

OnCalculate

What do you think about this topic? Send feedback!


TADSQLiteSecurity Class

TADSQLiteSecurity Class
public published TADSQLiteSecurity Members Example 1 Example 2 Example 3 Classes See Also Send Feedback

The class allowing to manage SQLite database encryption.

Group

Classes

Class Hierarchy
  uADPhysSQLite_TADSQLiteSecurityuADPhysSQLite_TADSQLiteSecurityuADPhysSQLite_TADSQLiteSecurity
File

uADPhysSQLite

Links
public, published, TADSQLiteSecurity Members, Example 1, Example 2, Example 3, Classes, See Also
Description

Use the TADSQLiteSecurity component to add a SQLite database security management capabilities to an application.

To manage a security an application should:

  • specify DriverLink;
  • specify Database and Password;
  • optionally specify ToPassword;
  • optionally include soSetLargeCache into Options;
  • call SetPassword / RemovePassword / ChangePassword / CheckEncryption method.
Syntax
TADSQLiteSecurity = class(TADSQLiteService);
See Also

Using SQLite with FireDAC

Example 1

Sets password and encrypts the unencrypted database:

ADSQLiteSecurity1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteSecurity1.Database := 'c:\addemo.sdb';
ADSQLiteSecurity1.Password := '12345';
ADSQLiteSecurity1.SetPassword;
Example 2

Decrypts the encrypted database:

ADSQLiteSecurity1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteSecurity1.Database := 'c:\addemo.sdb';
ADSQLiteSecurity1.Password := '12345';
ADSQLiteSecurity1.RemovePassword;
Example 3

Changes the encrypted database password:

ADSQLiteSecurity1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteSecurity1.Database := 'c:\addemo.sdb';
ADSQLiteSecurity1.Password := '12345';
ADSQLiteSecurity1.ToPassword := 'qwerty';
ADSQLiteSecurity1.ChangePassword;
What do you think about this topic? Send feedback!


TADSQLiteSecurity Members

TADSQLiteSecurity Members
Events TADSQLiteSecurity Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADSQLiteSecurity.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADSQLiteSecurity Class

Methods
Method | Description
ChangePassword | Changes the password for encrypted database.
CheckEncryption | Returns the database encryption status.
RemovePassword | Removes the password and decrypts the database.
SetPassword | Adds the password and encrypts the database.
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | A database file name.
DriverLink | Specifies the DriverLink.
Options | The encryption options.
Password | The database password.
ToPassword | The database password change to.
Links
Events, TADSQLiteSecurity Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADSQLiteSecurity Class Legend Methods Send Feedback

The public members of the TADSQLiteSecurity class are listed here.

Class

TADSQLiteSecurity Class

Methods
Method | Description
ChangePassword | Changes the password for encrypted database.
CheckEncryption | Returns the database encryption status.
RemovePassword | Removes the password and decrypts the database.
SetPassword | Adds the password and encrypts the database.
Links
TADSQLiteSecurity Class, Legend, Methods
What do you think about this topic? Send feedback!


TADSQLiteSecurity.ChangePassword Method

TADSQLiteSecurity.ChangePassword Method
TADSQLiteSecurity Class TADSQLiteSecurity Members uADPhysSQLite Namespace public See Also Send Feedback

Changes the password for encrypted database.

Group

public

Links
TADSQLiteSecurity Class, TADSQLiteSecurity Members, uADPhysSQLite Namespace, public, See Also
Description

Use the ChangePassword method to change a password for an encrypted database from Password to ToPassword. To perform the operation both properties must be specified.

See SetPassword article for additional considerations.

Syntax
procedure ChangePassword;
See Also

Database, Password, ToPassword, Options, SetPassword

What do you think about this topic? Send feedback!


TADSQLiteSecurity.CheckEncryption Method

TADSQLiteSecurity.CheckEncryption Method
TADSQLiteSecurity Class TADSQLiteSecurity Members uADPhysSQLite Namespace public See Also Send Feedback

Returns the database encryption status.

Group

public

Links
TADSQLiteSecurity Class, TADSQLiteSecurity Members, uADPhysSQLite Namespace, public, See Also
Description

Use the CheckEncryption method to get a database status. To perform the operation Database and optionally Password must be specified. The Password must be specified if a database is encrypted. Function returns:

Value
Description
<unencrypted>
A database is not encrypted.
One of the encryption modes.
For example: aes-256.
A database is encrypted and correct password is specified.
<encrypted>
  • A database is probably encrypted, but the specified password is not correct.
  • A file is not a SQLite database.
empty string
Some other error happened at encryption checking.
Syntax
function CheckEncryption: String;
See Also

Database, Password

What do you think about this topic? Send feedback!


TADSQLiteSecurity.RemovePassword Method

TADSQLiteSecurity.RemovePassword Method
TADSQLiteSecurity Class TADSQLiteSecurity Members uADPhysSQLite Namespace public See Also Send Feedback

Removes the password and decrypts the database.

Group

public

Links
TADSQLiteSecurity Class, TADSQLiteSecurity Members, uADPhysSQLite Namespace, public, See Also
Description

Use the RemovePassword method to remove a password and decrypt an encrypted database. To perform operation the Password must be specified.

See SetPassword article for additional considerations.

Syntax
procedure RemovePassword;
See Also

Database, Password, Options, SetPassword

What do you think about this topic? Send feedback!


TADSQLiteSecurity.SetPassword Method

TADSQLiteSecurity.SetPassword Method
TADSQLiteSecurity Class TADSQLiteSecurity Members uADPhysSQLite Namespace public See Also Send Feedback

Adds the password and encrypts the database.

Group

public

Links
TADSQLiteSecurity Class, TADSQLiteSecurity Members, uADPhysSQLite Namespace, public, See Also
Description

Use the SetPassword method to add a password and encrypt an unencrypted database. To perform operation the Password must be specified.

That is good practice before the SetPassword call to perform:

  • backup the original database file, using TADSQLiteBackup or "by hands";
  • verify the original database file, using TADSQLiteValidate.CheckOnly. Do not encrypt database, if there are errors.

Note, due to current SQLite encryption limitation SetPassword call will fail, when database has blob fields with value size greater than 1 DB page, and database does not fit into SQLite cache. In this case, further access to encrypted database will return "database disk image is malformed" error. In this case:

  • restore the original database from backup;
  • include soSetLargeCache into Options;
  • perform SetPassword.

Note, the same considerations apply to ChangePassword and RemovePassword calls.

Syntax
procedure SetPassword;
See Also

Database, Password, Options

What do you think about this topic? Send feedback!


published

published
TADSQLiteSecurity Class Legend Properties Send Feedback

The published members of the TADSQLiteSecurity class are listed here.

Class

TADSQLiteSecurity Class

Properties
Property | Description
Database | A database file name.
Options | The encryption options.
Password | The database password.
ToPassword | The database password change to.
Links
TADSQLiteSecurity Class, Legend, Properties
What do you think about this topic? Send feedback!


TADSQLiteSecurity.Database Property

TADSQLiteSecurity.Database Property
TADSQLiteSecurity Class TADSQLiteSecurity Members uADPhysSQLite Namespace published See Also Send Feedback

A database file name.

Group

published

Links
TADSQLiteSecurity Class, TADSQLiteSecurity Members, uADPhysSQLite Namespace, published, See Also
Description

Use the Database property to specify the SQLite database file name. The file name may include $(<variable>) markers, where variable is a name of environment variable.

Syntax
property Database: String;
See Also

List here...

What do you think about this topic? Send feedback!


TADSQLiteSecurity.Options Property

TADSQLiteSecurity.Options Property
TADSQLiteSecurity Class TADSQLiteSecurity Members uADPhysSQLite Namespace published See Also Send Feedback

The encryption options.

Group

published

Links
TADSQLiteSecurity Class, TADSQLiteSecurity Members, uADPhysSQLite Namespace, published, See Also
Description

Use the Options property to specify the database encryption options.

Option | Descryption
soSetLargeCache | Due to current SQLite encryption limitation SetPassword / ChangePassword / RemovePassword calls will fail, when database has blob fields with value size greater than 1 DB page, and database does not fit into SQLite cache. When soSetLargeCache is set, then SetPassword / ChangePassword / RemovePassword will automatically set cache size greater than DB size, to fit database into memory in full. When DB size is greater than accessible system memory, then corresponding call will fail.
Syntax
property Options: TADSQLiteSecurityOptions;
See Also

SetPassword, ChangePassword, RemovePassword

What do you think about this topic? Send feedback!


TADSQLiteSecurity.Password Property

TADSQLiteSecurity.Password Property
TADSQLiteSecurity Class TADSQLiteSecurity Members uADPhysSQLite Namespace published See Also Send Feedback

The database password.

Group

published

Links
TADSQLiteSecurity Class, TADSQLiteSecurity Members, uADPhysSQLite Namespace, published, See Also
Description

Use the Password to specify a current or initial password for the encrypt / decrypt operations.

Syntax
property Password: String;
See Also

ToPassword

What do you think about this topic? Send feedback!


TADSQLiteSecurity.ToPassword Property

TADSQLiteSecurity.ToPassword Property
TADSQLiteSecurity Class TADSQLiteSecurity Members uADPhysSQLite Namespace published See Also Send Feedback

The database password change to.

Group

published

Links
TADSQLiteSecurity Class, TADSQLiteSecurity Members, uADPhysSQLite Namespace, published, See Also
Description

Use the ToPassword to specify a new password for the ChangePassword operation.

Syntax
property ToPassword: String;
See Also

ChangePassword

What do you think about this topic? Send feedback!


TADSQLiteService Class

TADSQLiteService Class
published TADSQLiteService Members Classes Send Feedback

The base class for all SQLite service classes.

Group

Classes

Class Hierarchy
  uADPhysSQLite_TADSQLiteServiceuADPhysSQLite_TADSQLiteService
File

uADPhysSQLite

Links
published, TADSQLiteService Members, Classes
Description

The TADSQLiteService class is used as a base class for all SQLite service classes and should not be used directly. The class contains the common properties, like the DriverLink.

Syntax
TADSQLiteService = class(TADPhysDriverService);
What do you think about this topic? Send feedback!


TADSQLiteService Members

TADSQLiteService Members
Events TADSQLiteService Class Legend Properties Send Feedback

The following tables list the members exposed by TADSQLiteService.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
Class

TADSQLiteService Class

Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
Links
Events, TADSQLiteService Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADSQLiteService Class Legend Properties Send Feedback

The published members of the TADSQLiteService class are listed here.

Class

TADSQLiteService Class

Properties
Property | Description
DriverLink | Specifies the DriverLink.
Links
TADSQLiteService Class, Legend, Properties
What do you think about this topic? Send feedback!


TADSQLiteService.DriverLink Property

TADSQLiteService.DriverLink Property
TADSQLiteService Class TADSQLiteService Members uADPhysSQLite Namespace published Send Feedback

Specifies the DriverLink.

Group

published

Links
TADSQLiteService Class, TADSQLiteService Members, uADPhysSQLite Namespace, published
Description

Use the DriverLink property to specify the driver link. This property must be specified for any service operation.

Syntax
property DriverLink: TADPhysSQLiteDriverLink;
What do you think about this topic? Send feedback!


TADSQLiteValidate Class

TADSQLiteValidate Class
public published TADSQLiteValidate Members Example Classes Send Feedback

The class implementing SQLite database validate service.

Group

Classes

Class Hierarchy
  uADPhysSQLite_TADSQLiteValidateuADPhysSQLite_TADSQLiteValidateuADPhysSQLite_TADSQLiteValidate
File

uADPhysSQLite

Links
public, published, TADSQLiteValidate Members, Example, Classes
Description

Use the TADSQLiteValidate component to add a database validate capability to an application. This is a programmatic method to invoke the specific SQLite PRAGMA and other commands.

To validate a database an application should:

  • specify DriverLink;
  • specify Database - a database file to validate;
  • call Analyze, CheckOnly or Sweep method.

To produce a DB validate log an application should use OnProgress event. We recommend to use TADSQLiteValidate, when there is no active connections to a database file.

Syntax
TADSQLiteValidate = class(TADSQLiteService);
Example

Validate database:

procedure TForm1.ADSQLiteValidate1Progress(ASender: TADPhysDriverService; const AMessage: String);
begin
  Memo1.Lines.Add(AMessage);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ADSQLiteValidate1.DriverLink := ADPhysSQLiteDriverLink1;
  ADSQLiteValidate1.Database := 'c:\addemo.sq3';
  ADSQLiteValidate1.OnProgress := Form1Progress;
  Memo1.Lines.Clear;
  if not ADSQLiteValidate1.CheckOnly then
    ShowMessage('Database has problems ! See log for details.')
  else
    ShowMessage('Database is valid');
end;
What do you think about this topic? Send feedback!


TADSQLiteValidate Members

TADSQLiteValidate Members
Events TADSQLiteValidate Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADSQLiteValidate.

Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the SQLite feedback.
Class

TADSQLiteValidate Class

Methods
Method | Description
Analyze | Starts the statistics gathering task.
CheckOnly | Starts the read-only validate database task.
Sweep | Starts the sweep task.
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to validate.
DriverLink | Specifies the DriverLink.
MaxErrors | Specifies the maximum number of errors.
Options | Specifies validate options.
Password | Specifies a password to database to validate.
Links
Events, TADSQLiteValidate Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADSQLiteValidate Class Legend Methods Send Feedback

The public members of the TADSQLiteValidate class are listed here.

Class

TADSQLiteValidate Class

Methods
Method | Description
Analyze | Starts the statistics gathering task.
CheckOnly | Starts the read-only validate database task.
Sweep | Starts the sweep task.
Links
TADSQLiteValidate Class, Legend, Methods
What do you think about this topic? Send feedback!


TADSQLiteValidate.Analyze Method

TADSQLiteValidate.Analyze Method
TADSQLiteValidate Class TADSQLiteValidate Members uADPhysSQLite Namespace public See Also Send Feedback

Starts the statistics gathering task.

Group

public

Links
TADSQLiteValidate Class, TADSQLiteValidate Members, uADPhysSQLite Namespace, public, See Also
Parameters
Parameters | Description
const ATable: String = '' | A database table name.
const AIndex: String = '' | A database index name.
Description

Use the Analyze method to start the database statistics gathering task.

To perform a statistics gathering task an application must specify the connection parameters and Database. This is a programmatic method to invoke the ANALYZE command. Depending on the specified arguments the method modes are:

  • AIndex only - analyzes the specified index.
  • ATable only - analyzes all indexes for the specified table.
  • None specified - analyzes all indexes for all tables in the database.
Syntax
procedure Analyze(const ATable: String = ''; const AIndex: String = '');
See Also

CheckOnly, Sweep

What do you think about this topic? Send feedback!


TADSQLiteValidate.CheckOnly Method

TADSQLiteValidate.CheckOnly Method
TADSQLiteValidate Class TADSQLiteValidate Members uADPhysSQLite Namespace public See Also Send Feedback

Starts the read-only validate database task.

Group

public

Links
TADSQLiteValidate Class, TADSQLiteValidate Members, uADPhysSQLite Namespace, public, See Also
Description

Use the CheckOnly method to start the read-only validate database task.

To perform a validation task an application must specify the connection parameters and Database. This is a programmatic method to invoke the PRAGMA integrity_check command. CheckOnly method returns True, when database has no errors or warning, otherwise - False. To receive the found issues use the OnProgress event handler.

Syntax
function CheckOnly: Boolean;
See Also

Analyze, Sweep, OnProgress

What do you think about this topic? Send feedback!


TADSQLiteValidate.Sweep Method

TADSQLiteValidate.Sweep Method
TADSQLiteValidate Class TADSQLiteValidate Members uADPhysSQLite Namespace public See Also Send Feedback

Starts the sweep task.

Group

public

Links
TADSQLiteValidate Class, TADSQLiteValidate Members, uADPhysSQLite Namespace, public, See Also
Description

Use the Sweep method to start the database sweep task.

To perform a sweep task an application must specify the connection parameters and Database. This is a programmatic method to invoke the VACUUM command.

Syntax
procedure Sweep;
See Also

Analyze, CheckOnly

What do you think about this topic? Send feedback!


published

published
Events TADSQLiteValidate Class Legend Properties Send Feedback

The published members of the TADSQLiteValidate class are listed here.

Events
Event | Description
OnProgress | Specifies the event handler allowing to handle the SQLite feedback.
Class

TADSQLiteValidate Class

Properties
Property | Description
Database | Specifies a database file to validate.
MaxErrors | Specifies the maximum number of errors.
Options | Specifies validate options.
Password | Specifies a password to database to validate.
Links
Events, TADSQLiteValidate Class, Legend, Properties
What do you think about this topic? Send feedback!


TADSQLiteValidate.Database Property

TADSQLiteValidate.Database Property
TADSQLiteValidate Class TADSQLiteValidate Members uADPhysSQLite Namespace published Send Feedback

Specifies a database file to validate.

Group

published

Links
TADSQLiteValidate Class, TADSQLiteValidate Members, uADPhysSQLite Namespace, published
Description

Use the Database property to specify a path of the database file to validate.

Syntax
property Database: String;
What do you think about this topic? Send feedback!


TADSQLiteValidate.MaxErrors Property

TADSQLiteValidate.MaxErrors Property
TADSQLiteValidate Class TADSQLiteValidate Members uADPhysSQLite Namespace published See Also Send Feedback

Specifies the maximum number of errors.

Group

published

Links
TADSQLiteValidate Class, TADSQLiteValidate Members, uADPhysSQLite Namespace, published, See Also
Description

Use the MaxErrors property to specify maximum number of errors for CheckOnly method. If database validation task will discover more errors, then validation will stop. The default value is -1, what means unlimited number of errors.

Syntax
property MaxErrors: Integer;
See Also

CheckOnly

What do you think about this topic? Send feedback!


TADSQLiteValidate.OnProgress Event

TADSQLiteValidate.OnProgress Event
TADSQLiteValidate Class TADSQLiteValidate Members uADPhysSQLite Namespace published Send Feedback

Specifies the event handler allowing to handle the SQLite feedback.

Group

published

Links
TADSQLiteValidate Class, TADSQLiteValidate Members, uADPhysSQLite Namespace, published
Description

Use the OnProgress event handler to handle the SQLite feedback, produced by the CheckOnly method.

Syntax
property OnProgress: TADPhysServiceProgressEvent;
What do you think about this topic? Send feedback!


TADSQLiteValidate.Options Property

TADSQLiteValidate.Options Property
TADSQLiteValidate Class TADSQLiteValidate Members uADPhysSQLite Namespace published See Also Send Feedback

Specifies validate options.

Group

published

Links
TADSQLiteValidate Class, TADSQLiteValidate Members, uADPhysSQLite Namespace, published, See Also
Description

Use the Options property to specify additional options controlling the validate task. The default value is [voCheckIndexes]. The Options are used only by CheckOnly method.

Option | Description
voCheckIndexes | When included, then CheckOnly performs also validation of indexes for matching to the table datas. That corresponds to PRAGMA integrity_check. When excluded that corresponds to PRAGMA quick_check.
Syntax
property Options: TADSQLiteValidateOptions;
See Also

CheckOnly

What do you think about this topic? Send feedback!


TADSQLiteValidate.Password Property

TADSQLiteValidate.Password Property
TADSQLiteValidate Class TADSQLiteValidate Members uADPhysSQLite Namespace published Send Feedback

Specifies a password to database to validate.

Group

published

Links
TADSQLiteValidate Class, TADSQLiteValidate Members, uADPhysSQLite Namespace, published
Description

Use the Password property to specify a database password. The password will be used for all operations with encrypted database.

Syntax
property Password: String;
What do you think about this topic? Send feedback!


uADPhysSQLiteVDataSet Namespace

uADPhysSQLiteVDataSet Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains SQLite based Local SQL engine.

Classes
Class | Description
TADLocalSQL | The class implementing the SQLite based Local SQL engine.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysSQLiteVDataSet unit contains:

  • SQLite based Local SQL engine implementation;
  • TADLocalSQL - component representing Local SQL API.
See Also

Local SQL

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysSQLiteVDataSet Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADLocalSQL | The class implementing the SQLite based Local SQL engine.
Namespace

uADPhysSQLiteVDataSet Namespace

Links
Classes, uADPhysSQLiteVDataSet Namespace, Legend
What do you think about this topic? Send feedback!


TADLocalSQL Class

TADLocalSQL Class
published TADLocalSQL Members Example Classes See Also Send Feedback

The class implementing the SQLite based Local SQL engine.

Group

Classes

Class Hierarchy
  uADPhysSQLiteVDataSet_TADLocalSQLuADPhysSQLiteVDataSet_TADLocalSQL
File

uADPhysSQLiteVDataSet

Links
published, TADLocalSQL Members, Example, Classes, See Also
Description

The TADLocalSQL class implements SQLite based Local SQL engine.

The Connection property points to a SQLite connection object which will provide ability to execute the Local SQL commands. To activate engine set Active to True.

FireDAC datasets may be registered with the engine by setting their LocalSQL properties. FireDAC and Non-FireDAC datasets may be registered with the engine using TADLocalSQL.DataSets collection property. To remove dataset delete corresponding collection item. To dynamically discover and register datasets use OnGetDataSet event handler.

To group dataset objects into a schema set SchemaName property. To disable dataset cloning or copying set MultipleCursors property to False. To enable events of a TDataSource associated with a base dataset set DisableControls to False. To exclude invisible fields from Local SQL result sets set IncludeHiddenFields to False.

Syntax
TADLocalSQL = class(TADCustomLocalSQL);
See Also

Local SQL, Executing Command

Example
ADConnection1.DriverName := 'SQLite';
ADLocalSQL1.Connection := ADConnection1;
ADLocalSQL1.SchemaName := 'orders';
ADLocalSQL1.DataSets.Add.DataSet := adoQOrders;
ADLocalSQL1.DataSets.Add.DataSet := qDetails;

ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select * from orders.adoQOrders o left join orders.qDetails d on o.OrderID = d.OrderID');
What do you think about this topic? Send feedback!


TADLocalSQL Members

TADLocalSQL Members
Events TADLocalSQL Class Legend Properties Send Feedback

The following tables list the members exposed by TADLocalSQL.

Events
Event | Description
OnGetDataSet | The event firing when Local SQL engine looks for a dataset object.
OnReadDataSet | The event firing when Local SQL is going to read a dataset object.
Class

TADLocalSQL Class

Properties
Property | Description
Active | Activates Local SQL engine.
Connection | Specifies the FireDAC connection component to use.
DataSets | Collection of the registered datasets.
DisableControls | Controls dataset DisableControls / EnableControls calls.
IncludeHiddenFields | Controls inclusion of invisible and hidden fields into Local SQL result sets.
MultipleCursors | Controls dataset cloning and copying.
SchemaName | Set schema name for datasets.
Links
Events, TADLocalSQL Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
Events TADLocalSQL Class Legend Properties Send Feedback

The published members of the TADLocalSQL class are listed here.

Events
Event | Description
OnGetDataSet | The event firing when Local SQL engine looks for a dataset object.
OnReadDataSet | The event firing when Local SQL is going to read a dataset object.
Class

TADLocalSQL Class

Properties
Property | Description
Active | Activates Local SQL engine.
Connection | Specifies the FireDAC connection component to use.
DataSets | Collection of the registered datasets.
DisableControls | Controls dataset DisableControls / EnableControls calls.
IncludeHiddenFields | Controls inclusion of invisible and hidden fields into Local SQL result sets.
MultipleCursors | Controls dataset cloning and copying.
SchemaName | Set schema name for datasets.
Links
Events, TADLocalSQL Class, Legend, Properties
What do you think about this topic? Send feedback!


TADLocalSQL.Active Property

TADLocalSQL.Active Property
TADLocalSQL Class TADLocalSQL Members uADPhysSQLiteVDataSet Namespace published See Also Send Feedback

Activates Local SQL engine.

Group

published

Links
TADLocalSQL Class, TADLocalSQL Members, uADPhysSQLiteVDataSet Namespace, published, See Also
Description

Set Active property to True to activate Local SQL engine and add registered datasets to Local SQL namespace. Set Active to False to remove datasets from Local SQL namespace and deactivate Local SQL engine. Local SQL queries may be performed only when Active is True and connection is active too.

When application needs to perform massive Local SQL configuration tasks, like to add a set of datasets, remove set of datasets, etc, then it is recommended first set Active to False. And when a task is finished set Active to True.

Active may be set to False only when there is no active / prepared SQL commands using this Local SQL.

Syntax
property Active: Boolean;
See Also

Local SQL, Connection

What do you think about this topic? Send feedback!


TADLocalSQL.Connection Property

TADLocalSQL.Connection Property
TADLocalSQL Class TADLocalSQL Members uADPhysSQLiteVDataSet Namespace published See Also Send Feedback

Specifies the FireDAC connection component to use.

Group

published

Links
TADLocalSQL Class, TADLocalSQL Members, uADPhysSQLiteVDataSet Namespace, published, See Also
Description

Use Connection to specify an FireDAC connection connected to a SQLite database. This connection will be used to publish registered datasets and execute Local SQL commands.

Syntax
property Connection: TADCustomConnection;
See Also

Local SQL, Active

What do you think about this topic? Send feedback!


TADLocalSQL.DataSets Property

TADLocalSQL.DataSets Property
TADLocalSQL Class TADLocalSQL Members uADPhysSQLiteVDataSet Namespace Example published See Also Send Feedback

Collection of the registered datasets.

Group

published

Links
TADLocalSQL Class, TADLocalSQL Members, uADPhysSQLiteVDataSet Namespace, Example, published, See Also
Description

Use DataSets collection property to manage the datasets registered with this Local SQL engine.

FireDAC datasets may be added to the collection implicitly by setting TADAdaptedDataSet.LocalSQL property. Non-FireDAC and FireDAC datasets may be added explicitly by adding new items to DataSets collection. To remove a dataset from the list of registered datasets, remove corresponding item from the DataSets collection. The datasets may be added or removed as at design time, as at run time.

All datasets in collection must have unique names. When item Name property is specified, then it is used as a dataset name. If not specified, then TDataSet.Name value will be used.

Syntax
property DataSets: TADLocalSQLDataSets;
See Also

Local SQL, TADAdaptedDataSet.LocalSQL, TADLocalSQLDataSets, TADLocalSQLDataSet

Example
ADLocalSQL1.DataSets.Add.DataSet := ADOQuery1;
ADLocalSQL1.DataSets.Add.DataSet := ADOQuery2;
ADQuery1.LocalSQL := ADLocalSQL1;
ADQuery2.LocalSQL := ADLocalSQL1;
What do you think about this topic? Send feedback!


TADLocalSQL.DisableControls Property

TADLocalSQL.DisableControls Property
TADLocalSQL Class TADLocalSQL Members uADPhysSQLiteVDataSet Namespace published Send Feedback

Controls dataset DisableControls / EnableControls calls.

Group

published

Links
TADLocalSQL Class, TADLocalSQL Members, uADPhysSQLiteVDataSet Namespace, published
Description

Use DisableControls property to control the dataset DisableControls / EnableControls calls.

When DisableControls is True, then FireDAC will call DisableControls before creating a cursor for the dataset. And will call EnableControls, when the cursor will be released.

Syntax
property DisableControls: Boolean;
What do you think about this topic? Send feedback!


TADLocalSQL.IncludeHiddenFields Property

TADLocalSQL.IncludeHiddenFields Property
TADLocalSQL Class TADLocalSQL Members uADPhysSQLiteVDataSet Namespace published Send Feedback

Controls inclusion of invisible and hidden fields into Local SQL result sets.

Group

published

Links
TADLocalSQL Class, TADLocalSQL Members, uADPhysSQLiteVDataSet Namespace, published
Description

Use IncludeHiddenFields property to control the inclusion of the base dataset fields with TField.Visible = False or pfHidden in TField.ProviderFlags into the Local SQL result sets.

When it is True, then such fields will be included into the result sets in similar way to other fields. When it is False, then the invisible fields will be:

  • not listed in the dataset returned by "PRAGMA table_info";
  • not included in the expansion of a "*" expression in the result set of a SELECT;
  • not included in the implicit column-list used by an INSERT statement that lacks an explicit column-list.
Syntax
property IncludeHiddenFields: Boolean;
What do you think about this topic? Send feedback!


TADLocalSQL.MultipleCursors Property

TADLocalSQL.MultipleCursors Property
TADLocalSQL Class TADLocalSQL Members uADPhysSQLiteVDataSet Namespace published Send Feedback

Controls dataset cloning and copying.

Group

published

Links
TADLocalSQL Class, TADLocalSQL Members, uADPhysSQLiteVDataSet Namespace, published
Description

Use MultipleCursors property to control the dataset cloning and copying.

SQLite creates a cursor to handle a request to a specific dataset for each reference in a Local SQL command. Because TDataSet API does not allow to navigate through TDataSet simultaneously in different cursors, FireDAC clones an FireDAC dataset using TADMemTable, and copies a non-FireDAC dataset into TADMemTable. Then this TADMemTable is used to implement the cursor. The copying is time consuming operation.

When developer is sure, that each dataset registered with Local SQL engine will be used not more than by a single cursor in each moment of time, then to avoid copying / cloning set MultipleCursors to False. When MultipleCursors is False and Local SQL engine needs additional cursors to the same dataset, then exception will be raised.

Note, due to SQLite engine limitations, an join operation with an unidirectional dataset, may lead to bad performance when MultipleCursors is False.

Syntax
property MultipleCursors: Boolean;
What do you think about this topic? Send feedback!


TADLocalSQL.OnGetDataSet Event

TADLocalSQL.OnGetDataSet Event
TADLocalSQL Class TADLocalSQL Members uADPhysSQLiteVDataSet Namespace published See Also Send Feedback

The event firing when Local SQL engine looks for a dataset object.

Group

published

Links
TADLocalSQL Class, TADLocalSQL Members, uADPhysSQLiteVDataSet Namespace, published, See Also
Description

Use OnGetDataSet event handler to submit a dataset object by its name.

This event may be used to provide a dataset dynamically without registering it first with the Local SQL engine. The value of AName argument and ADataSet.Name may be different. After returning a dataset, it will be registered in DataSets collection under AName argument value.

The event handler must return ADataSet, AAdapter or both arguments assigned. For FireDAC datasets the ADataSet may be assigned only. For non-FireDAC datasets is recommended to assign both arguments.

Syntax
property OnGetDataSet: TADGetDatasetEvent;
See Also

Local SQL, DataSets, OnReadDataSet

What do you think about this topic? Send feedback!


TADLocalSQL.OnReadDataSet Event

TADLocalSQL.OnReadDataSet Event
TADLocalSQL Class TADLocalSQL Members uADPhysSQLiteVDataSet Namespace published See Also Send Feedback

The event firing when Local SQL is going to read a dataset object.

Group

published

Links
TADLocalSQL Class, TADLocalSQL Members, uADPhysSQLiteVDataSet Namespace, published, See Also
Description

Use OnReadDataSet event handler to setup a dataset object before it will be read.

This event may be used to set parameter or macro values. Or even to change the SQL command text. If a dataset is inactive, then Local SQL will activate it right after the event handler call.

Syntax
property OnReadDataSet: TADReadDatasetEvent;
See Also

Local SQL, OnGetDataSet

What do you think about this topic? Send feedback!


TADLocalSQL.SchemaName Property

TADLocalSQL.SchemaName Property
TADLocalSQL Class TADLocalSQL Members uADPhysSQLiteVDataSet Namespace published Send Feedback

Set schema name for datasets.

Group

published

Links
TADLocalSQL Class, TADLocalSQL Members, uADPhysSQLiteVDataSet Namespace, published
Description

Use SchemaName property to set a schema name to logically group datasets registered with this engine into a namespace.

The schema names of all TADLocalSQL's connected to the same connection object and all attached database names in the same connection must be unique. FireDAC does not control the uniqueness.

When SchemaName is specified, then the dataset may be referenced in a SQL as <dataset> or <schema>.<dataset>. If the specified <schema> does not exist, then exception will be raised.

Syntax
property SchemaName: String;
What do you think about this topic? Send feedback!


uADPhysTDBX Namespace

uADPhysTDBX Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains dbExpress v 4 bridge driver.

Classes
Class | Description
TADPhysTDBXDriverLink | Use the TADPhysTDBXDriverLink component to link the dbExpress v 4 bridge driver to an application.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysTDBX unit contains:

  • dbExpress v 4 bridge driver implementation;
  • TADPhysTDBXDriverLink - component to link the driver.
See Also

Configuring Drivers, Connect to dbExpress data source

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysTDBX Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADPhysTDBXDriverLink | Use the TADPhysTDBXDriverLink component to link the dbExpress v 4 bridge driver to an application.
Namespace

uADPhysTDBX Namespace

Links
Classes, uADPhysTDBX Namespace, Legend
What do you think about this topic? Send feedback!


TADPhysTDBXDriverLink Class

TADPhysTDBXDriverLink Class
Classes See Also Send Feedback

Use the TADPhysTDBXDriverLink component to link the dbExpress v 4 bridge driver to an application.

Group

Classes

Class Hierarchy
  uADPhysTDBX_TADPhysTDBXDriverLink
File

uADPhysTDBX

Links
Classes, See Also
Description

Use the TADPhysTDBXDriverLink component to link the dbExpress v 4 bridge driver to an application. In general it is enough to only include uADPhysTDBX unit into your application uses clause.

TADPhysTDBXDriverLink does not use VendorLib and VendorHome properties in the current FireDAC version.

Syntax
TADPhysTDBXDriverLink = class(TADPhysTDBXBaseDriverLink);
See Also

Configuring Drivers, Connect to dbExpress data source

What do you think about this topic? Send feedback!


uADPhysTDBXBase Namespace

uADPhysTDBXBase Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains FireDAC driver base classes for all TDBX based drivers.

Classes
Class | Description
ETDBXNativeException | Represents exception class for all TDBX based drivers.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADPhysODBCBase unit contains FireDAC driver base implementation classes for all TDBX based drivers.

See Also

uADPhysTDBX Namespace, uADPhysDataSnap Namespace

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADPhysTDBXBase Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
ETDBXNativeException | Represents exception class for all TDBX based drivers.
Namespace

uADPhysTDBXBase Namespace

Links
Classes, uADPhysTDBXBase Namespace, Legend
What do you think about this topic? Send feedback!


ETDBXNativeException Class

ETDBXNativeException Class
Classes See Also Send Feedback

Represents exception class for all TDBX based drivers.

Group

Classes

Class Hierarchy
  uADPhysTDBXBase_ETDBXNativeExceptionuADPhysTDBXBase_ETDBXNativeExceptionuADPhysTDBXBase_ETDBXNativeException
File

uADPhysTDBXBase

Links
Classes, See Also
Description

The ETDBXNativeException class represents the exception class for all TDBX based drivers, including TDBX and DataSnap.

Syntax
ETDBXNativeException = class(EADDBEngineException);
See Also

EADDBEngineException

What do you think about this topic? Send feedback!


uADStanError Namespace

uADStanError Namespace
Classes FireDAC Legend See Also Topics Send Feedback

Contains error classes - EADException, EADDBEngineException, etc

Classes
Class | Description
EADDBArrayExecuteError | EADDBArrayExecuteError is used as an Array DML error description item.
EADDBEngineException | EADDBEngineException is the base exception class for all FireDAC DBMS related errors.
EADException | EADException is the base exception class for all FireDAC exceptions.
TADDBError | TADDBError represents FireDAC / DBMS errors, warnings and messages for the EADDBEngineException exception class.
Group

FireDAC

Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Links
Classes, FireDAC, Legend, See Also, Topics
Description

The uADStanError contains error describing base classes:

  • EADException - base class for all FireDAC exceptions;
  • EADDBEngineException - base class for all FireDAC DBMS exceptions;
  • TADDBError - base class for a DBMS exception error item
See Also

Handling Errors

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADStanError Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
EADDBArrayExecuteError | EADDBArrayExecuteError is used as an Array DML error description item.
EADDBEngineException | EADDBEngineException is the base exception class for all FireDAC DBMS related errors.
EADException | EADException is the base exception class for all FireDAC exceptions.
TADDBError | TADDBError represents FireDAC / DBMS errors, warnings and messages for the EADDBEngineException exception class.
Namespace

uADStanError Namespace

Links
Classes, uADStanError Namespace, Legend
What do you think about this topic? Send feedback!


EADDBArrayExecuteError Class

EADDBArrayExecuteError Class
public EADDBArrayExecuteError Members Classes Send Feedback

EADDBArrayExecuteError is used as an Array DML error description item.

Group

Classes

Class Hierarchy
  uADStanError_EADDBArrayExecuteErroruADStanError_EADDBArrayExecuteError
File

uADStanError

Links
public, EADDBArrayExecuteError Members, Classes
Description

An EADDBArrayExecuteError object is used as an Array DML error description argument of the appropriate event handlers.

Syntax
EADDBArrayExecuteError = class(EADException);
What do you think about this topic? Send feedback!


EADDBArrayExecuteError Members

EADDBArrayExecuteError Members
EADDBArrayExecuteError Class Legend Properties Send Feedback

The following tables list the members exposed by EADDBArrayExecuteError.

Class

EADDBArrayExecuteError Class

Properties
Property | Description
Action | Specifies an error processor action.
ADCode | Returns an FireDAC specific error code.
ADObjName | Returns object name raised the exception.
Exception | Returns a reference to the original exception object.
Offset | Returns an offset of a failed array item from the array beginning.
RetryLevel | Returns a number of a retry operation.
Times | Returns a number of the array items remained to process in the array after the error has happened.
Links
EADDBArrayExecuteError Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
EADDBArrayExecuteError Class Legend Properties Send Feedback

The public members of the EADDBArrayExecuteError class are listed here.

Class

EADDBArrayExecuteError Class

Properties
Property | Description
Action | Specifies an error processor action.
Exception | Returns a reference to the original exception object.
Offset | Returns an offset of a failed array item from the array beginning.
RetryLevel | Returns a number of a retry operation.
Times | Returns a number of the array items remained to process in the array after the error has happened.
Links
EADDBArrayExecuteError Class, Legend, Properties
What do you think about this topic? Send feedback!


EADDBArrayExecuteError.Action Property

EADDBArrayExecuteError.Action Property
EADDBArrayExecuteError Class EADDBArrayExecuteError Members uADStanError Namespace public Send Feedback

Specifies an error processor action.

Group

public

Links
EADDBArrayExecuteError Class, EADDBArrayExecuteError Members, uADStanError Namespace, public
Description

Use Action to specify an action, that error processor should take after return from event handler.

Syntax
property Action: TADErrorAction;
What do you think about this topic? Send feedback!


EADDBArrayExecuteError.Exception Property

EADDBArrayExecuteError.Exception Property
EADDBArrayExecuteError Class EADDBArrayExecuteError Members uADStanError Namespace public Send Feedback

Returns a reference to the original exception object.

Group

public

Links
EADDBArrayExecuteError Class, EADDBArrayExecuteError Members, uADStanError Namespace, public
Description

Use Exception property to get a reference to the original exception object, which was raised after erroneous DB operation.

Syntax
property Exception: EADDBEngineException;
What do you think about this topic? Send feedback!


EADDBArrayExecuteError.Offset Property

EADDBArrayExecuteError.Offset Property
EADDBArrayExecuteError Class EADDBArrayExecuteError Members uADStanError Namespace public Send Feedback

Returns an offset of a failed array item from the array beginning.

Group

public

Links
EADDBArrayExecuteError Class, EADDBArrayExecuteError Members, uADStanError Namespace, public
Description

Use the Offset property to get an offset of a failed array item from the array beginning.

Syntax
property Offset: LongInt;
What do you think about this topic? Send feedback!


EADDBArrayExecuteError.RetryLevel Property

EADDBArrayExecuteError.RetryLevel Property
EADDBArrayExecuteError Class EADDBArrayExecuteError Members uADStanError Namespace public Send Feedback

Returns a number of a retry operation.

Group

public

Links
EADDBArrayExecuteError Class, EADDBArrayExecuteError Members, uADStanError Namespace, public
Description

Use a RetryLevel to get a number of a retry operation. The number will be incremented after each eaSkip Action value.

Syntax
property RetryLevel: Integer;
What do you think about this topic? Send feedback!


EADDBArrayExecuteError.Times Property

EADDBArrayExecuteError.Times Property
EADDBArrayExecuteError Class EADDBArrayExecuteError Members uADStanError Namespace public Send Feedback

Returns a number of the array items remained to process in the array after the error has happened.

Group

public

Links
EADDBArrayExecuteError Class, EADDBArrayExecuteError Members, uADStanError Namespace, public
Description

Use the Time property value to get a number of the array items remained to process in the array after the error has happened.

Syntax
property Times: LongInt;
What do you think about this topic? Send feedback!


EADDBEngineException Class

EADDBEngineException Class
public EADDBEngineException Members Example Classes See Also Send Feedback

EADDBEngineException is the base exception class for all FireDAC DBMS related errors.

Group

Classes

Class Hierarchy
  uADStanError_EADDBEngineExceptionuADStanError_EADDBEngineException
File

uADStanError

Links
public, EADDBEngineException Members, Example, Classes, See Also
Description

An EDBEngineException object is used as:

  • an exception object, raised when a DBMS operation produces an error condition;
  • an object describing a warning, stored at connection when a DBMS operation produces an warning condition;
  • and object representing a message, stored at connection when a DBMS operation sends a message to a client.

Its Errors property contains TADDBError objects. Each of them corresponds to a single error, warning or message item, produced inside of a single DBMS operation. The Kind property returns DBMS-independent error kind. The SQL and Params properties allows to get a failed SQL command.

All FireDAC drivers are implementing own EADDBEngineException descendant classes. For example, MySQL driver implements EMySQLNativeException exception class.

Use a TADGUIxErrorDialog dialog to display the complete information about FireDAC / DBMS error.

Syntax
EADDBEngineException = class(EADException);
See Also

Handling Errors, TADDBError, EADException

Example
uses
  uADStanError;
......
try
  ADQuery1.ExecSQL;
except
  on E: EADDBEngineException do
    if E.Kind = ekUKViolated then begin
      ShowMessage('The record must be unique');
      Abort;
    end;
end;
What do you think about this topic? Send feedback!


EADDBEngineException Members

EADDBEngineException Members
EADDBEngineException Class Legend Properties Send Feedback

The following tables list the members exposed by EADDBEngineException.

Class

EADDBEngineException Class

Properties
Property | Description
ADCode | Returns an FireDAC specific error code.
ADObjName | Returns object name raised the exception.
ErrorCode | Returns a DBMS specific error code.
ErrorCount | Indicates the total number of errors contained in the Errors property.
Errors | Lists the entire FireDAC / DBMS error, warning or message collection.
Kind | Returns a DBMS-independent error kind.
Params | Return a failed SQL command parameter values.
SQL | Return a failed SQL command text.
Links
EADDBEngineException Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
EADDBEngineException Class Legend Properties Send Feedback

The public members of the EADDBEngineException class are listed here.

Class

EADDBEngineException Class

Properties
Property | Description
ErrorCode | Returns a DBMS specific error code.
ErrorCount | Indicates the total number of errors contained in the Errors property.
Errors | Lists the entire FireDAC / DBMS error, warning or message collection.
Kind | Returns a DBMS-independent error kind.
Params | Return a failed SQL command parameter values.
SQL | Return a failed SQL command text.
Links
EADDBEngineException Class, Legend, Properties
What do you think about this topic? Send feedback!


EADDBEngineException.ErrorCode Property

EADDBEngineException.ErrorCode Property
EADDBEngineException Class EADDBEngineException Members uADStanError Namespace public See Also Send Feedback

Returns a DBMS specific error code.

Group

public

Links
EADDBEngineException Class, EADDBEngineException Members, uADStanError Namespace, public, See Also
Description

Use the ErrorCode property to read a DBMS specific error code.

This property return value of the ErrorCode property of the first item in Errors collection.

Syntax
property ErrorCode: Integer;
See Also

TADDBError.Kind, TADDBError.ErrorCode

What do you think about this topic? Send feedback!


EADDBEngineException.ErrorCount Property

EADDBEngineException.ErrorCount Property
EADDBEngineException Class EADDBEngineException Members uADStanError Namespace public See Also Send Feedback

Indicates the total number of errors contained in the Errors property.

Group

public

Links
EADDBEngineException Class, EADDBEngineException Members, uADStanError Namespace, public, See Also
Description

Use ErrorCount as an upper bound when iterating through the errors in the error collection.

Syntax
property ErrorCount: Integer;
See Also

Errors

What do you think about this topic? Send feedback!


EADDBEngineException.Errors Property

EADDBEngineException.Errors Property
EADDBEngineException Class EADDBEngineException Members uADStanError Namespace Example public See Also Send Feedback

Lists the entire FireDAC / DBMS error, warning or message collection.

Group

public

Links
EADDBEngineException Class, EADDBEngineException Members, uADStanError Namespace, Example, public, See Also
Description

Use Errors to read TADDBError objects.

Each object corresponds to an error, warning or message returned by a DBMS. In many cases there will be only single object. although some DBMS's, like a Microsoft SQL Server, may return few messages.

The first error has an index value of 0. The last error has an index value of ErrorCount-1. The property is default array property. So, you can avoid it.

Syntax
property Errors [Index: Integer]: TADDBError;
See Also

TADDBError, ErrorCount

Example
try
   ADQuery1.ExecSQL;
except
  on E: EADDBEngineException do
    for i := 0 to E.ErrorCount - 1 do
      Memo1.Lines.Add(E[i].Message);
end;
What do you think about this topic? Send feedback!


EADDBEngineException.Kind Property

EADDBEngineException.Kind Property
EADDBEngineException Class EADDBEngineException Members uADStanError Namespace Example public See Also Send Feedback

Returns a DBMS-independent error kind.

Group

public

Links
EADDBEngineException Class, EADDBEngineException Members, uADStanError Namespace, Example, public, See Also
Description

Use the Kind property to read a DBMS-independent error kind.

This property return value of the Kind property of the first item in Errors collection.

Syntax
property Kind: TADCommandExceptionKind;
See Also

TADDBError.Kind, TADDBError.ErrorCode

Example
try
  ADConnection1.Connected := True;
except
  on E: EADDBEngineException do
    if E.Kind = ekUserPwdInvalid then begin
      ShowMessage('A user name or a password are invalid');
      Abort;
    end;
end;
What do you think about this topic? Send feedback!


EADDBEngineException.Params Property

EADDBEngineException.Params Property
EADDBEngineException Class EADDBEngineException Members uADStanError Namespace public See Also Send Feedback

Return a failed SQL command parameter values.

Group

public

Links
EADDBEngineException Class, EADDBEngineException Members, uADStanError Namespace, public, See Also
Description

Use Params property value to get a failed SQL command parameter values.

This property together with the SQL property may be used for the debugging purposes.

Syntax
property Params: TStrings;
See Also

SQL

What do you think about this topic? Send feedback!


EADDBEngineException.SQL Property

EADDBEngineException.SQL Property
EADDBEngineException Class EADDBEngineException Members uADStanError Namespace Example public See Also Send Feedback

Return a failed SQL command text.

Group

public

Links
EADDBEngineException Class, EADDBEngineException Members, uADStanError Namespace, Example, public, See Also
Description

Use SQL property value to get a SQL command text, for which DBMS returned an error.

This property together with the Params property may be used for the debugging purposes.

Syntax
property SQL: String;
See Also

Params

Example
try
  Log('Removing records');
  ADQuery1.ExecSQL('delete from tab');
  ....
  Log('Inserting records');
  ADQuery1.ExecSQL('insert into tab ...');
except
  on E: EADDBEngineException do begin
    Log(E.Message);
    Log('Failed SQL: ' + E.SQL);
    Log('Failed params: ' + E.Params.Text);
    raise;
  end;
end;
What do you think about this topic? Send feedback!


EADException Class

EADException Class
public EADException Members Classes See Also Send Feedback

EADException is the base exception class for all FireDAC exceptions.

Group

Classes

Class Hierarchy
  uADStanError_EADException
File

uADStanError

Links
public, EADException Members, Classes, See Also
Description

The EADException class is used as the base class for the EADDBEngineException class (DBMS specific errors) and as a class for all DBMS unspecific errors.

Syntax
EADException = class(EDatabaseError);
See Also

EADDBEngineException

What do you think about this topic? Send feedback!


EADException Members

EADException Members
EADException Class Legend Properties Send Feedback

The following tables list the members exposed by EADException.

Class

EADException Class

Properties
Property | Description
ADCode | Returns an FireDAC specific error code.
ADObjName | Returns object name raised the exception.
Links
EADException Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
EADException Class Legend Properties Send Feedback

The public members of the EADException class are listed here.

Class

EADException Class

Properties
Property | Description
ADCode | Returns an FireDAC specific error code.
ADObjName | Returns object name raised the exception.
Links
EADException Class, Legend, Properties
What do you think about this topic? Send feedback!


EADException.ADCode Property

EADException.ADCode Property
EADException Class EADException Members uADStanError Namespace public Send Feedback

Returns an FireDAC specific error code.

Group

public

Links
EADException Class, EADException Members, uADStanError Namespace, public
Description

Use ADCode property to get an FireDAC specific error code. This code allows to identify an error condition discovered by the FireDAC code.

Syntax
property ADCode: Integer;
What do you think about this topic? Send feedback!


EADException.ADObjName Property

EADException.ADObjName Property
EADException Class EADException Members uADStanError Namespace public Send Feedback

Returns object name raised the exception.

Group

public

Links
EADException Class, EADException Members, uADStanError Namespace, public
Description

Use ADObjName property to get the name of an object raised the exception. The name is like <form name>.<query name>, and is useful for debugging purposes, allowing to identify an object raised the exception.

Syntax
property ADObjName: String;
What do you think about this topic? Send feedback!


TADDBError Class

TADDBError Class
public TADDBError Members Classes See Also Send Feedback

TADDBError represents FireDAC / DBMS errors, warnings and messages for the EADDBEngineException exception class.

Group

Classes

Class Hierarchy
  uADStanError_TADDBError
File

uADStanError

Links
public, TADDBError Members, Classes, See Also
Description

The TADDBError object is a container for the information pertaining to one database error, warning or message. One or more TADDBError objects are contained in the Errors property of the EADDBEngineException object.

Each item is represented by the:

  • Message - actually error message. For the DBMS messages only Message property is used;
  • ErrorCode - DBMS specific error code;
  • Kind - DBMS independent error code and other properties;
  • RowIndex - index of failed row in an Array DML operation, etc.

Some of the FireDAC drivers are implementing own TADDBError descendant classes. For example, Microsoft SQL Server driver implements TADMSSQLError class with four additional properties.

Syntax
TADDBError = class(TObject);
See Also

EADDBEngineException

What do you think about this topic? Send feedback!


TADDBError Members

TADDBError Members
TADDBError Class Legend Properties Send Feedback

The following tables list the members exposed by TADDBError.

Class

TADDBError Class

Properties
Property | Description
CommandTextOffset | Returns offset from a SQL command text beginning.
ErrorCode | Returns a DBMS specific error code.
Kind | Returns a DBMS independent error kind.
Level | Number of a TADDBError item.
Message | Returns a error, warning or message text.
ObjName | Returns a DBMS object name, participating in an error or warning.
RowIndex | Returns a row index, where an error has happened.
Links
TADDBError Class, Legend, Properties
What do you think about this topic? Send feedback!


public

public
TADDBError Class Legend Properties Send Feedback

The public members of the TADDBError class are listed here.

Class

TADDBError Class

Properties
Property | Description
CommandTextOffset | Returns offset from a SQL command text beginning.
ErrorCode | Returns a DBMS specific error code.
Kind | Returns a DBMS independent error kind.
Level | Number of a TADDBError item.
Message | Returns a error, warning or message text.
ObjName | Returns a DBMS object name, participating in an error or warning.
RowIndex | Returns a row index, where an error has happened.
Links
TADDBError Class, Legend, Properties
What do you think about this topic? Send feedback!


TADDBError.CommandTextOffset Property

TADDBError.CommandTextOffset Property
TADDBError Class TADDBError Members uADStanError Namespace public See Also Send Feedback

Returns offset from a SQL command text beginning.

Group

public

Links
TADDBError Class, TADDBError Members, uADStanError Namespace, public, See Also
Description

Use the CommandTextOffset to get an offset from a SQL command text beginning, where a DBMS failed to parse a SQL command.

This property is greater than or equal to zero for syntax errors and is equal to -1 for other errors. Note, that it is not applied to an original SQL command text, like a TADQuery.SQL. But to a SQL command text sent to a DBMS, like a TADCustomQuery.Text.

Syntax
property CommandTextOffset: Integer;
See Also

TADCustomQuery.Text, TADCustomCommand.SQLText

What do you think about this topic? Send feedback!


TADDBError.ErrorCode Property

TADDBError.ErrorCode Property
TADDBError Class TADDBError Members uADStanError Namespace public See Also Send Feedback

Returns a DBMS specific error code.

Group

public

Links
TADDBError Class, TADDBError Members, uADStanError Namespace, public, See Also
Description

Use ErrorCode to read a DBMS specific error code. For example, for Oracle ORA-00942 "Table or view does not exists" error, the ErrorCode will be equal to 942.

Also, you can use the Kind property value to use DBMS independent error kind. Note, that Kind is much more limited in the error condition description, than ErrorCode.

Syntax
property ErrorCode: Integer;
See Also

Kind, Message

What do you think about this topic? Send feedback!


TADDBError.Kind Property

TADDBError.Kind Property
TADDBError Class TADDBError Members uADStanError Namespace public See Also Send Feedback

Returns a DBMS independent error kind.

Group

public

Links
TADDBError Class, TADDBError Members, uADStanError Namespace, public, See Also
Description

Use the Kind property to get a DBMS independent error kind. For example, for Oracle ORA-00942 "Table or view does not exists" error, the Kind will be equal to ekObjNotExists.

Also, you can use the ErrorCode property value to use DBMS specific error code. Note, that Kind is much more limited in the error condition description, than ErrorCode.

Syntax
property Kind: TADCommandExceptionKind;
See Also

ErrorCode, Message

What do you think about this topic? Send feedback!


TADDBError.Level Property

TADDBError.Level Property
TADDBError Class TADDBError Members uADStanError Namespace public Send Feedback

Number of a TADDBError item.

Group

public

Links
TADDBError Class, TADDBError Members, uADStanError Namespace, public
Description

Use Level property to get a number of a TADDBError item among other items in the EADDBEngineException.Errors collection.

Syntax
property Level: Integer;
What do you think about this topic? Send feedback!


TADDBError.Message Property

TADDBError.Message Property
TADDBError Class TADDBError Members uADStanError Namespace public See Also Send Feedback

Returns a error, warning or message text.

Group

public

Links
TADDBError Class, TADDBError Members, uADStanError Namespace, public, See Also
Description

Use the Message property to get a error, warning or message text, returned by a DBMS.

This text does not have the FireDAC prefix '[FireDAC]....'.

Syntax
property Message: String;
See Also

ObjName, ErrorCode

What do you think about this topic? Send feedback!


TADDBError.ObjName Property

TADDBError.ObjName Property
TADDBError Class TADDBError Members uADStanError Namespace public See Also Send Feedback

Returns a DBMS object name, participating in an error or warning.

Group

public

Links
TADDBError Class, TADDBError Members, uADStanError Namespace, public, See Also
Description

Use the ObjName property value to get a DBMS object name participating in an error or a warning.

The ObjName property value is extracted from the error message text. Depending on the DBMS and the error, the value may be a table name in the "object is not found" error, a constraint name in the "contraint violated" error, etc. Note, that some DBMS's does not return any object name as part of an error message. Then ObjName will be empty.

Syntax
property ObjName: String;
See Also

Message, ErrorCode, Kind

What do you think about this topic? Send feedback!


TADDBError.RowIndex Property

TADDBError.RowIndex Property
TADDBError Class TADDBError Members uADStanError Namespace public See Also Send Feedback

Returns a row index, where an error has happened.

Group

public

Links
TADDBError Class, TADDBError Members, uADStanError Namespace, public, See Also
Description

Use the RowIndex property to get a row index in an Array DML operation, where a DBMS has encountered an error condition.

If an error or a warning belongs to the full operation or an operation was not an Array DML operation, then RowIndex property value be equal to -1. Otherwise it will be greater than or equal to an AOffset property value of an Execute method call.

Note, that some DBMS for some Array DML operations cannot produce correct RowIndex value, then it will be equal to -1.

Syntax
property RowIndex: Integer;
See Also

Array DML

What do you think about this topic? Send feedback!


uADStanOption Namespace

uADStanOption Namespace
Classes FireDAC Legend See Also Structs, Records, Enums Topics Send Feedback

Contains option classes - TADFetchOptions, TADUpdateOptions, etc.

Classes
Class | Description
TADBottomResourceOptions | The set of options controlling dataset persistence.
TADBottomUpdateOptions | The set of options controlling dataset editing and updates posting.
TADCustomOptions | The base class for all option classes.
TADEventAlerterOptions | The set of options controlling event alerter behaviour.
TADFetchOptions | The set of options controlling data and metadata fetching.
TADFormatOptions | The set of options controlling representation of fetched or sending data.
TADMapRule | TADMapRule represents a maintained client view to records in an FireDAC dataset...
TADMapRules | TADMapRules is a collection of TADMapRule objects.
TADResourceOptions | The set of options controlling SQL command preprocessor, command execution and dataset persistence.
TADTopResourceOptions | The set of options controlling SQL automatic connection recover, dataset persistence and server output.
TADTxOptions | The set of options controlling transaction behaviour.
TADUpdateOptions | The set of options controlling dataset editing and updates posting.
Group

FireDAC

Structs, Records, Enums
Struct, Record, Enum | Description
TADActionRequest | The enumerated type lists all possible FireDAC requests to a database.
TADAutoFetchAll | Add a short summary here...
Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Structs, Records, Enums | The following table lists structs, records, enums in this documentation.
Links
Classes, FireDAC, Legend, See Also, Structs, Records, Enums, Topics
Description

The uADStanOption unit contains option classes:

  • TADFetchOptions - result set fetching options;
  • TADUpdateOptions - options controlling data editing and updates posting;
  • TADFormatOptions - options controlling database data representation;
  • TADResourceOptions - command / dataset general behavior, persistence and resource usage options;
  • TADTxOptions - transaction control options;
  • etc
See Also

Setting Options

What do you think about this topic? Send feedback!


Classes

Classes
Classes uADStanOption Namespace Legend Send Feedback

The following table lists classes in this documentation.

Classes
Class | Description
TADBottomResourceOptions | The set of options controlling dataset persistence.
TADBottomUpdateOptions | The set of options controlling dataset editing and updates posting.
TADCustomOptions | The base class for all option classes.
TADEventAlerterOptions | The set of options controlling event alerter behaviour.
TADFetchOptions | The set of options controlling data and metadata fetching.
TADFormatOptions | The set of options controlling representation of fetched or sending data.
TADMapRule | TADMapRule represents a maintained client view to records in an FireDAC dataset...
TADMapRules | TADMapRules is a collection of TADMapRule objects.
TADResourceOptions | The set of options controlling SQL command preprocessor, command execution and dataset persistence.
TADTopResourceOptions | The set of options controlling SQL automatic connection recover, dataset persistence and server output.
TADTxOptions | The set of options controlling transaction behaviour.
TADUpdateOptions | The set of options controlling dataset editing and updates posting.
Namespace

uADStanOption Namespace

Links
Classes, uADStanOption Namespace, Legend
What do you think about this topic? Send feedback!


TADBottomResourceOptions Class

TADBottomResourceOptions Class
public published TADBottomResourceOptions Members Classes See Also Send Feedback

The set of options controlling dataset persistence.

Group

Classes

Class Hierarchy
  uADStanOption_TADBottomResourceOptionsuADStanOption_TADBottomResourceOptionsuADStanOption_TADBottomResourceOptions
File

uADStanOption

Links
public, published, TADBottomResourceOptions Members, Classes, See Also
Description

The TADBottomResourceOptions class represents the set of properties controlling persistence of datasets:

  • PersistentFileName.

The TADBottomResourceOptions is terminal class in resource options classes hierarchy. The TADCustomCommand and TADDataSet use TADBottomResourceOptions.

Syntax
TADBottomResourceOptions = class(TADResourceOptions);
See Also

Setting Options, TADCustomCommand.ResourceOptions, TADQuery.ResourceOptions

What do you think about this topic? Send feedback!


TADBottomResourceOptions Members

TADBottomResourceOptions Members
TADBottomResourceOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADBottomResourceOptions.

Class

TADBottomResourceOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
ResolveFileName | Returns actual persistent dataset file name.
RestoreDefaults | Restore option default values.
Properties
Property | Description
ActualSilentMode | Returns actual silent mode a dataset will use.
ArrayDMLSize | Limits the maximum possible Array DML array size.
AssignedValues | Specifies the set of changed options.
Backup | Controls backup of data file for persistent datasets.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
CmdExecMode | Controls DBMS action execution mode.
CmdExecTimeout | Controls DBMS action execution timeout.
DefaultParamType | Specifies default parameter direction.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
DirectExecute | Controls preparation of SQL statements.
EscapeExpand | Controls processing of escape sequences.
MacroCreate | Controls automatic filling of Macros collection.
MacroExpand | Controls expansion of macros.
ParamCreate | Controls automatic filling of Params collection.
ParamExpand | Controls expansion of parameters.
Persistent | Controls dataset persistence.
PersistentFileName | Specifies persistent dataset file name.
PreprocessCmdText | Controls SQL command text preprocessor.
SilentMode | Controls dataset GUI feedback.
StoreItems | Specifies the data to write into the persistent dataset data files or streams.
StoreVersion | Specifies the format version for the persistent dataset data files or streams.
UnifyParams | Controls unification of a stored procedure parameters.
Version | The current version of options.
Links
TADBottomResourceOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADBottomResourceOptions Class Legend Methods Send Feedback

The public members of the TADBottomResourceOptions class are listed here.

Class

TADBottomResourceOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
ResolveFileName | Returns actual persistent dataset file name.
RestoreDefaults | Restore option default values.
Links
TADBottomResourceOptions Class, Legend, Methods
What do you think about this topic? Send feedback!


TADBottomResourceOptions.Assign Method

TADBottomResourceOptions.Assign Method
TADBottomResourceOptions Class TADBottomResourceOptions Members uADStanOption Namespace Example public See Also Send Feedback

Assigns all options of one option object to another.

Group

public

Links
TADBottomResourceOptions Class, TADBottomResourceOptions Members, uADStanOption Namespace, Example, public, See Also
Parameters
Parameters | Description
ASource: TPersistent | A source options object.
Description

Use the Assign method to assign all changed option values of ASource option object to this object. After that corresponding options will stop inheriting the values from more high level option object.

Syntax
procedure Assign(ASource: TPersistent); override;
See Also

RestoreDefaults

Example
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);
What do you think about this topic? Send feedback!


TADBottomResourceOptions.ResolveFileName Method

TADBottomResourceOptions.ResolveFileName Method
TADBottomResourceOptions Class TADBottomResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Returns actual persistent dataset file name.

Group

public

Links
TADBottomResourceOptions Class, TADBottomResourceOptions Members, uADStanOption Namespace, public, See Also
Parameters
Parameters | Description
const AFileName: String = '' | A file name to resolve.
Description

Use ResolveFileName method to resolve AFileName into actual persistent dataset file name.

if AFileName is empty, then will be used TADBottomResourceOptions.PersistentFileName.

If AFileName does not include extension, then will be used TADTopResourceOptions.DefaultStoreExt as an extension. If TADTopResourceOptions.DefaultStoreExt is empty, then an extension will be evaluated from TADTopResourceOptions.DefaultStoreFormat.

If AFileName does not include extension, then will be used TADTopResourceOptions.DefaultStoreFolder as a folder.

At end file name will be expanded by replacing $(NAME) placeholders with corresponding registry or environment variable values.

Syntax
function ResolveFileName(const AFileName: String = ''): String;
See Also

PersistentFileName, TADTopResourceOptions.DefaultStoreExt, TADTopResourceOptions.DefaultStoreFormat, TADTopResourceOptions.DefaultStoreFolder

What do you think about this topic? Send feedback!


TADBottomResourceOptions.RestoreDefaults Method

TADBottomResourceOptions.RestoreDefaults Method
TADBottomResourceOptions Class TADBottomResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Restore option default values.

Group

public

Links
TADBottomResourceOptions Class, TADBottomResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Call RestoreDefaults to reset all changed options to their default values.

Syntax
procedure RestoreDefaults; override;
See Also

AssignedValues

What do you think about this topic? Send feedback!


published

published
TADBottomResourceOptions Class Legend Properties Send Feedback

The published members of the TADBottomResourceOptions class are listed here.

Class

TADBottomResourceOptions Class

Properties
Property | Description
PersistentFileName | Specifies persistent dataset file name.
Links
TADBottomResourceOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


TADBottomResourceOptions.PersistentFileName Property

TADBottomResourceOptions.PersistentFileName Property
TADBottomResourceOptions Class TADBottomResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies persistent dataset file name.

Group

published

Links
TADBottomResourceOptions Class, TADBottomResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use PersistentFileName to specify a persistent dataset file name. The dataset will save / load its content if TADResourceOptions.Persistent is True.

If PersistentFileName does not include extension, then will be used TADTopResourceOptions.DefaultStoreExt as an extension. If TADTopResourceOptions.DefaultStoreExt is empty, then an extension will be evaluated from TADTopResourceOptions.DefaultStoreFormat.

If PersistentFileName does not include extension, then will be used TADTopResourceOptions.DefaultStoreFolder as a folder.

Syntax
property PersistentFileName: string;
See Also

TADResourceOptions.Persistent, TADTopResourceOptions.DefaultStoreExt, TADTopResourceOptions.DefaultStoreFormat, TADTopResourceOptions.DefaultStoreFolder

What do you think about this topic? Send feedback!


TADBottomUpdateOptions Class

TADBottomUpdateOptions Class
public published TADBottomUpdateOptions Members Classes See Also Send Feedback

The set of options controlling dataset editing and updates posting.

Group

Classes

Class Hierarchy
  uADStanOption_TADBottomUpdateOptionsuADStanOption_TADBottomUpdateOptionsuADStanOption_TADBottomUpdateOptions
File

uADStanOption

Links
public, published, TADBottomUpdateOptions Members, Classes, See Also
Description

The TADBottomUpdateOptions class represents the set of properties controlling how FireDAC datasets and DApt Layer adapter interfaces:

  • use database generators and sequences for auto-incrementing fields (AutoIncFields);
  • generate updates posting commands (KeyFields, UpdateTableName).

The TADBottomUpdateOptions is terminal class in update options classes hierarchy. The TADDataSet and DApt Layer adapters use TADBottomUpdateOptions.

Syntax
TADBottomUpdateOptions = class(TADUpdateOptions);
See Also

Setting Options, TADDataSet.UpdateOptions

What do you think about this topic? Send feedback!


TADBottomUpdateOptions Members

TADBottomUpdateOptions Members
TADBottomUpdateOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADBottomUpdateOptions.

Class

TADBottomUpdateOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Properties
Property | Description
AssignedValues | Specifies the set of changed options.
AutoIncFields | Specifies dataset fields, which are auto-incrementing by DBMS.
CheckReadOnly | Controls checking of TField.ReadOnly property.
CheckRequired | Controls checking of TField.Required property.
CheckUpdatable | Controls ability to change a TField value.
CountUpdatedRecords | Controls checking of an updated record count.
EnableDelete | Allows to delete records from dataset.
EnableInsert | Allows to insert records into dataset.
EnableUpdate | Allows to edit records of dataset.
FastUpdates | Controls fast vs secure updates.
FetchGeneratorsPoint | Controls the moment, when next generator value will be fetched.
GeneratorName | Specifies the generator name from which to fetch next value for auto-increment fields.
KeyFields | Specifies dataset primary key fields.
LockMode | Controls how the FireDAC locks database record while editing it.
LockPoint | Controls the moment, when database record will be locked.
LockWait | Controls waiting for pessimistic lock to be acquired.
ReadOnly | Specifies whether the dataset is read-only.
RefreshDelete | Specifies should a dataset delete a record locally when a database record is not found at refreshing.
RefreshMode | Specifies how dataset should refresh record after posting update to it.
RequestLive | Provided for BDE compatibility.
UpdateChangedFields | Controls which fields to include into UPDATE or INSERT command.
UpdateMode | Controls how the FireDAC locates records when posting updates.
UpdateNonBaseFields | Controls should fields from the joined non-base table to be included into UPDATE or INSERT command.
UpdateTableName | Specifies table name to use in SQL commands posting updates.
Version | The current version of options.
Links
TADBottomUpdateOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADBottomUpdateOptions Class Legend Methods Send Feedback

The public members of the TADBottomUpdateOptions class are listed here.

Class

TADBottomUpdateOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Links
TADBottomUpdateOptions Class, Legend, Methods
What do you think about this topic? Send feedback!


TADBottomUpdateOptions.Assign Method

TADBottomUpdateOptions.Assign Method
TADBottomUpdateOptions Class TADBottomUpdateOptions Members uADStanOption Namespace Example public See Also Send Feedback

Assigns all options of one option object to another.

Group

public

Links
TADBottomUpdateOptions Class, TADBottomUpdateOptions Members, uADStanOption Namespace, Example, public, See Also
Parameters
Parameters | Description
ASource: TPersistent | A source options object.
Description

Use the Assign method to assign all changed option values of ASource option object to this object. After that corresponding options will stop inheriting the values from more high level option object.

Syntax
procedure Assign(ASource: TPersistent); override;
See Also

RestoreDefaults

Example
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);
What do you think about this topic? Send feedback!


TADBottomUpdateOptions.RestoreDefaults Method

TADBottomUpdateOptions.RestoreDefaults Method
TADBottomUpdateOptions Class TADBottomUpdateOptions Members uADStanOption Namespace public See Also Send Feedback

Restore option default values.

Group

public

Links
TADBottomUpdateOptions Class, TADBottomUpdateOptions Members, uADStanOption Namespace, public, See Also
Description

Call RestoreDefaults to reset all changed options to their default values.

Syntax
procedure RestoreDefaults; override;
See Also

AssignedValues

What do you think about this topic? Send feedback!


published

published
TADBottomUpdateOptions Class Legend Properties Send Feedback

The published members of the TADBottomUpdateOptions class are listed here.

Class

TADBottomUpdateOptions Class

Properties
Property | Description
AutoIncFields | Specifies dataset fields, which are auto-incrementing by DBMS.
KeyFields | Specifies dataset primary key fields.
UpdateTableName | Specifies table name to use in SQL commands posting updates.
Links
TADBottomUpdateOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


TADBottomUpdateOptions.AutoIncFields Property

TADBottomUpdateOptions.AutoIncFields Property
TADBottomUpdateOptions Class TADBottomUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies dataset fields, which are auto-incrementing by DBMS.

Group

published

Links
TADBottomUpdateOptions Class, TADBottomUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use AutoIncFields to specify ';' separated list of fields, whose values are filled from the generators / sequences. The names must be without quotes and must match to the original result set field names. AutoIncFields must be specified before preparing / opening a dataset.

Specifying AutoIncFields is required when FireDAC cannot determine auto incrementing fields, when:

  • DBMS does not support auto-incremental / identity fields, but supports generators / sequences - Oracle, Firebird and Interbase;
  • DBMS does not return information about auto-incrementing fields correctly.

Setting AutoIncFields sets specified fields attributes to [caAutoInc, caAllowNull]. For dtInt32 and dtUInt32 columns will be created TADAutoIncField fields. TField.Required property will be set to False.

The FetchGeneratorsPoint property controls, how FireDAC fills these field values at client side. The GeneratorName / TADAutoIncField.GeneratorName properties control, from which database generator / sequence FireDAC fills these field values.

Syntax
property AutoIncFields: String;
See Also

Auto-Incremental Fields, FetchGeneratorsPoint, GeneratorName, TADAutoIncField.GeneratorName, TField.AutoGenerateValue

What do you think about this topic? Send feedback!


TADBottomUpdateOptions.KeyFields Property

TADBottomUpdateOptions.KeyFields Property
TADBottomUpdateOptions Class TADBottomUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies dataset primary key fields.

Group

published

Links
TADBottomUpdateOptions Class, TADBottomUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use KeyFields to specify ';' separated list of fields, which compromise primary key for dataset records. The names must be without quotes and must match to the original result set field names. KeyFields must be specified before preparing / opening a dataset.

Specifying KeyFields is required when FireDAC cannot determine primary key fields, when:

  • fiMeta is not included into TADUpdateOptions.Items, for example to raise performance;
  • application needs to edit a result set obtained from a view, tables join or a table without defined primary key;
  • application needs to edit a result set obtained from a stored procedure or from other non-SELECT SQL construction.

Setting KeyFields removes pfInKey from all fields TField.ProviderFlags and includes pfInKey for specifed fields ProviderFlags. Alternatively application can use only pfInKey and TField.ProviderFlags. But not both ways in the same time.

These fields will be used to build record search condition:

  • at posting a record update using UPDATE ... WHERE <record search condition>, when UpdateMode = upWhereKeyOnly or upWhereChanged;
  • at refreshing a record using SELECT ... WHERE <record search condition>.
Syntax
property KeyFields: String;
See Also

Unique Identifying Fields, TField.ProviderFlags

What do you think about this topic? Send feedback!


TADBottomUpdateOptions.UpdateTableName Property

TADBottomUpdateOptions.UpdateTableName Property
TADBottomUpdateOptions Class TADBottomUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies table name to use in SQL commands posting updates.

Group

published

Links
TADBottomUpdateOptions Class, TADBottomUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use UpdateTableName property to specify database table name to use in automatically generated SQL commands. The name may be quoted. UpdateTableName must be specified before preparing / opening a dataset.

Specifying UpdateTableName is required when FireDAC cannot correctly determine a table to post updates to or when application needs:

  • to edit a result set obtained from a view or tables join;
  • to edit a result set obtained from a stored procedure or from other non-SELECT SQL construction;
  • to redirect updates posting to another table, than one specified in the SQL query.
Syntax
property UpdateTableName: String;
See Also

Overriding Posting Updates, Object Names, Update Command Generation

What do you think about this topic? Send feedback!


TADCustomOptions Class

TADCustomOptions Class
public TADCustomOptions Members Classes See Also Send Feedback

The base class for all option classes.

Group

Classes

Class Hierarchy
  uADStanOption_TADCustomOptions
File

uADStanOption

Links
public, TADCustomOptions Members, Classes, See Also
Description

The TADCustomOptions class is a base class for other TADXxxxOptions classes.

A programmer should not use it directly.

Syntax
TADCustomOptions = class(TPersistent);
See Also

TADFetchOptions, TADFormatOptions, TADResourceOptions, TADUpdateOptions

What do you think about this topic? Send feedback!


TADCustomOptions Members

TADCustomOptions Members
TADCustomOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADCustomOptions.

Class

TADCustomOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restores option default values.
Properties
Property | Description
Version | The current version of options.
Links
TADCustomOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADCustomOptions Class Legend Methods Properties Send Feedback

The public members of the TADCustomOptions class are listed here.

Class

TADCustomOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restores option default values.
Properties
Property | Description
Version | The current version of options.
Links
TADCustomOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADCustomOptions.Version Property

TADCustomOptions.Version Property
TADCustomOptions Class TADCustomOptions Members uADStanOption Namespace public Send Feedback

The current version of options.

Group

public

Links
TADCustomOptions Class, TADCustomOptions Members, uADStanOption Namespace, public
Description

Use the Version property to determine were there an option value change or not. If some option was changed, when a code may decide to reprepare a query object or re-execute it or how else. The property value is growing sequentionally, but the step may be greater than one.

Syntax
property Version: Longword;
What do you think about this topic? Send feedback!


TADCustomOptions.Assign Method

TADCustomOptions.Assign Method
TADCustomOptions Class TADCustomOptions Members uADStanOption Namespace Example public See Also Send Feedback

Assigns all options of one option object to another.

Group

public

Links
TADCustomOptions Class, TADCustomOptions Members, uADStanOption Namespace, Example, public, See Also
Parameters
Parameters | Description
ASource: TPersistent | A source options object.
Description

Use the Assign method to assign all changed option values of ASource option object to this object. After that corresponding options will stop inheriting the values from more high level option object.

Syntax
procedure Assign(ASource: TPersistent); override;
See Also

RestoreDefaults

Example
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);
What do you think about this topic? Send feedback!


TADCustomOptions.RestoreDefaults Method

TADCustomOptions.RestoreDefaults Method
TADCustomOptions Class TADCustomOptions Members uADStanOption Namespace Example public Send Feedback

Restores option default values.

Group

public

Links
TADCustomOptions Class, TADCustomOptions Members, uADStanOption Namespace, Example, public
Description

Use the RestoreDefaults method to restore the default values for all options and make them inheritable from more high level options.

Syntax
procedure RestoreDefaults; virtual;
Example
ADQuery1.FetchOptions.RowsetSize := 1000;
ADQuery1.FetchOptions.Mode := fmAll;
ADQuery1.Open('select * from big_table');
....
ADQuery1.FetchOptions.RestoreDefaults;
What do you think about this topic? Send feedback!


TADEventAlerterOptions Class

TADEventAlerterOptions Class
published TADEventAlerterOptions Members Classes See Also Send Feedback

The set of options controlling event alerter behaviour.

Group

Classes

Class Hierarchy
  uADStanOption_TADEventAlerterOptions
File

uADStanOption

Links
published, TADEventAlerterOptions Members, Classes, See Also
Description

The TADEventAlerterOptions class represents the set of properties controlling behavior of an event alerter, represented as the FireDAC component or as the Phys Layer command interface:

  • event alerter kind (Kind);
  • timeout;
  • the event handler thread (Synchronize);
  • events registration mode (AutoRegister).

The event alerter option applying is deferred until events registration.

Syntax
TADEventAlerterOptions = class(TPersistent);
See Also

Database Alerts, TADEventAlerter

What do you think about this topic? Send feedback!


TADEventAlerterOptions Members

TADEventAlerterOptions Members
TADEventAlerterOptions Class Legend Properties Send Feedback

The following tables list the members exposed by TADEventAlerterOptions.

Class

TADEventAlerterOptions Class

Properties
Property | Description
AutoRegister | Controls the automatic registration of the events at a DBMS.
Kind | Specifies the event alerter kind.
Synchronize | Controls the thread, where the alerter event handlers will be executed.
Timeout | Specifies the event alerter timeout.
Links
TADEventAlerterOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADEventAlerterOptions Class Legend Properties Send Feedback

The published members of the TADEventAlerterOptions class are listed here.

Class

TADEventAlerterOptions Class

Properties
Property | Description
AutoRegister | Controls the automatic registration of the events at a DBMS.
Kind | Specifies the event alerter kind.
Synchronize | Controls the thread, where the alerter event handlers will be executed.
Timeout | Specifies the event alerter timeout.
Links
TADEventAlerterOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


TADEventAlerterOptions.AutoRegister Property

TADEventAlerterOptions.AutoRegister Property
TADEventAlerterOptions Class TADEventAlerterOptions Members uADStanOption Namespace published Send Feedback

Controls the automatic registration of the events at a DBMS.

Group

published

Links
TADEventAlerterOptions Class, TADEventAlerterOptions Members, uADStanOption Namespace, published
Description

Set the AutoRegister property to True to enable automatic registration of the event alerter at a DBMS.

Syntax
property AutoRegister: Boolean;
What do you think about this topic? Send feedback!


TADEventAlerterOptions.Kind Property

TADEventAlerterOptions.Kind Property
TADEventAlerterOptions Class TADEventAlerterOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the event alerter kind.

Group

published

Links
TADEventAlerterOptions Class, TADEventAlerterOptions Members, uADStanOption Namespace, published, See Also
Description

Use the Kind property to specify the event alerter implementation kind.

The property value is FireDAC driver dependent. One driver may implement few event alerter's. All of them are identified by the different kinds. To use the driver default event alerter, set Kind to an empty string.

Syntax
property Kind: String;
See Also

Database Alerts, Synchronize

What do you think about this topic? Send feedback!


TADEventAlerterOptions.Synchronize Property

TADEventAlerterOptions.Synchronize Property
TADEventAlerterOptions Class TADEventAlerterOptions Members uADStanOption Namespace published See Also Send Feedback

Controls the thread, where the alerter event handlers will be executed.

Group

published

Links
TADEventAlerterOptions Class, TADEventAlerterOptions Members, uADStanOption Namespace, published, See Also
Description

Set the Synchronize property to True to execute the event alerter handlers in the main thread context. Otherwise the event handlers may be executed in the context of the background thread, servicing the event alerter.

Syntax
property Synchronize: Boolean;
See Also

Database Alerts, Kind, Timeout

What do you think about this topic? Send feedback!


TADEventAlerterOptions.Timeout Property

TADEventAlerterOptions.Timeout Property
TADEventAlerterOptions Class TADEventAlerterOptions Members uADStanOption Namespace published Send Feedback

Specifies the event alerter timeout.

Group

published

Links
TADEventAlerterOptions Class, TADEventAlerterOptions Members, uADStanOption Namespace, published
Description

Use the Timeout to specify the event alerter timeout.

After the specified timeout, if there are no events occurred, the OnTimeout event will be fired. The Timeout property value is in msec's. A value <= 0 means - no timeout.

Syntax
property Timeout: Integer;
What do you think about this topic? Send feedback!


TADFetchOptions Class

TADFetchOptions Class
public published TADFetchOptions Members Classes See Also Send Feedback

The set of options controlling data and metadata fetching.

Group

Classes

Class Hierarchy
  uADStanOption_TADFetchOptionsuADStanOption_TADFetchOptions
File

uADStanOption

Links
public, published, TADFetchOptions Members, Classes, See Also
Description

The TADFetchOptions class represents the set of properties controlling how FireDAC components and Phys Layer command interfaces fetch the data and metadata:

  • how to fetch (CursorKind, Mode, RowsetSize). For example, it is possible to fetch all result set records at once, or fetch records on demand.
  • how to preserve resources (Unidirectional, AutoClose, Cache, AutoFetchAll);
  • how BLOB fields, nested recordsets and metadata to fetch and cache (Items, Cache);
  • master-detail dataset relationship handling (DetailDelay, DetailOptimize, DetailCascade);
  • a rowset paging (RecsMax, RecsSkip);
  • TADTable operation mode (CursorKind, LiveWindowParanoic, LiveWindowFastFirst);
  • how to count records in a dataset (RecordCountMode).
Syntax
TADFetchOptions = class(TADCustomOptions);
See Also

Fetching Rows, Setting Options, Unique Identifying Fields, Master-Detail Relationship, TADCustomManager.FetchOptions, TADCustomConnection.FetchOptions, TADCustomCommand.FetchOptions, TADQuery.FetchOptions, IADPhysCommand.Options

What do you think about this topic? Send feedback!


TADFetchOptions Members

TADFetchOptions Members
TADFetchOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADFetchOptions.

Class

TADFetchOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Properties
Property | Description
ActualRowsetSize | Returns actual rowset size a command will use.
AssignedValues | Specifies the set of changed options.
AutoClose | Controls automatic closing of a dataset cursor after fetching the last record.
AutoFetchAll | Controls automatic fetching of all records from a dataset cursor before disconnecting a command.
Cache | Controls what kind of data to cache in memory.
CursorKind | Specifies type of cursor an FireDAC command or dataset uses.
DetailCascade | Controls propagation of a master dataset changes to a detail dataset in Centralized Cached Updates mode.
DetailDelay | Controls the delay between master dataset scroll and detail dataset refresh.
DetailOptimize | Specifies to refresh detail dataset only when master record is changed.
Items | Controls what kind of data to fetch.
LiveWindowFastFirst | Controls the TADTable live data window fetch optimization mode.
LiveWindowParanoic | Controls the TADTable live data window mode records search mode.
Mode | Controls how to fetch data.
RecordCountMode | Controls how to count records in a result set.
RecsMax | Controls the maximum number of records to be fetched.
RecsSkip | Controls the offset of the first record to be fetched.
RowsetSize | Controls the number of records per single fetch.
Unidirectional | Specifies possible directions of navigation by dataset records.
Version | The current version of options.
Links
TADFetchOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADFetchOptions Class Legend Methods Properties Send Feedback

The public members of the TADFetchOptions class are listed here.

Class

TADFetchOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Properties
Property | Description
ActualRowsetSize | Returns actual rowset size a command will use.
Links
TADFetchOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADFetchOptions.ActualRowsetSize Property

TADFetchOptions.ActualRowsetSize Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace public See Also Send Feedback

Returns actual rowset size a command will use.

Group

public

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, public, See Also
Description

Use ActualRowsetSize to get actual rowset size a command will use.

Actual rowset size depends on Mode. If it is fmExactRecsMax, then actual rowset size will be equal to RecsMax.

Syntax
property ActualRowsetSize: Integer;
See Also

Mode, RecsMax

What do you think about this topic? Send feedback!


TADFetchOptions.Assign Method

TADFetchOptions.Assign Method
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace Example public See Also Send Feedback

Assigns all options of one option object to another.

Group

public

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, Example, public, See Also
Parameters
Parameters | Description
ASource: TPersistent | A source options object.
Description

Use the Assign method to assign all changed option values of ASource option object to this object. After that corresponding options will stop inheriting the values from more high level option object.

Syntax
procedure Assign(ASource: TPersistent); override;
See Also

RestoreDefaults

Example
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);
What do you think about this topic? Send feedback!


TADFetchOptions.RestoreDefaults Method

TADFetchOptions.RestoreDefaults Method
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace public See Also Send Feedback

Restore option default values.

Group

public

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, public, See Also
Description

Call RestoreDefaults to reset all changed options to their default values.

Syntax
procedure RestoreDefaults; override;
See Also

AssignedValues

What do you think about this topic? Send feedback!


published

published
TADFetchOptions Class Legend Properties Send Feedback

The published members of the TADFetchOptions class are listed here.

Class

TADFetchOptions Class

Properties
Property | Description
AssignedValues | Specifies the set of changed options.
AutoClose | Controls automatic closing of a dataset cursor after fetching the last record.
AutoFetchAll | Controls automatic fetching of all records from a dataset cursor before disconnecting a command.
Cache | Controls what kind of data to cache in memory.
CursorKind | Specifies type of cursor an FireDAC command or dataset uses.
DetailCascade | Controls propagation of a master dataset changes to a detail dataset in Centralized Cached Updates mode.
DetailDelay | Controls the delay between master dataset scroll and detail dataset refresh.
DetailOptimize | Specifies to refresh detail dataset only when master record is changed.
Items | Controls what kind of data to fetch.
LiveWindowFastFirst | Controls the TADTable live data window fetch optimization mode.
LiveWindowParanoic | Controls the TADTable live data window mode records search mode.
Mode | Controls how to fetch data.
RecordCountMode | Controls how to count records in a result set.
RecsMax | Controls the maximum number of records to be fetched.
RecsSkip | Controls the offset of the first record to be fetched.
RowsetSize | Controls the number of records per single fetch.
Unidirectional | Specifies possible directions of navigation by dataset records.
Links
TADFetchOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


TADFetchOptions.AssignedValues Property

TADFetchOptions.AssignedValues Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the set of changed options.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use AssignedValues to get / set the set of modified option values.

If some option is changed at this level, then corresponding flag is included into AssignedValues. If flag is not included, then an option value is inherited from more high level. Excluding flag from AssignedValues makes option inheriting its value from more high level.

See Setting Options for more details.

Syntax
property AssignedValues: TADFetchOptionValues;
See Also

RestoreDefaults

What do you think about this topic? Send feedback!


TADFetchOptions.AutoClose Property

TADFetchOptions.AutoClose Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Controls automatic closing of a dataset cursor after fetching the last record.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use AutoClose property value to control the automatic closing of a dataset cursor.

If AutoClose is True and is fetched the last record from the current result set, then the underlying cursor will be closed, all additional not yet processed result sets will be discarded and resources associated with the cursors will be released to the DBMS. The dataset (TADDataSet descendant) itself will be not closed, but will be closed its internal command object. That allows to release cursor related DBMS resource as fast as it is possible.

If your SQL command returns the few result sets, and you need to process all of them, then you must set AutoClose to False. Otherwise after processing of the first result set, all other result sets will be discarded.

The default value is True.

Syntax
property AutoClose: Boolean;
See Also

Mode, TADAdaptedDataSet.NextRecordSet, IADPhysCommand.NextRecordSet

What do you think about this topic? Send feedback!


TADFetchOptions.AutoFetchAll Property

TADFetchOptions.AutoFetchAll Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Controls automatic fetching of all records from a dataset cursor before disconnecting a command.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use AutoFetchAll property to control automatic fetching of all records from a dataset cursor before disconnecting an associated command. The default value is afAll. A command may be disconnected, when one of the following occurs:

  • A connection object will be set to offline mode.
  • When amount of active commands on the same connection object is greater than TADTopResourceOptions.MaxCursors, then less used commands will be disconnected.
  • On some DBMS's before a transaction, where a cursor was opened, will be committed.

The property may have values:

Value | Description
afAll | FetchAll method will be called.
afTruncate | Fetching from the cursor will be finished. Previously fetched records will be preserved.
afDisable | Raise an exception, if not all records are fetched.
Syntax
property AutoFetchAll: TADAutoFetchAll;
See Also

Managing Transactions, Mode, AutoClose

What do you think about this topic? Send feedback!


TADFetchOptions.Cache Property

TADFetchOptions.Cache Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Controls what kind of data to cache in memory.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use Cache property to control what kind of data and metadata to cache in internal data storage.

Option
Description
fiBlobs
When included, then the BLOB field values are not discarded from memory after usage. When excluded, then after changing the current dataset record, BLOB field values in the current record will be discarded.
fiDetails
When included:
  • for a nested dataset an associated nested cursor will be not discarded from memory after changing a parent dataset record;
  • for a detail dataset an associated detail records will be not discarded from memory after changing a master dataset record.
fiMeta
When included, then the command metadata is not discarded from memory after usage. When excluded, then after fetching and using a required metadata (eg, primary key fields) it will be discarder from the cache.

The default value is [fiBlobs, fiDetails, fiMeta], meaning all data and metadata will be cached after usage.

Note, that excluding items from Cache does not affect already fetched data or metadata.

Syntax
property Cache: TADFetchItems;
See Also

Unique Identifying Fields, Fetching Rows, Master-Detail Relationship, Items

What do you think about this topic? Send feedback!


TADFetchOptions.CursorKind Property

TADFetchOptions.CursorKind Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies type of cursor an FireDAC command or dataset uses.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Set CursorKind to indicate the type of cursor the FireDAC command or dataset uses for the result set when it is opening. CursorKind must be set prior to preparing command or dataset. To change CursorKind for already used dataset, application may call Disconnect method first.

CursorKind affects on the:

  • time to return the first record or open the result set;
  • time to return all result set records;
  • ability to use multiple open cursors;
  • cursor stability;
  • used DBMS resources;
  • TADTable mode.
Option | Description
ckAutomatic | A driver will automatically choose cursor kind, depending on the other fetch options and result set structure.
ckDefault | A driver will use a default client side cursor. A default cursor produces the records snapshot, as they was at query execution time. May give maximum fetch performance. But requires more time to return first record, because all result set records will be sent to the client at Open call. Some DBMS support only single active default cursor per connection.
ckDynamic | A driver will use a dynamic server side cursor. Dynamic cursor rows may be affected by the updates to the query tables, while the cursor is active. May require less time to return first record. And more time to return all records.
ckStatic | A driver will use a static server side cursor. Static cursor produces the records snapshot, as they was at query execution time. The fetch performance may be similar to dynamic cursor.
ckForwardOnly | A driver will use a forward only server side cursor. For FireDAC forward only cursors are similar to dynamic or static cursors. To control FireDAC dataset scrolling abilities use the Unidirectional property.

The default value is ckAutomatic.

Most of FireDAC drivers support only some cursor kinds or even does not use this option at all. Please, consult to the DBMS documentation for details. FireDAC chooses actual cursor kind, when CursorKind = ckAutomatic, as the following:

DBMS
Conditions
Actual cursor kind
Microsoft SQL Server
  • if server version is 2005 or higher;
  • or FetchOptions.Mode is fmExactRecsMax or fmAll;
  • or ResourceOptions.DirectExecute is True.
Default cursor.
Otherwise.
Static cursor.
IBM DB2
--
Forward only cursor.
Sybase SQL Anywhere,
Microsoft Access
If result set has BLOB fields.
Dynamic cursor.
Otherwise.
Default cursor.
PostgreSQL
If FetchOptions.Mode is fmExactRecsMax or fmAll.
Default cursor.
Otherwise
Static cursor.
Others
--
Default cursor.

For TADTable ckAutomatic enables live data window, when a table has unique identifying fields. ckDynamic enables live data window unconditionally, and an exception will be raised if a DB table does not have an unique key. Other cursor kinds disable live data window mode and sets TADTable to standard mode, when it acts like the TADQuery.

Syntax
property CursorKind: TADCursorKind;
See Also

Fetching Rows, Mode, Unidirectional, RowsetSize

What do you think about this topic? Send feedback!


TADFetchOptions.DetailCascade Property

TADFetchOptions.DetailCascade Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Controls propagation of a master dataset changes to a detail dataset in Centralized Cached Updates mode.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Set the DetailCascade property to True to enable propagation of a master dataset changes to a detail dataset in Centralized Cached Updates mode.

The DetailCascade = True has an effect, when master and detail datasets SchemaAdapter property points to the same TADCustomSchemaAdapter. Setting DetailCascade to True enables an in-memory referential constraint for a detail dataset.

Syntax
property DetailCascade: Boolean;
See Also

Caching Updates, Master-Detail Relationship, TADRdbmsDataSet.SchemaAdapter

What do you think about this topic? Send feedback!


TADFetchOptions.DetailDelay Property

TADFetchOptions.DetailDelay Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace Example published See Also Send Feedback

Controls the delay between master dataset scroll and detail dataset refresh.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Set DetailDelay property value to the time in msecs. After the master dataset is scrolled, the detail (this) dataset will be refreshed after DetailDelay msecs. If another master dataset scrolling happens at that delay time, then the delay will be restarted.

This is at first useful at master-detail relation, where a detail dataset must execute a SQL command against database to query details records. And master dataset is attached to GUI, where the user can scroll through records. If a user will press and hold a navigation button, then master dataset will scroll fast, but this property allows to postpone detail dataset refreshing, until the master dataset scrolling will be finished.

FireDAC cannot distinguish - is it a user scrolling through master dataset or an application code. So, programmer should take care in code that detail dataset contains records corresponding to the current master dataset record. That may be done:

  • persistently disabling delayed refreshing - by setting DetailDelay to 0 and calling TADDataSet.MasterLink.Synchronize method;
  • one time synchronization - by calling TADDataSet.MasterLink.Synchronize method.
Syntax
property DetailDelay: Integer;
See Also

Master-Detail Relationship, MasterSource, MasterLink, TADMasterDataLink, DetailOptimize

Example
// allow to user to scroll through master dataset, using GUI
qDetail.FetchOptions.DetailDelay := 200;
...
// there detail dataset is in sync with master dataset
qDetail.FetchOptions.DetailDelay := 0;
qDetail.MasterLink.Synchronize(True);
while not qMaster.Eof do begin
  ...
  qMaster.Next;
end;
// again allow to user to scroll through master dataset, using GUI
qDetail.FetchOptions.DetailDelay := 200;
What do you think about this topic? Send feedback!


TADFetchOptions.DetailOptimize Property

TADFetchOptions.DetailOptimize Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies to refresh detail dataset only when master record is changed.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Set DetailOptimize property to True (default), to refresh detail dataset only when current detail dataset key field values are different from master dataset key field values. That allows to avoid extra refreshing's, when master dataset state is changed, non-key field values are changed, etc.

Set DetailOptimize property to False to always refresh detail dataset. That may be useful, when an application expects that detail dataset will be refreshed after calling Refresh method for master dataset, and in some other cases.

Syntax
property DetailOptimize: Boolean;
See Also

Master-Detail Relationship, DetailDelay

What do you think about this topic? Send feedback!


TADFetchOptions.Items Property

TADFetchOptions.Items Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Controls what kind of data to fetch.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use Items property to control which kinds of data and metadata to fetch.

Option
Description
fiBlobs
When included, then the BLOB field values will be fetched together with other record fields. Otherwise, the fetching will be deferred until a BLOB value will be really read.
Note, that excluding fiBlobs from Items do not modify the SELECT list of a SQL command. If a DBMS transfers BLOB values by-value (eg, Oracle LONG, MySQL, SQL Server, SQLite), then in any case the BLOB values will be delivered to the client other the network. But they will be not stored in the client records cache. But if a DBMS transfers BLOB values by-reference (eg, Oracle CLOB / BLOB, Interbase, Firebird), then the BLOB values will be not delivered and not stored.
fiDetails
When included, then the nested cursor fields will be fetched together with other record fields. Otherwise, the fetching will be deferred until a nested cursor value will be really read.
fiMeta
When included, then the command metadata will be fetched. Otherwise, programmer must supply metadata on your own. The kind of metadata and the point then it will be fetched depends on the command kind:
  • TADCustomStoredProc, TADCustomCommand.CommandKind = ckStoredProc, etc. The metadata is the description of the stored procedure parameters. It will be fetched at Prepare call. If fiMeta is not in Items, then programmer must fill Params collection by his own.
  • TADCustomQuery, TADCustomCommand.CommandKind = ckSelect, etc. The metadata is the set of the base table columns, forming the table primary key. It is used to automatically generate updating SQL commands. The metadata will be fetched at Open / Define calls. If fiMeta is not in Items, then programmer must do one of following to specify PK fields:
    • include pfInKey into TField.ProviderFlags for PK fields;
    • set UpdateOptions.KeyFields to the colon separated list of PK field names;
    • include coInKey in TADDatSColumn.Options for PK columns.

The default value is [fiBlobs, fiDetails, fiMeta], meaning all data and metadata will be fetched automatically at proper moments.

Syntax
property Items: TADFetchItems;
See Also

Unique Identifying Fields, Fetching Rows, Cache, TField.ProviderFlags, TADBottomUpdateOptions.KeyFields, TADDatSColumn.Options

What do you think about this topic? Send feedback!


TADFetchOptions.LiveWindowFastFirst Property

TADFetchOptions.LiveWindowFastFirst Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Controls the TADTable live data window fetch optimization mode.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use the LiveWindowFastFirst property to setup the TADTable Live Data Window fetch optimization mode.

When it is True, then FireDAC will build a query to return the first results as fast as it possible. When it is False (the default value), then FireDAC will minimize the time to return all table rows. Note, True may be useful with SQL Server and similar DB servers, which are blocking result set records, until the whole result set will be fetched.

Syntax
property LiveWindowFastFirst: Boolean;
See Also

Browsing Table, LiveWindowParanoic

What do you think about this topic? Send feedback!


TADFetchOptions.LiveWindowParanoic Property

TADFetchOptions.LiveWindowParanoic Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Controls the TADTable live data window mode records search mode.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use the LiveWindowParanoic property to setup the TADTable Live Data Window records search mode.

In general, FireDAC to maintain live data window is performing different SQL queries. That may affect the application performance. To improve it, search operations may avoid extra SQL queries for the price of the less exact result. When LiveWindowParanoic = False (default value), then TADTable will avoid:

  • SELECT COUNT(*) SQL query to calculate the RecNo property value. Instead -1 will be returned.
  • SELECT SQL query for Locate and Lookup methods, when a locating record is found in local client cache.

Note, that LiveWindowParanoic property is used only when TADTable is operating in the live data window mode. It is not used in standard mode.

Syntax
property LiveWindowParanoic: Boolean;
See Also

Browsing Table, CursorKind, LiveWindowFastFirst

What do you think about this topic? Send feedback!


TADFetchOptions.Mode Property

TADFetchOptions.Mode Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace Example published See Also Send Feedback

Controls how to fetch data.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use Mode property to control how the result set records must be fetched into FireDAC internal data storage.

Mode
Description
fmManual
The records are not fetched automatically by FireDAC. A programmer must write code to fetch records at appropriate moments, using following methods:
  • TADDataSet.FetchAll to fetch all records;
  • TADDataSet.GetNextPacket to fetch next record set (packet), containing RowsetSize records;
  • IADPhysCommand.Fetch to fetch all records or next record set;
fmOnDemand
The records are fetched automatically by FireDAC, when they are demanded by the navigation or other dataset methods. At each demand FireDAC will fetch one or more record sets, containing RowsetSize records.
This mode allows to open big result set without a significant delay, like a fmAll mode. But total time of fetching of the all records will be more than in fmAll mode. For example, on Microsoft SQL Server will be used server side static cursor.
fmAll
All result set records are fetched automatically by FireDAC at the dataset Open call or at the first IADPhysCommand.Fetch call.
On a big resultset it may take a time, but then navigation through a dataset will be fast, because all records will be stored in an FireDAC internal data storage. For many DBMS's, like a Microsoft SQL Server, MySQL Server, Sybase SQL Anywhere:
  • it releases client result set buffer and allows to execute next command returning resultsets;
  • gives maximum fetch performance. For example, on Microsoft SQL Server will be used fast forward-only cursor.
fmExactRecsMax
Similar to fmAll, but if the amount of the fetched records differs from specified in RecsMax, then exception is raised.

The default value is fmOnDemand, for TADCustomMemTable it is fmAll.

Syntax
property Mode: TADFetchMode;
See Also

Fetching Rows, TADDataSet.FetchAll, TADDataSet.GetNextPacket, RecsMax, RowsetSize, Unidirectional

Example

To check for fmExactRecsMax exception use code like that:

try
  ...
except
  on E: EADException do
    if E.ADCode = er_AD_AccExactFetchMismatch then
      ; // fetching failed
end;
What do you think about this topic? Send feedback!


TADFetchOptions.RecordCountMode Property

TADFetchOptions.RecordCountMode Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Controls how to count records in a result set.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use RecordCountMode property to control how the TADDataSet will count number of records in the result set.

Mode
Description
cmVisible
The TDataSet.RecordCount returns the number of records currently accessible through TDataSet navigation interface. For example, all these records will be accessible to a user using associated TDBGrid.
  • RecordCount tracks records deleted / appended to dataset.
  • Is not applicable to TADTable in LDV mode.
  • Has no overhead.
  • Gives a convenient value for the end-user users.
cmFetched
The TDataSet.RecordCount returns the number of fetched records to the current moment of time.
  • RecordCount tracks records deleted / appended to dataset.
  • Is not applicable to TADTable in LDV mode.
  • Has no overhead.
  • Gives rather a current dataset "weight", than a convenient value for the end-user users.
cmTotal
The TDataSet.RecordCount returns number of records, which will be returned by command. For that FireDAC issues SELECT COUNT(*) FROM (<original SQL command text>).
  • RecordCount does not track records deleted / appended to dataset. To refresh RecordCount call TDataSet.Refresh method.
  • Applicable to TADTable in LDV mode.
  • Has an overhead at dataset opening.
  • Gives nearly exact number of records until dataset records will be deleted / inserted.

Default value is cmVisible.

Note, MySQL may return "Commands out of sync; you can't run this command now" error when RecordCountMode = cmTotal. In this case either set Mode to fmFetchAll or do not use cmTotal.

Syntax
property RecordCountMode: TADRecordCountMode;
See Also

TDataSet.RecordCount, Mode

What do you think about this topic? Send feedback!


TADFetchOptions.RecsMax Property

TADFetchOptions.RecsMax Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace Example published See Also Send Feedback

Controls the maximum number of records to be fetched.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use RecsMax to limit number of records to be fetched from a single result set.

FireDAC returns only first RecsMax records, other records are discarded. The -1 value means - no limit. If combined with Mode = fmExactRecsMax, then FireDAC raises an exception, if result set has number of records not equal to RecsMax.

Combining the RecsSkip and the RecsMax properties allows to implement a result set paging, useful for the web applications. Also an application may use the LIMIT escape function. If both are specified, then the LIMIT has a more high priority.

Depending on a DBMS, the RecsMax and RecsSkip may be translated to a SELECT statement clause (TOP, LIMIT, etc) limiting a result set on a server side. If a DBMS does not support such clauses, then limiting will be performed on a client.

The default value is -1.

Syntax
property RecsMax: Integer;
See Also

Fetching Rows, RecsSkip, Mode, RowsetSize, LIMIT

Example
ADQuery1.FetchOptions.RecsMax := 20;
ADQuery1.FetchOptions.RecsSkip := 60;
ADQuery1.Open;
ADQuery1.FetchAll; // query will return records from 61'th to 80'th
What do you think about this topic? Send feedback!


TADFetchOptions.RecsSkip Property

TADFetchOptions.RecsSkip Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace Example published See Also Send Feedback

Controls the offset of the first record to be fetched.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use RecsSkip to specify the number of records to skip from the beginning of a single result set.

FireDAC discards RecsSkip first records and returns records, starting from RecsSkip+1 record number. The <= 0 value means - do not skip.

Combining the RecsSkip and the RecsMax properties allows to implement a result set paging, useful for the web applications. Also an application may use the LIMIT escape function. If both are specified, then the LIMIT has a more high priority.

Depending on a DBMS, the RecsMax and RecsSkip may be translated to a SELECT statement clause (TOP, LIMIT, etc) limiting a result set on a server side. If a DBMS does not support such clauses, then limiting will be performed on a client.

The default value is -1.

Syntax
property RecsSkip: Integer;
See Also

Fetching Rows, RecsMax, Mode, LIMIT

Example
ADQuery1.FetchOptions.RecsMax := 20;
ADQuery1.FetchOptions.RecsSkip := 60;
ADQuery1.Open;
ADQuery1.FetchAll; // query will return records from 61'th to 80'th
What do you think about this topic? Send feedback!


TADFetchOptions.RowsetSize Property

TADFetchOptions.RowsetSize Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Controls the number of records per single fetch.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use RowsetSize property to set the size of a single rows set, that will be fetched at a single fetch operation. To change RowsetSize for already used dataset, application may call Disconnect method first.

FireDAC uses underlying DBMS CLI features to optimize the result set fetching. Most of the supported DBMS's offers row set fetching feature, while MySQL Server, Microsoft Access database does not. The row set fetching allows to transfer few records from a DBMS server to a DBMS client in a single packet at single round trip. That raises the fetching performance few times, comparing to fetching by one record per fetch operation and transmitting single record per round trip.

If DBMS does not support row set fetching, then FireDAC will emulate it, unifying fetching behavior across all drivers.

There is significant performance difference between RowsetSize <= 5 and RowsetSize >= 50. But there may be no significant performance difference between RowsetSize ~= 100 and RowsetSize ~= 500, for example. Anyway, you should check what value will be more suitable for your environment.

Syntax
property RowsetSize: Integer;
See Also

Fetching Rows, Mode, Unidirectional

What do you think about this topic? Send feedback!


TADFetchOptions.Unidirectional Property

TADFetchOptions.Unidirectional Property
TADFetchOptions Class TADFetchOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies possible directions of navigation by dataset records.

Group

published

Links
TADFetchOptions Class, TADFetchOptions Members, uADStanOption Namespace, published, See Also
Description

Use Unidirectional property to specify will application navigate by dataset records in forward-only direction or in forward and backward directions. To change Unidirectional for already used dataset, application may call Disconnect method first.

Setting Unidirectional to True enables application to navigate in forward-only direction. FireDAC will automatically discard prior rows from internal data storage after moving current position in dataset, because they are not needed anymore. That dramatically reduces memory consumption on big result sets.

Setting Unidirectional to True for TADTable disables the live data window mode.

Notes

Do not use Unidirectional datasets to display data in grid control. It requires bi-directional datasets.

Syntax
property Unidirectional: Boolean;
See Also

Fetching Rows, RowsetSize, Mode

What do you think about this topic? Send feedback!


TADFormatOptions Class

TADFormatOptions Class
public published TADFormatOptions Members Classes See Also Send Feedback

The set of options controlling representation of fetched or sending data.

Group

Classes

Class Hierarchy
  uADStanOption_TADFormatOptionsuADStanOption_TADFormatOptions
File

uADStanOption

Links
public, published, TADFormatOptions Members, Classes, See Also
Description

The TADFormatOptions class represents the set of properties controlling how FireDAC components and Phys Layer command interfaces represent and process the data returned by DBMS or sent to DBMS:

  • string data type (StrsEmpty2Null, StrsTrim, StrsTrim2Len, InlineDataSize, MaxStringSize);
  • numeric data type (MaxBcdPrecision, MaxBcdScale, Round2Scale);
  • time data type (Round2Scale);
  • general data type mapping (MapRules, OwnMapRules, DefaultParamDataType). For example, it is possible to map all NUMERIC(9, 0) columns to ftInteger columns, etc;
  • field display formats (FmtDisplayDateTime, FmtDisplayDate, FmtDisplayTime, FmtDisplayNumeric, FmtEditNumeric);
  • dataset sorting (SortLocale, SortOptions);
  • identifier quotations (QuoteIdentifiers).
Syntax
TADFormatOptions = class(TADCustomOptions);
See Also

Setting Options, TADCustomManager.FormatOptions, TADCustomConnection.FormatOptions, TADCustomCommand.FormatOptions, TADQuery.FormatOptions, IADPhysCommand.Options

What do you think about this topic? Send feedback!


TADFormatOptions Members

TADFormatOptions Members
TADFormatOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADFormatOptions.

Class

TADFormatOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Properties
Property | Description
AssignedValues | Specifies the set of changed options.
DataSnapCompatibility | Controls the compatibility with the DataSnap / MIDAS.
DefaultParamDataType | Specifies default data type for parameters with ftUnknown data type.
FmtDisplayDate | Specifies display format for ftDate fields.
FmtDisplayDateTime | Specifies display format for ftDateDate, ftTimeStamp fields.
FmtDisplayNumeric | Specifies display format for numeric fields.
FmtDisplayTime | Specifies display format for ftTime fields.
FmtEditNumeric | Specifies edit format for numeric fields.
InlineDataSize | Controls how character or byte string values are stored in record buffer.
MapRules | Controls data type mapping.
MaxBcdPrecision | Controls recognition of numeric values as FmtBCD ones, depending on precision.
MaxBcdScale | Controls recognition of numeric values as FmtBCD ones, depending on scale.
MaxStringSize | Controls recognition of string values as BLOB ones.
OwnMapRules | Controls usage of MapRules property.
QuoteIdentifiers | Specifies whether or not to explicitly surround identifiers with quotes.
Round2Scale | Controls values rounding.
SortLocale | Specifies a locale ID for the local sorting operations.
SortOptions | Specifies the default sort options for the local sorting operations.
StrsDivLen2 | Allows to overcome bugs in early dbExpress driver versions.
StrsEmpty2Null | Controls conversion of zero-length string values to NULL value.
StrsTrim | Controls removing of trailing spaces from string values.
StrsTrim2Len | Controls trimming string values to the declared length.
Version | The current version of options.
Links
TADFormatOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADFormatOptions Class Legend Methods Properties Send Feedback

The public members of the TADFormatOptions class are listed here.

Class

TADFormatOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Properties
Property | Description
StrsDivLen2 | Allows to overcome bugs in early dbExpress driver versions.
Links
TADFormatOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADFormatOptions.StrsDivLen2 Property

TADFormatOptions.StrsDivLen2 Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace public Send Feedback

Allows to overcome bugs in early dbExpress driver versions.

Group

public

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, public
Description

Use StrsDivLen2 property with old dbExpress driver versions, which may work incorrectly with Unicode string data. If property is True, then FireDAC will divide the column length returned by driver by 2.

Syntax
property StrsDivLen2: Boolean;
What do you think about this topic? Send feedback!


TADFormatOptions.Assign Method

TADFormatOptions.Assign Method
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace Example public See Also Send Feedback

Assigns all options of one option object to another.

Group

public

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, Example, public, See Also
Parameters
Parameters | Description
ASource: TPersistent | A source options object.
Description

Use the Assign method to assign all changed option values of ASource option object to this object. After that corresponding options will stop inheriting the values from more high level option object.

Syntax
procedure Assign(ASource: TPersistent); override;
See Also

RestoreDefaults

Example
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);
What do you think about this topic? Send feedback!


TADFormatOptions.RestoreDefaults Method

TADFormatOptions.RestoreDefaults Method
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace public See Also Send Feedback

Restore option default values.

Group

public

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, public, See Also
Description

Call RestoreDefaults to reset all changed options to their default values.

Syntax
procedure RestoreDefaults; override;
See Also

AssignedValues

What do you think about this topic? Send feedback!


published

published
TADFormatOptions Class Legend Properties Send Feedback

The published members of the TADFormatOptions class are listed here.

Class

TADFormatOptions Class

Properties
Property | Description
AssignedValues | Specifies the set of changed options.
DataSnapCompatibility | Controls the compatibility with the DataSnap / MIDAS.
DefaultParamDataType | Specifies default data type for parameters with ftUnknown data type.
FmtDisplayDate | Specifies display format for ftDate fields.
FmtDisplayDateTime | Specifies display format for ftDateDate, ftTimeStamp fields.
FmtDisplayNumeric | Specifies display format for numeric fields.
FmtDisplayTime | Specifies display format for ftTime fields.
FmtEditNumeric | Specifies edit format for numeric fields.
InlineDataSize | Controls how character or byte string values are stored in record buffer.
MapRules | Controls data type mapping.
MaxBcdPrecision | Controls recognition of numeric values as FmtBCD ones, depending on precision.
MaxBcdScale | Controls recognition of numeric values as FmtBCD ones, depending on scale.
MaxStringSize | Controls recognition of string values as BLOB ones.
OwnMapRules | Controls usage of MapRules property.
QuoteIdentifiers | Specifies whether or not to explicitly surround identifiers with quotes.
Round2Scale | Controls values rounding.
SortLocale | Specifies a locale ID for the local sorting operations.
SortOptions | Specifies the default sort options for the local sorting operations.
StrsEmpty2Null | Controls conversion of zero-length string values to NULL value.
StrsTrim | Controls removing of trailing spaces from string values.
StrsTrim2Len | Controls trimming string values to the declared length.
Links
TADFormatOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


TADFormatOptions.AssignedValues Property

TADFormatOptions.AssignedValues Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the set of changed options.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use AssignedValues to get / set the set of modified option values.

If some option is changed at this level, then corresponding flag is included into AssignedValues. If flag is not included, then an option value is inherited from more high level. Excluding flag from AssignedValues makes option inheriting its value from more high level.

See Setting Options for more details.

Syntax
property AssignedValues: TADFormatOptionValues;
See Also

RestoreDefaults

What do you think about this topic? Send feedback!


TADFormatOptions.DataSnapCompatibility Property

TADFormatOptions.DataSnapCompatibility Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published Send Feedback

Controls the compatibility with the DataSnap / MIDAS.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published
Description

Set the DataSnapCompatibility property to True, when you are using FireDAC as a DataSnap back end data access components. The default value is False.

DataSnapCompatibility = True forces FireDAC to use compatible with DataSnap the numeric types precision and scale.

Syntax
property DataSnapCompatibility: Boolean;
What do you think about this topic? Send feedback!


TADFormatOptions.DefaultParamDataType Property

TADFormatOptions.DefaultParamDataType Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies default data type for parameters with ftUnknown data type.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use DefaultParamDataType property to specify default data type for all parameters with ftUnknown data type. The default value is ftUnknown.

If parameter data type is unknown at Prepare call, then FireDAC sets it type to DefaultParamDataType. If DefaultParamDataType is ftUnknown, then FireDAC raises an exception that parameter data type is unknown. Although DefaultParamDataType allows to avoid this exception, it affects application performance, because a query with inappropriate parameter data type may have bad execution plan.

Syntax
property DefaultParamDataType: TFieldType;
See Also

TADParam.DataType

What do you think about this topic? Send feedback!


TADFormatOptions.FmtDisplayDate Property

TADFormatOptions.FmtDisplayDate Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace Example published See Also Send Feedback

Specifies display format for ftDate fields.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use the FmtDisplayDate property to specify DisplayFormat property for TDateField / ftDate dataset fields.

The option will be applied only to default fields or to persistent fields at the create time only. For format details see TDateField.DisplayFormat.

Syntax
property FmtDisplayDate: String;
See Also

FmtDisplayDateTime, FmtDisplayTime, FmtDisplayNumeric, FmtEditNumeric

Example
ADQuery1.FormatOptions.FmtDisplayDate := 'yyyy.mm.dd';
What do you think about this topic? Send feedback!


TADFormatOptions.FmtDisplayDateTime Property

TADFormatOptions.FmtDisplayDateTime Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace Example published See Also Send Feedback

Specifies display format for ftDateDate, ftTimeStamp fields.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use the FmtDisplayDateTime property to specify DisplayFormat property for TDateTimeField / ftDate, TSQLTimeStampField / ftTimeStamp dataset fields.

The option will be applied only to default fields or to persistent fields at the create time only. For format details see TDateTimeField.DisplayFormat.

Syntax
property FmtDisplayDateTime: String;
See Also

FmtDisplayDate, FmtDisplayTime, FmtDisplayNumeric, FmtEditNumeric

Example
ADQuery1.FormatOptions.FmtDisplayDateTime := 'yyyy.mm.dd hh:mm';
What do you think about this topic? Send feedback!


TADFormatOptions.FmtDisplayNumeric Property

TADFormatOptions.FmtDisplayNumeric Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace Example published See Also Send Feedback

Specifies display format for numeric fields.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use the FmtDisplayNumeric property to specify DisplayFormat property for TNumericField descendants (ftInteger, ftLongWord, ftSmallint, ftShortint, ftByte, ftLargeint, ftWord, ftAutoInc, ftFloat, ftSingle, ftCurrency, ftExtended, ftBCD, ftFmtBCD) dataset fields.

The option will be applied only to default fields or to persistent fields at the create time only. For format details see TNumericField.DisplayFormat.

Syntax
property FmtDisplayNumeric: String;
See Also

FmtDisplayDateTime, FmtDisplayDate, FmtDisplayTime, FmtEditNumeric

Example
ADQuery1.FormatOptions.FmtDisplayNumeric := '#,##0.';
What do you think about this topic? Send feedback!


TADFormatOptions.FmtDisplayTime Property

TADFormatOptions.FmtDisplayTime Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace Example published See Also Send Feedback

Specifies display format for ftTime fields.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use the FmtDisplayTime property to specify DisplayFormat property for TTimeField / ftTime dataset fields.

The option will be applied only to default fields or to persistent fields at the create time only. For format details see TTimeField.DisplayFormat.

Syntax
property FmtDisplayTime: String;
See Also

FmtDisplayDateTime, FmtDisplayDate, FmtDisplayNumeric, FmtEditNumeric

Example
ADQuery1.FormatOptions.FmtDisplayTime := 'hh:mm';
What do you think about this topic? Send feedback!


TADFormatOptions.FmtEditNumeric Property

TADFormatOptions.FmtEditNumeric Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace Example published See Also Send Feedback

Specifies edit format for numeric fields.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use the FmtEditNumeric property to specify EditFormat property for TNumericField descendants (ftInteger, ftLongWord, ftSmallint, ftShortint, ftByte, ftLargeint, ftWord, ftAutoInc, ftFloat, ftSingle, ftCurrency, ftExtended, ftBCD, ftFmtBCD) dataset fields.

The option will be applied only to default fields or to persistent fields at the create time only. For format details see TNumericField.EditFormat.

Syntax
property FmtEditNumeric: String;
See Also

FmtDisplayDateTime, FmtDisplayDate, FmtDisplayTime, FmtDisplayNumeric

Example
ADQuery1.FormatOptions.FmtEditNumeric := '0.';
What do you think about this topic? Send feedback!


TADFormatOptions.InlineDataSize Property

TADFormatOptions.InlineDataSize Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Controls how character or byte string values are stored in record buffer.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use InlineDataSize to control how character or byte string values are stored in record buffer. The default value is 1000 bytes.

If the dtAnsiString, dtWideString, dtByteString field values are less than or InlineDataSize, then FireDAC stores field values inside of record buffer (inline storage). If equal or greater, then record buffer will keep pointer to the exactly allocated memory space for field value (exact storage).

An inline storage offers good performance at data fetching, but may use much more memory, than an exact storage. A good performance, because no need to allocate a memory for each string value and allows to streamline a rowset fetching. Uses more memory, because following. For example, a column in a table is declared as VARCHAR(2000). But some record field has 50 characters long value. An inline storage uses 2000 character long space for a value storage, while only 50 characters is required. While exact storage allocates 50 characters long space and stores pointer to this space inside of record buffer.

Also, long string values (BLOB's) always are stored using exact storage.

Syntax
property InlineDataSize: Integer;
See Also

MaxStringSize

What do you think about this topic? Send feedback!


TADFormatOptions.MapRules Property

TADFormatOptions.MapRules Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Controls data type mapping.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use MapRules property to setup data type mapping schema. By default MapRules is empty.

Read Data Type Mapping for more details. The MapRules are used by FireDAC when OwnMapRules is True.

Syntax
property MapRules: TADMapRules;
See Also

Data Type Mapping, TADMapRules, TADMapRule, OwnMapRules, MaxStringSize, MaxBcdPrecision, MaxBcdScale

What do you think about this topic? Send feedback!


TADFormatOptions.MaxBcdPrecision Property

TADFormatOptions.MaxBcdPrecision Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Controls recognition of numeric values as FmtBCD ones, depending on precision.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use the MaxBcdPrecision property together with the MaxBcdScale property to control, represent numeric column data type as dtFmtBCD or as dtBCD. The default value is 18.

If numeric column precision is less than or equal to MaxBcdPrecision, then numeric column data type is defined as dtBCD, otherwise as dtFmtBCD.

Syntax
property MaxBcdPrecision: Integer;
See Also

Data Type Mapping, MaxBcdScale

What do you think about this topic? Send feedback!


TADFormatOptions.MaxBcdScale Property

TADFormatOptions.MaxBcdScale Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Controls recognition of numeric values as FmtBCD ones, depending on scale.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use the MaxBcdScale property together with the MaxBcdPrecision property to control, represent numeric column data type as dtFmtBCD or as dtBCD. The default value is 4.

If numeric column scale is less than or equal to MaxBcdScale, then numeric column data type is defined as dtBCD, otherwise as dtFmtBCD.

Syntax
property MaxBcdScale: Integer;
See Also

Data Type Mapping, MaxBcdPrecision

What do you think about this topic? Send feedback!


TADFormatOptions.MaxStringSize Property

TADFormatOptions.MaxStringSize Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Controls recognition of string values as BLOB ones.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use MaxStringSize property to specify the maximum string column size in characters. If a column is longer than MaxStringSize, then FireDAC represents its data type as one from BLOB family. The default value is 32767 bytes.

MaxStringSize has a special meaning for Oracle connection. When specified, then it will be a maximum size for the string typed parameters of PL/SQL commands, like a stored procedure call or explicit PL/SQL anonymous block call. The 255 characters is a special reserved value and does not have an effect.

Syntax
property MaxStringSize: LongWord;
See Also

Data Type Mapping, InlineDataSize

What do you think about this topic? Send feedback!


TADFormatOptions.OwnMapRules Property

TADFormatOptions.OwnMapRules Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Controls usage of MapRules property.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Set OwnMapRules to True to tell FireDAC to use MapRules property of this TADFormatOptions instance. If OwnMapRules is False, then MapRules will be inherited from parent object (TADConnection or TADManager). By default OwnMapRules is False.

Syntax
property OwnMapRules: Boolean;
See Also

Data Type Mapping, MapRules

What do you think about this topic? Send feedback!


TADFormatOptions.QuoteIdentifiers Property

TADFormatOptions.QuoteIdentifiers Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace Example published Send Feedback

Specifies whether or not to explicitly surround identifiers with quotes.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, Example, published
Description

Use the QuoteIdentifiers property to explicitly quote identifiers, such as column and table names. That helps if identifiers in a database are quoted and must not be normalized but pointed in all queries as they were defined.

Normally FireDAC will automatically decide should it or not to quote an identifier. But in several cases an application has specify to FireDAC to quote identifiers:

  • when a DB table has quoted column names and this table is specified in TADTable.TableName.
Syntax
property QuoteIdentifiers: Boolean;
Example
// Firebird table:
// create table "Records"(
//   "Id" int,
//   "RecId" int,
//   "RecName" varchar(15)
// )

ADTable1.FormatOptions.QuoteIdentfiers := True;
ADTable1.TableName := '"Records"';
ADTable1.IndexFieldNames := 'RecId';
ADTable1.Open;
What do you think about this topic? Send feedback!


TADFormatOptions.Round2Scale Property

TADFormatOptions.Round2Scale Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published Send Feedback

Controls values rounding.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published
Description

Use Round2Scale property to control, should FireDAC round the numeric and time values to the scale specified in a database or not. The default value is False.

If it is True, then rounding will be performed. The rounding happens at the client side, only when an application assigns a value to a field of numeric / time / date & time type. The rounding uses a corresponding TADDatSColumn.Scale value. For numbers it is amount of digits after decimal point. For times it is maximal supported precision in msecs.

Setting Round2Scale property to True, allows to an application to avoid potential rounding errors. Lets consider the scenario. The application has UpdateOptions.LockMode = lmOptimistic and ADQuery with simple SELECT to an Oracle table with a DATE field. The DATE data type in Oracle has 1 sec precision. Now add a new record, assign Now() result to the DATE field and post the change to the database. The client record buffer will store a value with some msecs, while the database will store a value WITHOUT msecs. Lets try to edit the record. Before that the lock will be performed. But FireDAC will fail to compare the field values from the client buffer and the one just fetched from the database. As result "DApt-400" exception will be raised. But if to set Round2Scale to True, then FireDAC will round a client value to seconds and a comparison will succeed.

Notes

At moment (v 2.0.11) only time rounding is supported.

Syntax
property Round2Scale: Boolean;
What do you think about this topic? Send feedback!


TADFormatOptions.SortLocale Property

TADFormatOptions.SortLocale Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace Example published See Also Send Feedback

Specifies a locale ID for the local sorting operations.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use the SortLocale property to specify a locale ID for the local sorting operations. The default value is LOCALE_USER_DEFAULT.

The local sorting is performed by the TADDataSet.IndexFieldNames and TADDataSet.Indexes properties. When the sorting is performed on a string column, the Windows API function [image] CompareString is used. The string comparison is performed using the SortLocale locale.

For TADMemTable, TADQuery and TADStoredProc the specifying of SortLocale is always optional. For TADTable it may be required, when the database collation differs from the default locale. Additionally the SortOptions may be used.

To specify a locale ID the MAKELCID, MAKELANGID and [image] DownlevelLocaleNameToLCID Windows API functions may be used. To enable binary string comparision specify 0.

Syntax
property SortLocale: TADLocalID;
See Also

TADIndex.Options, TADDataSet.IndexFieldNames, TADDataSet.Indexes, SortOptions

Example

Setup TADTable to query the Firebird database with ISO8859_1 character set containing German language string data:

uses
  Windows;
...
// Set locale ID to German phone book collation
ADTable1.FormatOptions.SortLocale := MAKELCID(MAKELANGID (LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
// Use the the punctuation and other symbols insensitive sorting
ADTable1.FormatOptions.SortOptions := [soNoSymbols];
ADTable1.IndexFieldNames := 'NAME';
ADTable1.TableName := 'CUSTOMERS';
ADTable1.Open;
What do you think about this topic? Send feedback!


TADFormatOptions.SortOptions Property

TADFormatOptions.SortOptions Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace Example 1 Example 2 published See Also Send Feedback

Specifies the default sort options for the local sorting operations.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, Example 1, Example 2, published, See Also
Description

Use the SortOptions property to specify the default sorting options for the local sorting operations. See TADIndex.Options for details. The default value is [].

The local sorting is performed by the TADDataSet.IndexFieldNames and TADDataSet.Indexes properties. The SortOptions is the default value for an index in the Indexes collection and may be overridden by the TADIndex.Options property. The SortOptions is the only way to specify the options for IndexFieldNames.

For TADMemTable, TADQuery and TADStoredProc the specifying of SortOptions is always optional. For TADTable it may be required, when the database collation differs from the default locale. Then consider to specify soNoCase, soNullLess, soNoSymbols.

Additionally the SortLocale may be used.

Syntax
property SortOptions: TADSortOptions;
See Also

TADIndex.Options, TADDataSet.IndexFieldNames, TADDataSet.Indexes, SortLocale

Example 1

Setup TADTable to query the Firebird database with ISO8859_1 character set containing German language string data:

uses
  Windows;
...
// Set locale ID to German phone book collation
ADTable1.FormatOptions.SortLocale := MAKELCID(MAKELANGID (LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
// Use the the punctuation and other symbols insensitive sorting
ADTable1.FormatOptions.SortOptions := [soNoSymbols];
ADTable1.IndexFieldNames := 'NAME';
ADTable1.TableName := 'CUSTOMERS';
ADTable1.Open;
Example 2

Setup IndexFieldNames sort order properties for TADMemTable:

ADMemTable1.FormatOptions.SortOptions := [soNullFirst, soNoCase];
ADMemTable1.IndexFieldNames := 'SECOND_NAME;FIRST_NAME';
What do you think about this topic? Send feedback!


TADFormatOptions.StrsEmpty2Null Property

TADFormatOptions.StrsEmpty2Null Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Controls conversion of zero-length string values to NULL value.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use StrsEmpty2Null property to control, should FireDAC convert string values with zero length to NULL value (True) or not (False). The default value is True.

The property applies to column values at rows fetching and to parameter values at command execution. The property will be applied after StrsTrim is applied. Note, when an application is executing a query:

ADQuery1.SQL.Text := 'SELECT * FROM MyTab WHERE fld = :p';
ADQuery1.Params[0].AsString := '';
ADQuery1.Open;

And the query returns no records, although the MyTab has some records with empty string in FLD field, then you have to set StrsEmpty2Null to False to get those records.

Syntax
property StrsEmpty2Null: Boolean;
See Also

StrsTrim, StrsTrim2Len

What do you think about this topic? Send feedback!


TADFormatOptions.StrsTrim Property

TADFormatOptions.StrsTrim Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Controls removing of trailing spaces from string values.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use StrsTrim property to specify, should FireDAC remove trailing spaces from fixed length string values (True) or not (False). The default value is True.

The property applies to fixed length column values at rows fetching and to parameter values at command execution. The property will be applied before StrsEmpty2Null is applied. The property is used only for trimming of the fixed length string values, like a CHAR / NCHAR. It does not affect the variable length string values, like a VARCHAR / NVARCHAR, and the BLOB values.

Note, for SQLite this property is applied to all string columns, including ftMemo, ftWideMemo, ftString, ftWideString, ftFixedChar and ftFixedWideChar.

Syntax
property StrsTrim: Boolean;
See Also

StrsEmpty2Null, StrsTrim2Len, Using SQLite with FireDAC

What do you think about this topic? Send feedback!


TADFormatOptions.StrsTrim2Len Property

TADFormatOptions.StrsTrim2Len Property
TADFormatOptions Class TADFormatOptions Members uADStanOption Namespace published See Also Send Feedback

Controls trimming string values to the declared length.

Group

published

Links
TADFormatOptions Class, TADFormatOptions Members, uADStanOption Namespace, published, See Also
Description

Use StrsTrim2Len property to specify, should FireDAC trim too long string values (True) to the maximum declared length or not (False). The default value is False.

For example, when application is trying to assign '12345' to the field declared in database as VARCHAR(3), then FireDAC will raise an exception 'value too long'. With StrsTrim2Len = True, FireDAC will trim the value to '123'.

Syntax
property StrsTrim2Len: Boolean;
See Also

StrsTrim, StrsEmpty2Null

What do you think about this topic? Send feedback!


TADMapRule Class

TADMapRule Class
published TADMapRule Members Classes See Also Send Feedback

TADMapRule represents a maintained client view to records in an FireDAC dataset...

Group

Classes

Class Hierarchy
  uADStanOption_TADMapRule
File

uADStanOption

Links
published, TADMapRule Members, Classes, See Also
Description

Use TADMapRule to create and maintain data type mapping rule.

TADMapRule are collected into TADMapRules collection. The set of TADMapRule may be created as at design time, as at run time.

A map rules collection is used by TADFormatOptions.MapRules.

Syntax
TADMapRule = class(TCollectionItem);
See Also

TADFormatOptions.MapRules, TADMapRules

What do you think about this topic? Send feedback!


TADMapRule Members

TADMapRule Members
TADMapRule Class Legend Properties Send Feedback

The following tables list the members exposed by TADMapRule.

Class

TADMapRule Class

Properties
Property | Description
NameMask | Specifies column name mask.
PrecMax | Specifies maximal numeric precision.
PrecMin | Specifies minimal numeric precision.
ScaleMax | Specifies maximal numeric scale.
ScaleMin | Specifies minimal numeric scale.
SizeMax | Specifies maximal string size.
SizeMin | Specifies minimal string size.
SourceDataType | Specifies a source data type.
TargetDataType | Specifies a target data type.
Links
TADMapRule Class, Legend, Properties
What do you think about this topic? Send feedback!


published

published
TADMapRule Class Legend Properties Send Feedback

The published members of the TADMapRule class are listed here.

Class

TADMapRule Class

Properties
Property | Description
NameMask | Specifies column name mask.
PrecMax | Specifies maximal numeric precision.
PrecMin | Specifies minimal numeric precision.
ScaleMax | Specifies maximal numeric scale.
ScaleMin | Specifies minimal numeric scale.
SizeMax | Specifies maximal string size.
SizeMin | Specifies minimal string size.
SourceDataType | Specifies a source data type.
TargetDataType | Specifies a target data type.
Links
TADMapRule Class, Legend, Properties
What do you think about this topic? Send feedback!


TADMapRule.NameMask Property

TADMapRule.NameMask Property
TADMapRule Class TADMapRule Members uADStanOption Namespace Example 1 Example 2 published See Also Send Feedback

Specifies column name mask.

Group

published

Links
TADMapRule Class, TADMapRule Members, uADStanOption Namespace, Example 1, Example 2, published, See Also
Description

Use NameMask property to specify a mask to match the column names. The mask uses LIKE operator format, where:

  • '%' - many symbols;
  • '_' - one any symbol;
  • '\' - escape character.

If a column name matches a mask, then exactly this column matches to this map rule. And the column will get TargetDataType type. Other properties may be used to strict the rule.

Syntax
property NameMask: String;
See Also

TADFormatOptions.MapRules, SourceDataType, TargetDataType

Example 1
// maps all columns ending with ID to dtInt32
with ADQuery1.FormatOptions.MapRules.Add do begin
  NameMask := '%ID';
  TargetDataType := dtInt32;
end;
Example 2
// maps all ID columns of dtFmtBCD data type to dtInt32
with ADQuery1.FormatOptions.MapRules.Add do begin
  NameMask := 'ID';
  SourceDataType := dtFmtBCD;
  TargetDataType := dtInt32;
end;
What do you think about this topic? Send feedback!


TADMapRule.PrecMax Property

TADMapRule.PrecMax Property
TADMapRule Class TADMapRule Members uADStanOption Namespace published See Also Send Feedback

Specifies maximal numeric precision.

Group

published

Links
TADMapRule Class, TADMapRule Members, uADStanOption Namespace, published, See Also
Description

Use PrecMax property to specify maximal numeric precision for source data type. If precision will be greater than PrecMax, then a data type does not match to this map rule. If PrecMax is equal to -1, then PrecMax will be not used in rule matching. The default value is -1.

Maximal numeric precision is the maximum number of digits in the number data types.

Syntax
property PrecMax: Integer;
See Also

TADFormatOptions.MapRules, PrecMin

What do you think about this topic? Send feedback!


TADMapRule.PrecMin Property

TADMapRule.PrecMin Property
TADMapRule Class TADMapRule Members uADStanOption Namespace published See Also Send Feedback

Specifies minimal numeric precision.

Group

published

Links
TADMapRule Class, TADMapRule Members, uADStanOption Namespace, published, See Also
Description

Use PrecMin property to specify minimal numeric precision for source data type. If precision will be less than PrecMin, then a data type does not match to this map rule. If PrecMin is equal to -1, then PrecMin will be not used in rule matching. The default value is -1.

Minimal numeric precision is the minimal number of digits in the number data types.

Syntax
property PrecMin: Integer;
See Also

TADFormatOptions.MapRules, PrecMax

What do you think about this topic? Send feedback!


TADMapRule.ScaleMax Property

TADMapRule.ScaleMax Property
TADMapRule Class TADMapRule Members uADStanOption Namespace published See Also Send Feedback

Specifies maximal numeric scale.

Group

published

Links
TADMapRule Class, TADMapRule Members, uADStanOption Namespace, published, See Also
Description

Use ScaleMax property to specify maximal numeric scale for source data type. If scale will be greater than ScaleMax, then a data type does not match to this map rule. If ScaleMax is equal to -1, then ScaleMax will be not used in rule matching. The default value is -1.

Maximal numeric scale is the maximum number of digits after decimal point in the number data types. Zero specifies integer data type.

Syntax
property ScaleMax: Integer;
See Also

TADFormatOptions.MapRules, ScaleMin

What do you think about this topic? Send feedback!


TADMapRule.ScaleMin Property

TADMapRule.ScaleMin Property
TADMapRule Class TADMapRule Members uADStanOption Namespace published See Also Send Feedback

Specifies minimal numeric scale.

Group

published

Links
TADMapRule Class, TADMapRule Members, uADStanOption Namespace, published, See Also
Description

Use ScaleMin property to specify minimal numeric scale for source data type. If scale will be less than ScaleMin, then a data type does not match to this map rule. If ScaleMin is equal to -1, then ScaleMin will be not used in rule matching. The default value is -1.

Minimal numeric scale is the minimum number of digits after decimal point in the number data types.

Syntax
property ScaleMin: Integer;
See Also

TADFormatOptions.MapRules, ScaleMax

What do you think about this topic? Send feedback!


TADMapRule.SizeMax Property

TADMapRule.SizeMax Property
TADMapRule Class TADMapRule Members uADStanOption Namespace published See Also Send Feedback

Specifies maximal string size.

Group

published

Links
TADMapRule Class, TADMapRule Members, uADStanOption Namespace, published, See Also
Description

Use SizeMax property to specify maximal string length for source data type. If length will be greater than SizeMax, then a data type does not match to this map rule. If SizeMax is equal to -1, then SizeMax will be not used in rule matching. The default value is -1.

The length is in characters for Ansi and Unicode string data types and in bytes for byte string data types.

Syntax
property SizeMax: LongWord;
See Also

TADFormatOptions.MapRules, SizeMin

What do you think about this topic? Send feedback!


TADMapRule.SizeMin Property

TADMapRule.SizeMin Property
TADMapRule Class TADMapRule Members uADStanOption Namespace published See Also Send Feedback

Specifies minimal string size.

Group

published

Links
TADMapRule Class, TADMapRule Members, uADStanOption Namespace, published, See Also
Description

Use SizeMin property to specify minimal string length for source data type. If length will be less than SizeMin, then a data type does not match to this map rule. If SizeMin is equal to -1, then SizeMin will be not used in rule matching. The default value is -1.

The length is in characters for Ansi and Unicode string data types and in bytes for byte string data types.

Syntax
property SizeMin: LongWord;
See Also

TADFormatOptions.MapRules, SizeMax

What do you think about this topic? Send feedback!


TADMapRule.SourceDataType Property

TADMapRule.SourceDataType Property
TADMapRule Class TADMapRule Members uADStanOption Namespace published See Also Send Feedback

Specifies a source data type.

Group

published

Links
TADMapRule Class, TADMapRule Members, uADStanOption Namespace, published, See Also
Description

Use SourceDataType to specify source data type, returned by driver for result set column.

Syntax
property SourceDataType: TADDataType;
See Also

TADFormatOptions.MapRules, TargetDataType

What do you think about this topic? Send feedback!


TADMapRule.TargetDataType Property

TADMapRule.TargetDataType Property
TADMapRule Class TADMapRule Members uADStanOption Namespace published See Also Send Feedback

Specifies a target data type.

Group

published

Links
TADMapRule Class, TADMapRule Members, uADStanOption Namespace, published, See Also
Description

Use TargetDataType to specify target data type, preferred by application.

Syntax
property TargetDataType: TADDataType;
See Also

TADFormatOptions.MapRules, SourceDataType

What do you think about this topic? Send feedback!


TADMapRules Class

TADMapRules Class
public TADMapRules Members Classes See Also Send Feedback

TADMapRules is a collection of TADMapRule objects.

Group

Classes

Class Hierarchy
  uADStanOption_TADMapRules
File

uADStanOption

Links
public, TADMapRules Members, Classes, See Also
Description

TADMapRules is a list of data type mapping rules. A single TADMapRule object represents single mapping rule.

A map rules collection is used by TADFormatOptions.MapRules.

Syntax
TADMapRules = class(TCollection);
See Also

TADFormatOptions.MapRules, TADMapRule

What do you think about this topic? Send feedback!


TADMapRules Members

TADMapRules Members
TADMapRules Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADMapRules.

Class

TADMapRules Class

Methods
Method | Description
Add | Appends new TADMapRule object to a collection.
Properties
Property | Description
Items | Returns TADMapRule object by it index.
Links
TADMapRules Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADMapRules Class Legend Methods Properties Send Feedback

The public members of the TADMapRules class are listed here.

Class

TADMapRules Class

Methods
Method | Description
Add | Appends new TADMapRule object to a collection.
Properties
Property | Description
Items | Returns TADMapRule object by it index.
Links
TADMapRules Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADMapRules.Items Property

TADMapRules.Items Property
TADMapRules Class TADMapRules Members uADStanOption Namespace public See Also Send Feedback

Returns TADMapRule object by it index.

Group

public

Links
TADMapRules Class, TADMapRules Members, uADStanOption Namespace, public, See Also
Description

Use Items indexed property to get TADMapRule object by it index.

The property is default one, so you does not need to write ADQuery1.FormatOptions.MapRules.Items[i], just ADQuery1.FormatOptions.MapRules[i].

Syntax
property Items [AIndex: Integer]: TADMapRule;
See Also

TADMapRule, TCollection.Count

What do you think about this topic? Send feedback!


TADMapRules.Add Method

TADMapRules.Add Method
TADMapRules Class TADMapRules Members uADStanOption Namespace Example public See Also Send Feedback

Appends new TADMapRule object to a collection.

Group

public

Links
TADMapRules Class, TADMapRules Members, uADStanOption Namespace, Example, public, See Also
Description

Call Add method to add new empty TADMapRule object to a collection.

Syntax
function Add: TADMapRule; overload;
See Also

Items, TCollection.Count

Example
with ADConnection1.FormatOptions.MapRules.Add do begin
  SourceDataType := dtWideString;
  TargetDataType := dtAnsiString;
end;
What do you think about this topic? Send feedback!


TADResourceOptions Class

TADResourceOptions Class
public published TADResourceOptions Members Classes See Also Send Feedback

The set of options controlling SQL command preprocessor, command execution and dataset persistence.

Group

Classes

Class Hierarchy
  uADStanOption_TADResourceOptionsuADStanOption_TADResourceOptions
File

uADStanOption

Links
public, published, TADResourceOptions Members, Classes, See Also
Description

The TADResourceOptions class represents the set of properties controlling how FireDAC components and Phys Layer command interfaces:

  • preprocess SQL command text (EscapeExpand, MacroCreate, MacroExpand, ParamCreate, ParamExpand, PreprocessCmdText, UnifyParams);
  • prepare command (DirectExecute, DefaultParamType);
  • execute command (CmdExecMode, CmdExecTimeout, ArrayDMLSize);
  • manage resources (SilentMode);
  • persist datasets (Persistent, Backup, BackupExt, BackupFolder, DefaultStoreExt, DefaultStoreFolder, DefaultStoreFormat, StoreVersion, StoreItems).

The TADResourceOptions is intermediate class in resource options classes hierarchy. The TADCustomManager and TADCustomConnection classes use TADTopResourceOptions. The TADCustomCommand and TADDataSet use TADBottomResourceOptions.

Syntax
TADResourceOptions = class(TADCustomOptions);
See Also

Setting Options, TADCustomManager.ResourceOptions, TADCustomConnection.ResourceOptions, TADCustomCommand.ResourceOptions, TADQuery.ResourceOptions, IADPhysCommand.Options

What do you think about this topic? Send feedback!


TADResourceOptions Members

TADResourceOptions Members
TADResourceOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADResourceOptions.

Class

TADResourceOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Properties
Property | Description
ActualSilentMode | Returns actual silent mode a dataset will use.
ArrayDMLSize | Limits the maximum possible Array DML array size.
AssignedValues | Specifies the set of changed options.
Backup | Controls backup of data file for persistent datasets.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
CmdExecMode | Controls DBMS action execution mode.
CmdExecTimeout | Controls DBMS action execution timeout.
DefaultParamType | Specifies default parameter direction.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
DirectExecute | Controls preparation of SQL statements.
EscapeExpand | Controls processing of escape sequences.
MacroCreate | Controls automatic filling of Macros collection.
MacroExpand | Controls expansion of macros.
ParamCreate | Controls automatic filling of Params collection.
ParamExpand | Controls expansion of parameters.
Persistent | Controls dataset persistence.
PreprocessCmdText | Controls SQL command text preprocessor.
SilentMode | Controls dataset GUI feedback.
StoreItems | Specifies the data to write into the persistent dataset data files or streams.
StoreVersion | Specifies the format version for the persistent dataset data files or streams.
UnifyParams | Controls unification of a stored procedure parameters.
Version | The current version of options.
Links
TADResourceOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADResourceOptions Class Legend Methods Properties Send Feedback

The public members of the TADResourceOptions class are listed here.

Class

TADResourceOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Properties
Property | Description
ActualSilentMode | Returns actual silent mode a dataset will use.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
PreprocessCmdText | Controls SQL command text preprocessor.
Links
TADResourceOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADResourceOptions.ActualSilentMode Property

TADResourceOptions.ActualSilentMode Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Returns actual silent mode a dataset will use.

Group

public

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Use ActuaSilentMode to get actual silent mode a dataset will use. Actual silent mode is conjunction of SilentMode and uADGUIxIntf.ADGUIxSilent.

Syntax
property ActualSilentMode: Boolean;
See Also

SilentMode, uADGUIxIntf.ADGUIxSilent

What do you think about this topic? Send feedback!


TADResourceOptions.BackupExt Property

TADResourceOptions.BackupExt Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Specifies persistent dataset backup copy extension.

Group

public

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Use BackupExt property to specify extension, which will get backup copy of persistent dataset file. Default value is '.bak'.

The backup copy file gets the same base file name as it is specified by TADBottomResourceOptions.PersistentFileName, BackupExt extension and will be put to BackupFolder folder.

Syntax
property BackupExt: String;
See Also

Backup, BackupFolder, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADResourceOptions.BackupFolder Property

TADResourceOptions.BackupFolder Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Specifies persistent dataset backup copy folder.

Group

public

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Use BackupExt property to specify extension, which will get backup copy of persistent dataset file. The default value is current folder.

The backup copy file gets the same base file name as it is specified by TADBottomResourceOptions.PersistentFileName, BackupExt extension and will be put to BackupFolder folder.

Syntax
property BackupFolder: String;
See Also

Backup, BackupExt, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADResourceOptions.DefaultStoreExt Property

TADResourceOptions.DefaultStoreExt Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Specifies default extension for persistent dataset data files.

Group

public

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Use DefaultStoreExt property to specify default extension for data file, where persistent dataset stores its data. The default value is empty string.

FireDAC uses DefaultStoreExt, when PersistentFileName property value or AFileName argument of the SaveToFile method does not have extension specified.

Syntax
property DefaultStoreExt: String;
See Also

DefaultStoreFormat, DefaultStoreFolder, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADResourceOptions.DefaultStoreFolder Property

TADResourceOptions.DefaultStoreFolder Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Specifies the default folder for the persistent dataset data files.

Group

public

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Use DefaultStoreFolder property to specify the default folder for the data file, where persistent dataset stores its data. The default value is empty string.

FireDAC uses DefaultStoreFolder, when PersistentFileName property value or AFileName argument of the SaveToFile method does not have a folder specified.

Syntax
property DefaultStoreFolder: String;
See Also

DefaultStoreFormat, DefaultStoreExt, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADResourceOptions.DefaultStoreFormat Property

TADResourceOptions.DefaultStoreFormat Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Specifies the default format for the persistent dataset data files.

Group

public

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Use DefaultStoreFormat property to specify the default format for the data file, where dataset stores its persistent data. The default value is sfBinary.

FireDAC uses DefaultStoreFormat, when PersistentFileName property value or AFileName argument of the SaveToFile method does not have an extension specified, and DefaultStoreExt property value is empty.

Syntax
property DefaultStoreFormat: TADStorageFormat;
See Also

DefaultStoreExt, DefaultStoreFolder, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADResourceOptions.PreprocessCmdText Property

TADResourceOptions.PreprocessCmdText Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Controls SQL command text preprocessor.

Group

public

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Use PreprocessCmdText property to enable / disable SQL command text preprocessor. The default value is True.

The property is shortcut to 5 properties, allowing to control all aspects of SQL command text preprocessor:

  • EscapeExpand;
  • MacroCreate;
  • MacroExpand;
  • ParamCreate;
  • ParamExpand.

Setting PreprocessCmdText to some value, sets all these 5 properties to the same value. By default it is True. Setting it to False, allows to speed up processing of long SQL command texts (tens of KB).

Syntax
property PreprocessCmdText: Boolean;
See Also

EscapeExpand, MacroCreate, MacroExpand, ParamCreate, ParamExpand

What do you think about this topic? Send feedback!


TADResourceOptions.Assign Method

TADResourceOptions.Assign Method
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace Example public See Also Send Feedback

Assigns all options of one option object to another.

Group

public

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, Example, public, See Also
Parameters
Parameters | Description
ASource: TPersistent | A source options object.
Description

Use the Assign method to assign all changed option values of ASource option object to this object. After that corresponding options will stop inheriting the values from more high level option object.

Syntax
procedure Assign(ASource: TPersistent); override;
See Also

RestoreDefaults

Example
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);
What do you think about this topic? Send feedback!


TADResourceOptions.RestoreDefaults Method

TADResourceOptions.RestoreDefaults Method
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Restore option default values.

Group

public

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Call RestoreDefaults to reset all changed options to their default values.

Syntax
procedure RestoreDefaults; override;
See Also

AssignedValues

What do you think about this topic? Send feedback!


published

published
TADResourceOptions Class Legend Properties Send Feedback

The published members of the TADResourceOptions class are listed here.

Class

TADResourceOptions Class

Properties
Property | Description
ArrayDMLSize | Limits the maximum possible Array DML array size.
AssignedValues | Specifies the set of changed options.
Backup | Controls backup of data file for persistent datasets.
CmdExecMode | Controls DBMS action execution mode.
CmdExecTimeout | Controls DBMS action execution timeout.
DefaultParamType | Specifies default parameter direction.
DirectExecute | Controls preparation of SQL statements.
EscapeExpand | Controls processing of escape sequences.
MacroCreate | Controls automatic filling of Macros collection.
MacroExpand | Controls expansion of macros.
ParamCreate | Controls automatic filling of Params collection.
ParamExpand | Controls expansion of parameters.
Persistent | Controls dataset persistence.
SilentMode | Controls dataset GUI feedback.
StoreItems | Specifies the data to write into the persistent dataset data files or streams.
StoreVersion | Specifies the format version for the persistent dataset data files or streams.
UnifyParams | Controls unification of a stored procedure parameters.
Links
TADResourceOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


TADResourceOptions.ArrayDMLSize Property

TADResourceOptions.ArrayDMLSize Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Limits the maximum possible Array DML array size.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Set ArrayDMLSize to the maximum possible Array DML size, which is supported by the target DBMS. By default array DML size is unlimited (MAXINT).

If actual array DML size is greater than ArrayDMLSize, then FireDAC will transparently split one big batch into few smaller, where each will be of ArrayDMLSize size or less. Some DBMS (Firebird, MS SQL Server) have problems with large array DML size. If you experience some "strange" problems with array DML, then try to set ArrayDMLSize.

Syntax
property ArrayDMLSize: Integer;
See Also

Array DML, TADDataSet.Execute

What do you think about this topic? Send feedback!


TADResourceOptions.AssignedValues Property

TADResourceOptions.AssignedValues Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the set of changed options.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use AssignedValues to get / set the set of modified option values.

If some option is changed at this level, then corresponding flag is included into AssignedValues. If flag is not included, then an option value is inherited from more high level. Excluding flag from AssignedValues makes option inheriting its value from more high level.

See Setting Options for more details.

Syntax
property AssignedValues: TADResourceOptionValues;
See Also

RestoreDefaults

What do you think about this topic? Send feedback!


TADResourceOptions.Backup Property

TADResourceOptions.Backup Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls backup of data file for persistent datasets.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use Backup property to control, should persistent dataset backup data file, where persistent dataset stores its data, before it will be overridden. If it is True, then backup copy of data file will be created. By default it is False.

The backup copy file gets the same base file name as it is specified by TADBottomResourceOptions.PersistentFileName, BackupExt extension and will be put to BackupFolder folder.

Syntax
property Backup: Boolean;
See Also

Persistent, Backup, BackupExt, BackupFolder

What do you think about this topic? Send feedback!


TADResourceOptions.CmdExecMode Property

TADResourceOptions.CmdExecMode Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace Example published See Also Send Feedback

Controls DBMS action execution mode.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, Example, published, See Also
Description

Use CmdExecMode property to control DBMS action execution mode, at first it synchronism:

Mode | Description
amBlocking | The calling thread and GUI are blocked until an action will be finished.
amNonBlocking | The calling thread is blocked until an action will be finished. The GUI is not blocked.
amCancelDialog | The calling thread and GUI are blocked until an action will be finished. FireDAC shows dialog, allowing to cancel an action.
amAsync | The calling thread and GUI are not blocked. The called method will return immediately.

The default value is amBlocking. This property controls the following methods synchronism:

  • TADDataSet.Open, TADCustomCommand.Open, IADPhysCommand.Open;
  • TADDataSet.Execute, TADCustomCommand.Execute, IADPhysCommand.Execute;
  • fetching in TADDataSet, TADCustomCommand.Fetch, IADPhysCommand.Fetch.

If mode is amNonBlocking, then application continues to process GUI messages, but ignores mouse and keyboard events.

If mode is amCancelDialog, then application should include TADGUIxAsyncExecuteDialog component into any form or data module. If it is not included, then exception will be raised.

The dialog has the "Cancel" button, allowing to terminate current action. If DBMS does not support action canceling, then button will be hidden.

If mode is amAsync, an application can get notification about action finish using appropriate event handler or callback:

Class | Method | Event
TADDataSet | Open | AfterOpen event
 | Execute | AfterExecute event
TADCustomCommand | Open | AfterOpen event
 | Execute | AfterExecute event
 | Fetch | AfterFetch event
IADPhysCommand | Open | StateHandler.HandleFinished callback
 | Execute | StateHandler.HandleFinished callback
 | Fetch | StateHandler.HandleFinished callback

Application can control action timeout by setting CmdExecTimeout property.

Syntax
property CmdExecMode: TADStanAsyncMode;
See Also

Asynchronous Execution, CmdExecTimeout, TADDataSet.Open, TADCustomCommand.Open, IADPhysCommand.Open, TADDataSet.Execute, TADCustomCommand.Execute, IADPhysCommand.Execute, TADCustomCommand.Fetch, IADPhysCommand.Fetch

Example

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\Async;
  • FireDAC\Samples\Phys Layer\IADPhysCommand\Async.
What do you think about this topic? Send feedback!


TADResourceOptions.CmdExecTimeout Property

TADResourceOptions.CmdExecTimeout Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace Example 1 Example 2 published See Also Send Feedback

Controls DBMS action execution timeout.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, Example 1, Example 2, published, See Also
Description

Use CmdExecTimeout property to control the DBMS action execution timeout. The value <= 0 means - no timeout. The default value is -1. The time is in milliseconds (0,001 sec).

This property controls the following methods timeout:

  • TADDataSet.Open, TADCustomCommand.Open, IADPhysCommand.Open;
  • TADDataSet.Execute, TADCustomCommand.Execute, IADPhysCommand.Execute;
  • fetching in TADDataSet, TADCustomCommand.Fetch, IADPhysCommand.Fetch.
Syntax
property CmdExecTimeout: LongWord;
See Also

Asynchronous Execution, CmdExecMode, TADDataSet.Open, TADCustomCommand.Open, IADPhysCommand.Open, TADDataSet.Execute, TADCustomCommand.Execute, IADPhysCommand.Execute, TADCustomCommand.Fetch, IADPhysCommand.Fetch

Example 1

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\Async;
  • FireDAC\Samples\Phys Layer\IADPhysCommand\Async.
Example 2
// set timeout to 5 seconds
ADQuery1.ResourceOptions.CmdExecTimeout := 5000;
ADQuery1.ExecSQL;
What do you think about this topic? Send feedback!


TADResourceOptions.DefaultParamType Property

TADResourceOptions.DefaultParamType Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies default parameter direction.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use DefaultParamType to specify default parameter direction. The default value is ptInput.

If TADParam.ParamType is equal to ptUnknown, then FireDAC will use DefaultParamType. If TADParam.ParamType remains ptUnknown, then exception will be raised.

Syntax
property DefaultParamType: TParamType;
See Also

TADParam.ParamType

What do you think about this topic? Send feedback!


TADResourceOptions.DirectExecute Property

TADResourceOptions.DirectExecute Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published Send Feedback

Controls preparation of SQL statements.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published
Description

Use DirectExecute property to specify should FireDAC prepare SQL statement before execution (False) or execute it directly (True). The default value is False.

This property was introduced at first for MS SQL Server support. Where prepared and direct execution may have different effects. Or even prepared execution may fail. If you will get "strange" errors, then try to set DirectExecute to True.

Syntax
property DirectExecute: Boolean;
What do you think about this topic? Send feedback!


TADResourceOptions.EscapeExpand Property

TADResourceOptions.EscapeExpand Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls processing of escape sequences.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use EscapeExpand property to control escape sequences expansion. If it is True, then they will be processed and expanded into target DBMS syntax constructions. If it is False, then FireDAC will ignore escape sequences. The default value is True.

Setting EscapeExpand to False, may be usefull, if:

  • target DBMS uses '{', '}' symbols in its own SQL dialect and FireDAC cannot recognize them as a SQL construction. Then SQL commands with these symbols may confuse FireDAC SQL preprocessor. See Preprocessing Command Text for escape sequences description.
  • application does not use escape sequences at all.

Setting PreprocessCmdText to False, sets EscapeExpand to False.

Syntax
property EscapeExpand: Boolean;
See Also

Preprocessing Command Text, PreprocessCmdText, MacroCreate, MacroExpand, ParamCreate, ParamExpand

What do you think about this topic? Send feedback!


TADResourceOptions.MacroCreate Property

TADResourceOptions.MacroCreate Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls automatic filling of Macros collection.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use MacroCreate property to control automatic filling of Macros collection. If it is True, SQL preprocessor scans SQL command text for '!' or '&' symbols, extracts macro names and puts them into Macros collection. The scanning will be performed at each command text change. The default value is True.

Setting MacroCreate to False, may be usefull, if:

  • target DBMS uses '!', '&' symbols in its own SQL dialect and FireDAC cannot recognize them as a SQL construction. Then SQL commands with these symbols may confuse FireDAC SQL preprocessor. See Preprocessing Command Text for macros description.
  • application fills Macros collection "by hands".
  • application does not use macros at all.

Setting PreprocessCmdText to False, sets MacroCreate to False.

Syntax
property MacroCreate: Boolean;
See Also

Preprocessing Command Text, PreprocessCmdText, EscapeExpand, MacroExpand, ParamCreate, ParamExpand

What do you think about this topic? Send feedback!


TADResourceOptions.MacroExpand Property

TADResourceOptions.MacroExpand Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls expansion of macros.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use MacroExpand property to control macros expansion. If it is True, then their values will be substituted into SQL command text instead of corresponding macro markers. If it is False, then FireDAC does not substitute macro values into command text. The default value is True.

Setting MacroExpand to False, may be usefull if:

  • target DBMS uses '!', '&' symbols in its own SQL dialect and FireDAC cannot recognize them as a SQL construction. Then SQL commands with these symbols may confuse FireDAC SQL preprocessor. See Preprocessing Command Text for macros description.
  • application does not use macros at all.

Setting PreprocessCmdText to False, sets MacroExpand to False.

Syntax
property MacroExpand: Boolean;
See Also

Preprocessing Command Text, PreprocessCmdText, EscapeExpand, MacroCreate, ParamCreate, ParamExpand

What do you think about this topic? Send feedback!


TADResourceOptions.ParamCreate Property

TADResourceOptions.ParamCreate Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls automatic filling of Params collection.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use ParamCreate property to control automatic filling of Params collection. If it is True, SQL preprocessor scans SQL command text for ':' symbols, extracts macro names and puts into a Params collection. The scanning will be performed at each command text change. The default value is True.

Setting ParamCreate to False, may be useful if:

  • target DBMS uses ':' symbols in its own SQL dialect and FireDAC cannot recognize them as a SQL construction. Then SQL commands with these symbols may confuse FireDAC SQL preprocessor.
  • SQL command cannot contain parameters, like in a DDL SQL.
  • application does not use parameters at all.

Setting PreprocessCmdText to False, sets ParamCreate to False.

Syntax
property ParamCreate: Boolean;
See Also

Preprocessing Command Text, PreprocessCmdText, EscapeExpand, MacroExpand, ParamCreate, ParamExpand

What do you think about this topic? Send feedback!


TADResourceOptions.ParamExpand Property

TADResourceOptions.ParamExpand Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls expansion of parameters.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use ParamExpand property to control parameters expansion. If it is True, then the FireDAC styled markers (:name) will be replaced with the DBMS SQL dialect markers. If it is False, then FireDAC does not replace the parameter markers. The default value is True.

Setting ParamExpand to False, may be usefull if:

  • SQL command cannot contain parameters, like a DDL SQL. But a command may contain FireDAC-like markers, which actually are not the parameters. In some cases such markers may confuse FireDAC.
  • application does not use parameters at all.

Setting PreprocessCmdText to False, sets ParamsExpand to False.

Syntax
property ParamExpand: Boolean;
See Also

Preprocessing Command Text, PreprocessCmdText, EscapeExpand, MacroCreate, MacroExpand, ParamCreate

What do you think about this topic? Send feedback!


TADResourceOptions.Persistent Property

TADResourceOptions.Persistent Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls dataset persistence.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use Persistent property to control dataset persistence. By default it is False.

If it is True, then dataset will load it content from data file at Open call and will save data to data file at Close call. At dataset will load data, if TADBottomResourceOptions.PersistentFileName is not empty and file exists. A dataset will save data, TADBottomResourceOptions.PersistentFileName is not empty, file does not exists or data was changed after Open call.

Special case is TADCustomMemTable. If TADBottomResourceOptions.PersistentFileName is empty, then dataset will save / load data from DFM. So, to save in-memory table content at design time to DFM file, set Persistent to True and clear PersistentFileName.

Syntax
property Persistent: Boolean;
See Also

TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADResourceOptions.SilentMode Property

TADResourceOptions.SilentMode Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls dataset GUI feedback.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use SilentMode property to control should the dataset show the SQL-hourglass mouse cursor, when the dataset performs potentially long running actions. When it is False, then the dataset will show the SQL-hourglass. When True, then not. By default it is False, for TADCustomMemTable it is True.

Setting to True allows to speedup the dataset processing algorithms.

Application can disable all GUI feedback, by setting the uADGUIxIntf.FADGUIxSilentMode to True.

Syntax
property SilentMode: Boolean;
See Also

uADGUIxIntf.FADGUIxSilentMode

What do you think about this topic? Send feedback!


TADResourceOptions.StoreItems Property

TADResourceOptions.StoreItems Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the data to write into the persistent dataset data files or streams.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use StoreItems property to specify the data to write into a data file or a stream, where persistent dataset stores its data. The default value is [siData, siDelta, siMeta].

Value | Description
siData | Store data.
siDelta | Store changes log together with the data.
siMeta | Store dataset metadata, including column definitions, constraints, etc.
Syntax
property StoreItems: TADStoreItems;
See Also

StoreVersion, TADDataSet.SaveToStream, TADDataSet.SaveToFile, TADDataSet.LoadFromStream, TADDataSet.LoadFromFile

What do you think about this topic? Send feedback!


TADResourceOptions.StoreVersion Property

TADResourceOptions.StoreVersion Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the format version for the persistent dataset data files or streams.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use StoreVersion property to specify the format version for a data file or a stream, where dataset stores its persistent data. The default value is -1.

The StoreVersion property is used only to write a data. For reading is used the version stored in a persistent data, so setting StoreVersion for reading does not have an effect.

Syntax
property StoreVersion: Integer;
See Also

DefaultStoreFormat, StoreItems, TADDataSet.SaveToStream, TADDataSet.SaveToFile, TADDataSet.LoadFromStream, TADDataSet.LoadFromFile

What do you think about this topic? Send feedback!


TADResourceOptions.UnifyParams Property

TADResourceOptions.UnifyParams Property
TADResourceOptions Class TADResourceOptions Members uADStanOption Namespace published Send Feedback

Controls unification of a stored procedure parameters.

Group

published

Links
TADResourceOptions Class, TADResourceOptions Members, uADStanOption Namespace, published
Description

Use UnifyParams property to specify, should FireDAC unify the stored procedure parameters (True) or not. By default it is False.

The unification includes:

  • removing of the special symbols from the stored procedure parameter names. At moment, FireDAC deletes '@' prefix from Microsoft SQL Server and Sybase SQL Anywhere parameter names. Other DBMS's supported by FireDAC do not use a special symbols.
  • removing of the special parameters. At moment, FireDAC deletes 'RESULT' parameter from the Microsoft SQL Server and Sybase SQL Anywhere stored procedure parameters set. Other DBMS's supported by FireDAC do not use a special parameters.
Syntax
property UnifyParams: Boolean;
What do you think about this topic? Send feedback!


TADTopResourceOptions Class

TADTopResourceOptions Class
public published TADTopResourceOptions Members Classes See Also Send Feedback

The set of options controlling SQL automatic connection recover, dataset persistence and server output.

Group

Classes

Class Hierarchy
  uADStanOption_TADTopResourceOptionsuADStanOption_TADTopResourceOptionsuADStanOption_TADTopResourceOptions
File

uADStanOption

Links
public, published, TADTopResourceOptions Members, Classes, See Also
Description

The TADTopResourceOptions class represents the set of properties controlling how FireDAC components and Phys Layer command interfaces:

  • automatically activate connection (AutoConnect);
  • recover broken connection (AutoReconnect);
  • bring server output to a client (ServerOutput, ServerOutputSize);
  • manage connection resources(KeepConnection, MaxCursors).

And also persistence of datasets.

The TADTopResourceOptions is terminal class in resource options classes hierarchy. The TADCustomManager and TADCustomConnection classes are using it.

Syntax
TADTopResourceOptions = class(TADResourceOptions);
See Also

Setting Options, TADCustomManager.ResourceOptions, TADCustomConnection.ResourceOptions

What do you think about this topic? Send feedback!


TADTopResourceOptions Members

TADTopResourceOptions Members
TADTopResourceOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADTopResourceOptions.

Class

TADTopResourceOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Properties
Property | Description
ActualSilentMode | Returns actual silent mode a dataset will use.
ArrayDMLSize | Limits the maximum possible Array DML array size.
AssignedValues | Specifies the set of changed options.
AutoConnect | Controls automatic management of connection Active state.
AutoReconnect | Controls automatic connection recovery.
Backup | Controls backup of data file for persistent datasets.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
CmdExecMode | Controls DBMS action execution mode.
CmdExecTimeout | Controls DBMS action execution timeout.
DefaultParamType | Specifies default parameter direction.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
DirectExecute | Controls preparation of SQL statements.
EscapeExpand | Controls processing of escape sequences.
KeepConnection | Specifies whether an application remains connected to a database even if no datasets are open.
MacroCreate | Controls automatic filling of Macros collection.
MacroExpand | Controls expansion of macros.
MaxCursors | Controls maximum allowed number of active commands.
ParamCreate | Controls automatic filling of Params collection.
ParamExpand | Controls expansion of parameters.
Persistent | Controls dataset persistence.
PreprocessCmdText | Controls SQL command text preprocessor.
ServerOutput | Controls accessibility of the server side messages.
ServerOutputSize | Controls the size of Oracle message output buffer.
SilentMode | Controls dataset GUI feedback.
StoreItems | Specifies the data to write into the persistent dataset data files or streams.
StoreVersion | Specifies the format version for the persistent dataset data files or streams.
UnifyParams | Controls unification of a stored procedure parameters.
Version | The current version of options.
Links
TADTopResourceOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADTopResourceOptions Class Legend Methods Send Feedback

The public members of the TADTopResourceOptions class are listed here.

Class

TADTopResourceOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Links
TADTopResourceOptions Class, Legend, Methods
What do you think about this topic? Send feedback!


TADTopResourceOptions.Assign Method

TADTopResourceOptions.Assign Method
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace Example public See Also Send Feedback

Assigns all options of one option object to another.

Group

public

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, Example, public, See Also
Parameters
Parameters | Description
ASource: TPersistent | A source options object.
Description

Use the Assign method to assign all changed option values of ASource option object to this object. After that corresponding options will stop inheriting the values from more high level option object.

Syntax
procedure Assign(ASource: TPersistent); override;
See Also

RestoreDefaults

Example
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);
What do you think about this topic? Send feedback!


TADTopResourceOptions.RestoreDefaults Method

TADTopResourceOptions.RestoreDefaults Method
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace public See Also Send Feedback

Restore option default values.

Group

public

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, public, See Also
Description

Call RestoreDefaults to reset all changed options to their default values.

Syntax
procedure RestoreDefaults; override;
See Also

AssignedValues

What do you think about this topic? Send feedback!


published

published
TADTopResourceOptions Class Legend Properties Send Feedback

The published members of the TADTopResourceOptions class are listed here.

Class

TADTopResourceOptions Class

Properties
Property | Description
AutoConnect | Controls automatic management of connection Active state.
AutoReconnect | Controls automatic connection recovery.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
KeepConnection | Specifies whether an application remains connected to a database even if no datasets are open.
MaxCursors | Controls maximum allowed number of active commands.
ServerOutput | Controls accessibility of the server side messages.
ServerOutputSize | Controls the size of Oracle message output buffer.
Links
TADTopResourceOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


TADTopResourceOptions.AutoConnect Property

TADTopResourceOptions.AutoConnect Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls automatic management of connection Active state.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use AutoConnect property to control automatic management of a connection object Active state. The default value is True. Setting it to True has the following effect:

  • Opens connection object, if it is closed and command or dataset, linked to this connection, requires active connection. Otherwise - exception will be raised.
  • Closes connection object, if it is open and current call requires inactive connection. Otherwise - exception will be raised.
  • Brings connection object to online state, if it is offline and command or dataset, linked to this connection, requires active online connection. Otherwise - exception will be raised.
Syntax
property AutoConnect: Boolean;
See Also

Establishing Connection, AutoReconnect, KeepConnection, MaxCursors

What do you think about this topic? Send feedback!


TADTopResourceOptions.AutoReconnect Property

TADTopResourceOptions.AutoReconnect Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls automatic connection recovery.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use AutoReconnect property to control automatic connection recovery feature.

Set it to True, so when FireDAC will discover that connection is broken, it will try to transparently reestablish it. If it is False, then FireDAC will raise exception and will not try to reconnect.

Application can control connection recovery, using TADCustomConnection events. See TADCustomConnection.OnRecover for details. It is important to understand, that 100% transparent recovery is not possible. After connection is recovered:

  • all datasets has the same Active state as before connection recovery;
  • all datasets has the same Prepared state as before connection recovery;
  • all not yet fetched records are discarded and corresponding cursors are closed;
  • all transactions are inactive;
  • all event alerters are unregistered.

An application will need to take similar actions, as after logging to the DBMS server.

Syntax
property AutoReconnect: Boolean;
See Also

Recovering Connection, TADCustomConnection.OnLosted, TADCustomConnection.OnRecover, TADCustomConnection.OnRestored

What do you think about this topic? Send feedback!


TADTopResourceOptions.BackupExt Property

TADTopResourceOptions.BackupExt Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies persistent dataset backup copy extension.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use BackupExt property to specify extension, which will get backup copy of persistent dataset file. Default value is '.bak'.

The backup copy file gets the same base file name as it is specified by TADBottomResourceOptions.PersistentFileName, BackupExt extension and will be put to BackupFolder folder.

Syntax
property BackupExt: String;
See Also

Backup, BackupFolder, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADTopResourceOptions.BackupFolder Property

TADTopResourceOptions.BackupFolder Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies persistent dataset backup copy folder.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use BackupExt property to specify extension, which will get backup copy of persistent dataset file. The default value is current folder.

The backup copy file gets the same base file name as it is specified by TADBottomResourceOptions.PersistentFileName, BackupExt extension and will be put to BackupFolder folder.

Syntax
property BackupFolder: String;
See Also

Backup, BackupExt, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADTopResourceOptions.DefaultStoreExt Property

TADTopResourceOptions.DefaultStoreExt Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies default extension for persistent dataset data files.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use DefaultStoreExt property to specify default extension for data file, where persistent dataset stores its data. The default value is empty string.

FireDAC uses DefaultStoreExt, when PersistentFileName property value or AFileName argument of the SaveToFile method does not have extension specified.

Syntax
property DefaultStoreExt: String;
See Also

DefaultStoreFormat, DefaultStoreFolder, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADTopResourceOptions.DefaultStoreFolder Property

TADTopResourceOptions.DefaultStoreFolder Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the default folder for the persistent dataset data files.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use DefaultStoreFolder property to specify the default folder for the data file, where persistent dataset stores its data. The default value is empty string.

FireDAC uses DefaultStoreFolder, when PersistentFileName property value or AFileName argument of the SaveToFile method does not have a folder specified.

Syntax
property DefaultStoreFolder: String;
See Also

DefaultStoreFormat, DefaultStoreExt, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADTopResourceOptions.DefaultStoreFormat Property

TADTopResourceOptions.DefaultStoreFormat Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the default format for the persistent dataset data files.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use DefaultStoreFormat property to specify the default format for the data file, where dataset stores its persistent data. The default value is sfBinary.

FireDAC uses DefaultStoreFormat, when PersistentFileName property value or AFileName argument of the SaveToFile method does not have an extension specified, and DefaultStoreExt property value is empty.

Syntax
property DefaultStoreFormat: TADStorageFormat;
See Also

DefaultStoreExt, DefaultStoreFolder, TADBottomResourceOptions.PersistentFileName

What do you think about this topic? Send feedback!


TADTopResourceOptions.KeepConnection Property

TADTopResourceOptions.KeepConnection Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies whether an application remains connected to a database even if no datasets are open.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use KeepConnection to specify whether an application remains connected to a database even if no associated dataset components are currently active. When KeepConnection is true (the default) the connection is maintained. For connections to remote database servers, or for applications that frequently open and close datasets, set KeepConnection to true to reduce network traffic, speed up applications, and avoid logging in to the server each time the connection is reestablished.

When KeepConnection is false a connection is dropped when there are no open datasets. Dropping a connection releases system resources allocated to the connection, but if a dataset is later opened that uses the database, the connection must be reestablished and initialized.

Syntax
property KeepConnection: Boolean;
See Also

Establishing Connection

TADCustomConnection

What do you think about this topic? Send feedback!


TADTopResourceOptions.MaxCursors Property

TADTopResourceOptions.MaxCursors Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published Send Feedback

Controls maximum allowed number of active commands.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published
Description

Use MaxCursors property to limit maximum number of active commands in application.

If MaxCursors is > 0, then FireDAC will track the number of:

  • prepared or active commands;
  • prepared or active datasets.

And if next call (Prepare, Open or Execute) will make this number greater than MaxCursors, then FireDAC will automatically disconnect least often used commands and datasets. It is not guaranteed, that the exact total number of the active commands will be less or equal to MaxCursors.

For Oracle, that may help to avoid [image] ORA-01000 error. Note, there is no direct relation between number of active FireDAC commands and the number of session active cursors. Read [image] Monitoring Open and Cached Cursors for more details.

Syntax
property MaxCursors: Integer;
What do you think about this topic? Send feedback!


TADTopResourceOptions.ServerOutput Property

TADTopResourceOptions.ServerOutput Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace Example 1 Example 2 published See Also Send Feedback

Controls accessibility of the server side messages.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, Example 1, Example 2, published, See Also
Description

Use ServerOutput to control accessibility of the server side non-error messages (warning, user messages, etc) to a client application. Set it to True to guarantee that messages will be delivered. Set it to False, then messages may be delivered, may be not - depending on a DBMS.

Not all supported DBMS's are returning non-error messages automatically. For example, for Oracle and MySQL FireDAC need to call additional DBMS API to bring the messages to a client. That requires additional server round trips. But for SQL Server and Sybase SQL Anywhere the messages are returned always automatically. Setting ServerOutput to True guarantees, that for any DBMS the messages will be returned to client automatically, but that leads to additional SQL execution overhead.

The returned messages will be accessible through properties:

  • TADCustomConnection.Messages;
  • IADPhysConnectionIntf.Messages.

The messages will be stored there until next DBMS call (Open, ExecSQL, StartTransaction, etc).

Syntax
property ServerOutput: Boolean;
See Also

TADCustomConnection.Messages, IADPhysConnectionIntf.Messages

Example 1
// SQL Server
procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  ADConnection1.ResourceOptions.ServerOutput := True;
  ADQuery1.ExecSQL('EXEC sp_configure ''show advanced options'', 1');
  for i := 0 to ADConnection1.ConnectionIntf.Messages.ErrorCount - 1 do
    Memo1.Lines.Add(ADConnection1.ConnectionIntf.Messages[i].Message);
end;
Example 2
// Oracle
procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  ADConnection1.ResourceOptions.ServerOutputSize := 256 * 1024;
  ADConnection1.ResourceOptions.ServerOutput := True;
  ADQuery1.ExecSQL('begin dbms_output.put_line(''trace message''); end;');
  for i := 0 to ADConnection1.ConnectionIntf.Messages.ErrorCount - 1 do
    Memo1.Lines.Add(ADConnection1.ConnectionIntf.Messages[i].Message);
end;
What do you think about this topic? Send feedback!


TADTopResourceOptions.ServerOutputSize Property

TADTopResourceOptions.ServerOutputSize Property
TADTopResourceOptions Class TADTopResourceOptions Members uADStanOption Namespace published See Also Send Feedback

Controls the size of Oracle message output buffer.

Group

published

Links
TADTopResourceOptions Class, TADTopResourceOptions Members, uADStanOption Namespace, published, See Also
Description

Use property ServerOutputSize to specify size of a Oracle DBMS_OUTPUT buffer.

Syntax
property ServerOutputSize: Integer;
See Also

ServerOutput

What do you think about this topic? Send feedback!


TADTxOptions Class

TADTxOptions Class
public published TADTxOptions Members Classes See Also Send Feedback

The set of options controlling transaction behaviour.

Group

Classes

Class Hierarchy
  uADStanOption_TADTxOptions
File

uADStanOption

Links
public, published, TADTxOptions Members, Classes, See Also
Description

The TADTxOptions class represents the set of properties controlling behavior of a transactions, initiated by the FireDAC components or by the Phys Layer command interfaces:

  • isolation level (Isolation);
  • update ability (ReadOnly);
  • automatic committing (AutoCommit, AutoStart, AutoStop, StopOptions);
  • DBMS specific parameters (Params);
  • disconnection action (DisconnectAction);
  • nesting (EnableNested).

The transaction option applying is deferred until next SQL command execution. Changed options will be applied right before execution of a next SQL command.

Syntax
TADTxOptions = class(TPersistent);
See Also

Managing Transactions, TADCustomConnection.TxOptions, TADCustomTransaction.Options, IADPhysTransaction.Options

What do you think about this topic? Send feedback!


TADTxOptions Members

TADTxOptions Members
TADTxOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADTxOptions.

Class

TADTxOptions Class

Methods
Method | Description
ClearChanged | Clears Changed flags.
Properties
Property | Description
AutoCommit | Controls the automatic completion of transaction.
AutoStart | Controls automatic start of a transaction.
AutoStop | Controls automatic finishing of a transaction.
Changed | Returns the set of changed transaction options.
DisconnectAction | Specifies an action FireDAC should take on closing connection.
EnableNested | Controls nested transactions.
Isolation | Specifies the transaction isolation level for the transactions managed by FireDAC.
Params | Specifies custom DBMS transaction parameters.
ReadOnly | Specifies whether the transaction is read-only.
StopOptions | Specifies automatic transaction stoping options.
Links
TADTxOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADTxOptions Class Legend Methods Properties Send Feedback

The public members of the TADTxOptions class are listed here.

Class

TADTxOptions Class

Methods
Method | Description
ClearChanged | Clears Changed flags.
Properties
Property | Description
Changed | Returns the set of changed transaction options.
Links
TADTxOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


TADTxOptions.Changed Property

TADTxOptions.Changed Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace public See Also Send Feedback

Returns the set of changed transaction options.

Group

public

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, public, See Also
Description

Use Changed property to read the set of changed transaction options, which are not yet applied to a DBMS. After changed options will be applied to a DBMS, Changed is cleared. In most cases, application does not need to use this property.

Syntax
property Changed: TADTxValues;
See Also

ClearChanged

What do you think about this topic? Send feedback!


TADTxOptions.ClearChanged Method

TADTxOptions.ClearChanged Method
TADTxOptions Class TADTxOptions Members uADStanOption Namespace public See Also Send Feedback

Clears Changed flags.

Group

public

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, public, See Also
Description

Use ClearChanged method to clear changed options flag (Changed). In most cases, application does not need to use this method.

Syntax
procedure ClearChanged;
See Also

Changed

What do you think about this topic? Send feedback!


published

published
TADTxOptions Class Legend Properties Send Feedback

The published members of the TADTxOptions class are listed here.

Class

TADTxOptions Class

Properties
Property | Description
AutoCommit | Controls the automatic completion of transaction.
AutoStart | Controls automatic start of a transaction.
AutoStop | Controls automatic finishing of a transaction.
DisconnectAction | Specifies an action FireDAC should take on closing connection.
EnableNested | Controls nested transactions.
Isolation | Specifies the transaction isolation level for the transactions managed by FireDAC.
Params | Specifies custom DBMS transaction parameters.
ReadOnly | Specifies whether the transaction is read-only.
StopOptions | Specifies automatic transaction stoping options.
Links
TADTxOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


TADTxOptions.AutoCommit Property

TADTxOptions.AutoCommit Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace published See Also Send Feedback

Controls the automatic completion of transaction.

Group

published

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, published, See Also
Description

Use AutoCommit property to control automatic transaction management. The default value is True.

If AutoCommit is True, then FireDAC will:

  • start transaction (if required) before each SQL command;
  • finish started transaction after SQL command execution. If command is successful, then FireDAC will issue COMMIT, otherwise - ROLLBACK.

If application has called StartTransaction method, then automatic transaction management will be disabled until corresponding Commit or Rollback method call. In general, there is no need to set AutoCommit property value to False, just use explicit transaction control (StartTransaction, Commit, Rollback) when you need it.

Depending on DBMS, FireDAC uses either native DBMS API for automatic transaction management, either emulates automatic transaction management. At moment only Interbase of Firebird are requiring emulation. In case of emulation setting AutoCommit to True is shortcut to setting AutoStart and AutoStop to True and including xoIfAutoStarted and xoIfCmdsInactive into StopOptions.

Syntax
property AutoCommit: Boolean;
See Also

TADCustomTransaction.StartTransaction, TADCustomTransaction.Commit, TADCustomTransaction.Rollback, AutoStart, AutoStop, StopOptions

What do you think about this topic? Send feedback!


TADTxOptions.AutoStart Property

TADTxOptions.AutoStart Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace published See Also Send Feedback

Controls automatic start of a transaction.

Group

published

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, published, See Also
Description

Use AutoStart property to control automatic start of a transaction, if DBMS does not support automatic transaction management, like Interbase or Firebird. The default value is True.

If AutoStart is True, then transaction will be automatically started, if there is no active transactions, DBMS itself cannot automatically initiate transaction, but transaction is required to perform SQL command.

Syntax
property AutoStart: Boolean;
See Also

AutoCommit, AutoStop

What do you think about this topic? Send feedback!


TADTxOptions.AutoStop Property

TADTxOptions.AutoStop Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace published See Also Send Feedback

Controls automatic finishing of a transaction.

Group

published

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, published, See Also
Description

Use AutoStop property to control automatic finishing of a transaction, if DBMS does not support automatic transaction management, like Interbase or Firebird. The default value is True.

If AutoStop is True, then transaction will be automatically finished, if there is active transactions automatically started by FireDAC.

Syntax
property AutoStop: Boolean;
See Also

AutoCommit, AutoStart, StopOptions

What do you think about this topic? Send feedback!


TADTxOptions.DisconnectAction Property

TADTxOptions.DisconnectAction Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies an action FireDAC should take on closing connection.

Group

published

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, published, See Also
Description

Use DisconnectAction to specify an action, which FireDAC should take on closing connection, if there is active transaction. The default value is xdCommit.

Action | Description
xdNone | Nothing to do. DBMS will take its default action.
xdCommit | Commit transaction.
xdRollback | Rollback transaction.
Syntax
property DisconnectAction: TADTxAction;
See Also

TADCustomConnection.Connected

What do you think about this topic? Send feedback!


TADTxOptions.EnableNested Property

TADTxOptions.EnableNested Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace published See Also Send Feedback

Controls nested transactions.

Group

published

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, published, See Also
Description

Set EnableNested property to True to enable nested transactions. And to False to disable them. The default value is True.

When a transaction is active then next StartTransaction call will create a nested transaction. FireDAC emulates nested transactions using savepoints if a DBMS does not support nested transactions explicitly. To disable nested transactions set EnableNested to False, then next StartTransaction call will raise an exception.

Syntax
property EnableNested: Boolean;
See Also

StartTransaction

What do you think about this topic? Send feedback!


TADTxOptions.Isolation Property

TADTxOptions.Isolation Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace published Send Feedback

Specifies the transaction isolation level for the transactions managed by FireDAC.

Group

published

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, published
Description

Use Isolation property to specify transaction isolation level for next transactions in current session. Changing of an isolation level does not affect a currently active transaction. The default value is xiReadCommitted.

The Isolation property value is DBMS independent and is translated into most close by meaning native DBMS isolation level.

Level | Description
xiUnspecified | Use default DBMS isolation level.
xiDirtyRead | Permits reading of uncommitted changes made to the database by other simultaneous transactions. Uncommitted changes are not permanent, and might be rolled back (undone) at any time. At this level a transaction is least isolated from the effects of other transactions.
xiReadCommitted | Permits reading of committed (permanent) changes made to the database by other simultaneous transactions. This is the default Isolation property value.
xiRepeatableRead | Permits a single, one-time reading of the database. The transaction cannot see any subsequent changes made by other simultaneous transactions. This isolation level guarantees that once a transaction reads a record, its view of that record does not change unless it makes a modification to the record itself. At this level, a transaction is most isolated from other transactions.
xiSnapshot |
xiSerializible |
Syntax
property Isolation: TADTxIsolation;
What do you think about this topic? Send feedback!


TADTxOptions.Params Property

TADTxOptions.Params Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies custom DBMS transaction parameters.

Group

published

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, published, See Also
Description

Use Params to specify transaction parameters additional to the other options.

At moment it is used only by Interbase / Firebird driver.

Syntax
property Params: TStrings;
See Also

Isolation, ReadOnly, TADUpdateOptions.LockWait

What do you think about this topic? Send feedback!


TADTxOptions.ReadOnly Property

TADTxOptions.ReadOnly Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies whether the transaction is read-only.

Group

published

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, published, See Also
Description

Use the ReadOnly property values to tell to a DBMS, that a transaction will only read data, but do not modify it. The default value is False.

Setting ReadOnly to True allows to DBMS optimize resource usage.

Syntax
property ReadOnly: Boolean;
See Also

Isolation, Params

What do you think about this topic? Send feedback!


TADTxOptions.StopOptions Property

TADTxOptions.StopOptions Property
TADTxOptions Class TADTxOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies automatic transaction stoping options.

Group

published

Links
TADTxOptions Class, TADTxOptions Members, uADStanOption Namespace, published, See Also
Description

Use StopOptions property to specify conditions, when FireDAC should finish automatically started transaction, if DBMS does not support automatic transaction management, like Interbase or Firebird. The default value is [xoIfAutoStarted, xoIfCmdsInactive].

If AutoStop is True, then transaction will be automatically finished, if also specified options are valid:

Option | Description
xoIfCmdsInactive | Stop transaction only if all commands, associated with transaction, are inactive.
xoIfAutoStarted | Stop transaction only if it was automatically started by FireDAC, as result of AutoStart = True.
xoFinishRetaining | Use CommitRetaining instead of Commit.
Syntax
property StopOptions: TADTxStopOptions;
See Also

AutoStart, AutoStop

What do you think about this topic? Send feedback!


TADUpdateOptions Class

TADUpdateOptions Class
public published TADUpdateOptions Members Classes See Also Send Feedback

The set of options controlling dataset editing and updates posting.

Group

Classes

Class Hierarchy
  uADStanOption_TADUpdateOptionsuADStanOption_TADUpdateOptions
File

uADStanOption

Links
public, published, TADUpdateOptions Members, Classes, See Also
Description

The TADUpdateOptions class represents the set of properties controlling how FireDAC datasets and DApt Layer adapter interfaces:

  • allow to edit data (EnableDelete, EnableInsert, EnableUpdate, ReadOnly, CheckRequired, CheckReadOnly, CheckUpdatable). Also TField.ReadOnly, Required affects that.
  • lock database records (LockMode, LockPoint, LockWait);
  • use database generators and sequences for auto-incrementing fields (FetchGeneratorsPoint, GeneratorName). Also TField.AutoGenerateValue affects that;
  • generate updates posting commands (UpdateChangedFields, UpdateNonBaseFields, UpdateMode, FastUpdates). Also TField.ProviderFlags, Origin affects that;
  • refresh data (RefreshMode, RefreshDelete);
  • checking the updates posting result (CountUpdatedRecords).

The TADUpdateOptions is an intermediate class in update options classes hierarchy. The TADCustomManager and TADCustomConnection classes use TADUpdateOptions. The TADCustomCommand, TADDataSet and adapters use TADBottomUpdateOptions.

Syntax
TADUpdateOptions = class(TADCustomOptions);
See Also

Setting Options, TADCustomManager.UpdateOptions, TADCustomConnection.UpdateOptions, TADDataSet.UpdateOptions

What do you think about this topic? Send feedback!


TADUpdateOptions Members

TADUpdateOptions Members
TADUpdateOptions Class Legend Methods Properties Send Feedback

The following tables list the members exposed by TADUpdateOptions.

Class

TADUpdateOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Properties
Property | Description
AssignedValues | Specifies the set of changed options.
CheckReadOnly | Controls checking of TField.ReadOnly property.
CheckRequired | Controls checking of TField.Required property.
CheckUpdatable | Controls ability to change a TField value.
CountUpdatedRecords | Controls checking of an updated record count.
EnableDelete | Allows to delete records from dataset.
EnableInsert | Allows to insert records into dataset.
EnableUpdate | Allows to edit records of dataset.
FastUpdates | Controls fast vs secure updates.
FetchGeneratorsPoint | Controls the moment, when next generator value will be fetched.
GeneratorName | Specifies the generator name from which to fetch next value for auto-increment fields.
LockMode | Controls how the FireDAC locks database record while editing it.
LockPoint | Controls the moment, when database record will be locked.
LockWait | Controls waiting for pessimistic lock to be acquired.
ReadOnly | Specifies whether the dataset is read-only.
RefreshDelete | Specifies should a dataset delete a record locally when a database record is not found at refreshing.
RefreshMode | Specifies how dataset should refresh record after posting update to it.
RequestLive | Provided for BDE compatibility.
UpdateChangedFields | Controls which fields to include into UPDATE or INSERT command.
UpdateMode | Controls how the FireDAC locates records when posting updates.
UpdateNonBaseFields | Controls should fields from the joined non-base table to be included into UPDATE or INSERT command.
Version | The current version of options.
Links
TADUpdateOptions Class, Legend, Methods, Properties
What do you think about this topic? Send feedback!


public

public
TADUpdateOptions Class Legend Methods Send Feedback

The public members of the TADUpdateOptions class are listed here.

Class

TADUpdateOptions Class

Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.
Links
TADUpdateOptions Class, Legend, Methods
What do you think about this topic? Send feedback!


TADUpdateOptions.Assign Method

TADUpdateOptions.Assign Method
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace Example public See Also Send Feedback

Assigns all options of one option object to another.

Group

public

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, Example, public, See Also
Parameters
Parameters | Description
ASource: TPersistent | A source options object.
Description

Use the Assign method to assign all changed option values of ASource option object to this object. After that corresponding options will stop inheriting the values from more high level option object.

Syntax
procedure Assign(ASource: TPersistent); override;
See Also

RestoreDefaults

Example
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);
What do you think about this topic? Send feedback!


TADUpdateOptions.RestoreDefaults Method

TADUpdateOptions.RestoreDefaults Method
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace public See Also Send Feedback

Restore option default values.

Group

public

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, public, See Also
Description

Call RestoreDefaults to reset all changed options to their default values.

Syntax
procedure RestoreDefaults; override;
See Also

AssignedValues

What do you think about this topic? Send feedback!


published

published
TADUpdateOptions Class Legend Properties Send Feedback

The published members of the TADUpdateOptions class are listed here.

Class

TADUpdateOptions Class

Properties
Property | Description
AssignedValues | Specifies the set of changed options.
CheckReadOnly | Controls checking of TField.ReadOnly property.
CheckRequired | Controls checking of TField.Required property.
CheckUpdatable | Controls ability to change a TField value.
CountUpdatedRecords | Controls checking of an updated record count.
EnableDelete | Allows to delete records from dataset.
EnableInsert | Allows to insert records into dataset.
EnableUpdate | Allows to edit records of dataset.
FastUpdates | Controls fast vs secure updates.
FetchGeneratorsPoint | Controls the moment, when next generator value will be fetched.
GeneratorName | Specifies the generator name from which to fetch next value for auto-increment fields.
LockMode | Controls how the FireDAC locks database record while editing it.
LockPoint | Controls the moment, when database record will be locked.
LockWait | Controls waiting for pessimistic lock to be acquired.
ReadOnly | Specifies whether the dataset is read-only.
RefreshDelete | Specifies should a dataset delete a record locally when a database record is not found at refreshing.
RefreshMode | Specifies how dataset should refresh record after posting update to it.
RequestLive | Provided for BDE compatibility.
UpdateChangedFields | Controls which fields to include into UPDATE or INSERT command.
UpdateMode | Controls how the FireDAC locates records when posting updates.
UpdateNonBaseFields | Controls should fields from the joined non-base table to be included into UPDATE or INSERT command.
Links
TADUpdateOptions Class, Legend, Properties
What do you think about this topic? Send feedback!


TADUpdateOptions.AssignedValues Property

TADUpdateOptions.AssignedValues Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the set of changed options.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use AssignedValues to get / set the set of modified option values.

If some option is changed at this level, then corresponding flag is included into AssignedValues. If flag is not included, then an option value is inherited from more high level. Excluding flag from AssignedValues makes option inheriting its value from more high level.

See Setting Options for more details.

Syntax
property AssignedValues: TADUpdateOptionValues;
See Also

RestoreDefaults

What do you think about this topic? Send feedback!


TADUpdateOptions.CheckReadOnly Property

TADUpdateOptions.CheckReadOnly Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls checking of TField.ReadOnly property.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use the CheckReadOnly property value to control, should FireDAC or not to use the TField.ReadOnly property to control field update ability. The default value is True. CheckReadOnly must be specified before preparing / opening a dataset.

The TField.ReadOnly will be used when CheckReadOnly is True. If at dataset Open call the CheckReadOnly is False, then the fields ReadOnly will be False. When a field ReadOnly is True and CheckReadOnly is False, the field is still not editable using data aware controls, but it may be assigned directly in code.

Additionally CheckReadOnly may be used in combination with UpdateNonBaseFields to enable editing of non-base fields.

Syntax
property CheckReadOnly: Boolean;
See Also

Editing the Data, TField.ReadOnly, CheckRequired, CheckUpdatable, UpdateNonBaseFields

What do you think about this topic? Send feedback!


TADUpdateOptions.CheckRequired Property

TADUpdateOptions.CheckRequired Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls checking of TField.Required property.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use the CheckRequired property value to control, should FireDAC or not to use the TField.Required property to control field value requirement. The default value is True, for TADCustomMemTable it is False.

The TField.Required will be used when CheckRequired is True. If at dataset Post call a field Required is True and a field value is Null, then exception will be raised.

Syntax
property CheckRequired: Boolean;
See Also

Editing the Data, TField.Required, CheckUpdatable, CheckReadOnly

What do you think about this topic? Send feedback!


TADUpdateOptions.CheckUpdatable Property

TADUpdateOptions.CheckUpdatable Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls ability to change a TField value.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use the CheckUpdatable property value to control, should FireDAC or not to raise an exception, when application tries to modify field value in an inappropriate state. The default value is True.

This is normally prohibited when:

  • dataset is not in dsEdit, dsInsert, dsSetKey, dsCalcFields, dsFilter, dsNewValue, dsInternalCalc state;
  • dataset state is dsEdit, dsInsert and TField has ReadOnly = True and CheckReadOnly = True;
  • dataset state is dsSetKey and field is not indexed.

The exception will be raised when CheckUpdatable is True and one of the above conditions is not met.

Syntax
property CheckUpdatable: Boolean;
See Also

Editing the Data, TField.ReadOnly, CheckReadOnly, CheckRequired

What do you think about this topic? Send feedback!


TADUpdateOptions.CountUpdatedRecords Property

TADUpdateOptions.CountUpdatedRecords Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls checking of an updated record count.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use CountUpdatedRecords to control should FireDAC check the updated records number (True) or should not (False). The default value is True.

If CountUpdatedRecords = True and number of updated records after posting a single update is not equal to 1, then exception will be raised and an update posting command will be rolled back.

If, at some conditions the record count is not equal to 1, but programmer is sure, that update was posted successfully, then he / she can set CountUpdatedRecords to False.

Syntax
property CountUpdatedRecords: Boolean;
See Also

Update Command Generation

What do you think about this topic? Send feedback!


TADUpdateOptions.EnableDelete Property

TADUpdateOptions.EnableDelete Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Allows to delete records from dataset.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use EnableDelete property to enable records deletion from dataset (True). If it is disallowed (False), then TDataSet.Delete method will raise exception. The default value is True.

If you need to make dataset read-only, then use ReadOnly property.

Syntax
property EnableDelete: Boolean;
See Also

Editing the Data, EnableInsert, EnableUpdate, ReadOnly

What do you think about this topic? Send feedback!


TADUpdateOptions.EnableInsert Property

TADUpdateOptions.EnableInsert Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Allows to insert records into dataset.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use EnableInsert property to enable addition of new records to dataset (True). If it is disallowed (False), then TDataSet.Insert / Append methods will raise exception. The default value is True.

If you need to make dataset read-only, then use ReadOnly property.

Syntax
property EnableInsert: Boolean;
See Also

Editing the Data, EnableDelete, EnableUpdate, ReadOnly

What do you think about this topic? Send feedback!


TADUpdateOptions.EnableUpdate Property

TADUpdateOptions.EnableUpdate Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Allows to edit records of dataset.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use EnableUpdate property to enable edition of dataset records (True). If it is disallowed (False), then TDataSet.Edit method will raise an exception. The default value is True.

If you need to make dataset read-only, then use ReadOnly property.

Syntax
property EnableUpdate: Boolean;
See Also

Editing the Data, EnableDelete, EnableInsert, ReadOnly

What do you think about this topic? Send feedback!


TADUpdateOptions.FastUpdates Property

TADUpdateOptions.FastUpdates Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls fast vs secure updates.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use FastUpdates property to choose the high performance updates (True) or the secure updates (False).

To perform update commands faster, FireDAC will cache update commands, use primary key fields to locate updated record, does not lock records before editing, does not refresh records after posting updates and avoid some checks inside of a dataset. Setting FastUpdates to True is shortcut for setting:

  • UpdateChangedFields = False;
  • LockMode = lmNone;
  • UpdateMode = upWhereKeyOnly;
  • RefreshMode = rmManual;
  • CheckRequired = False;
  • CheckReadOnly = False;
  • CheckUpdatable = False.
Syntax
property FastUpdates: Boolean;
See Also

Update Command Generation, UpdateChangedFields, LockMode, UpdateMode, RefreshMode

What do you think about this topic? Send feedback!


TADUpdateOptions.FetchGeneratorsPoint Property

TADUpdateOptions.FetchGeneratorsPoint Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls the moment, when next generator value will be fetched.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use FetchGeneratorsPoint to specify a moment, when a next generator value will be fetched from a database and assigned to an auto-incrementing field. The default value is gpDeferred.

A next generator value will be fetched from an generator, specified by GeneratorName / TADAutoIncField.GeneratorName properties and assigned to the auto-incrementing fields, which have pfInUpdate in ProviderFlags. An auto-incrementing field is a field:

  • of the TADAutoIncField class;
  • or whose name is specified in the AutoIncFields;
  • or with TField.AutoGenerateValue = arAutoInc.

Generators are supported by Interbase and Firebird. Sequences are supported by Oracle and PostgreSQL DBMS's. For other DBMS's this property has no meaning.

The value may be one of the following values:

Mode | Description
gpNone | Do not fetch generator values.
gpImmediate | Fetch values right after beginning to append a new record. Normally this is TDataSet.Insert or Append methods.
gpDeferred | Fetch values right before posting new record to to a database. Normally this is TDataSet.Post or ApplyUpdates.
Syntax
property FetchGeneratorsPoint: TADFetchGeneratorsPoint;
See Also

Auto-Incremental Fields, GeneratorName, TADAutoIncField.GeneratorName, AutoIncFields

What do you think about this topic? Send feedback!


TADUpdateOptions.GeneratorName Property

TADUpdateOptions.GeneratorName Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies the generator name from which to fetch next value for auto-increment fields.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use GeneratorName property to specify a generator name, which next value will be fetched from a database and assigned to the auto-incrementing fields. See FetchGeneratorsPoint property description for details.

Syntax
property GeneratorName: String;
See Also

Auto-Incremental Fields, Object Names, FetchGeneratorsPoint, TADAutoIncField.GeneratorName

What do you think about this topic? Send feedback!


TADUpdateOptions.LockMode Property

TADUpdateOptions.LockMode Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls how the FireDAC locks database record while editing it.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use LockMode property to specify database record locking mode. You can use locks to resolve conflict of updates to the same record from different DBMS sessions. The default value is lmNone.

Mode | Description
lmNone | No locking at all.
lmPessimistic | Pessimistic locking, if DBMS supports SELECT FOR UPDATE, otherwise optimistic locking is used. If record is locked, then FireDAC will wait LockWait time, if DBMS supports lock timeout, otherwise - depends on DBMS settings.
lmOptimistic | Optimistic locking.
Syntax
property LockMode: TADLockMode;
See Also

LockPoint, LockWait

What do you think about this topic? Send feedback!


TADUpdateOptions.LockPoint Property

TADUpdateOptions.LockPoint Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls the moment, when database record will be locked.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use LockPoint to specify moment, when changing database record will be locked in database and marked in internal data storage as locked. The default value is lpDeferred.

The value may be one of the following values:

Mode | Description
lpImmediate | Lock record right after starting record editing or deleting.
lpDeferred | Lock record right before posting updates to database.

FireDAC locks record if LockMode is not a lmNone.

Syntax
property LockPoint: TADLockPoint;
See Also

LockMode, LockWait

What do you think about this topic? Send feedback!


TADUpdateOptions.LockWait Property

TADUpdateOptions.LockWait Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls waiting for pessimistic lock to be acquired.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use LockWait property to control, should FireDAC wait while pessimistic lock will be acquired (True), or return error immediately (False) if record is already locked. The default value is False.

The LockWait property is used only if LockMode = lmPessimistic.

Note, not all DBMS are support LockWait=False or True. So, LockWait declares rather the desired behaviour and is not a must.

Syntax
property LockWait: Boolean;
See Also

LockMode, LockPoint

What do you think about this topic? Send feedback!


TADUpdateOptions.ReadOnly Property

TADUpdateOptions.ReadOnly Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies whether the dataset is read-only.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use the ReadOnly property to prevent users from updating, inserting, or deleting data in the dataset. By default ReadOnly is False.

To guarantee that users cannot modify dataset data, set ReadOnly to True. The property is shortcut for EnableDelete, EnableInsert, EnableUpdate properties.

Syntax
property ReadOnly: Boolean;
See Also

Editing the Data, EnableDelete, EnableInsert, EnableUpdate

What do you think about this topic? Send feedback!


TADUpdateOptions.RefreshDelete Property

TADUpdateOptions.RefreshDelete Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies should a dataset delete a record locally when a database record is not found at refreshing.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use the RefreshDelete property to allow a dataset to delete a record from a local storage, when a corresponding database record is not found at TADDataSet.RefreshRecord call. The default value is True.

The most probable reason that the record is not found - it is deleted, while other options are possible too. To delete the record, set this property to True. To leave the record as is, set this property to False. For additional details see the TADDataSet.RefreshRecord method description.

Syntax
property RefreshDelete: Boolean;
See Also

RefreshMode, TADDataSet.RefreshRecord

What do you think about this topic? Send feedback!


TADUpdateOptions.RefreshMode Property

TADUpdateOptions.RefreshMode Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Specifies how dataset should refresh record after posting update to it.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use RefreshMode property to control how dataset should refresh record after posting update (insert / update) to it. The default value is rmOnDemand.

Following table lists modes and their meaning in case of automatic command generation:

Mode
Description
rmManual
Do not automatically refresh record. Application should call TADDataSet.RefreshRecord to refresh record.
rmOnDemand
Automatically refresh record fields:
  • after inserting, if they are auto-incremental, calculated, have default values, contain ROWID, contain row version. Or TField.AutoGenerateValue <> arNone.
  • after updating, if they are calculated or contain row version.
rmAll
Automatically refresh all record fields.

If dataset is connected to a TADUpdateSQL and FetchRowSQL is specified, then FireDAC will execute FetchRowSQL command to refresh row, only if RefreshMode is rmAll.

Syntax
property RefreshMode: TADRefreshMode;
See Also

Update Command Generation, TADDataSet.RefreshRecord, TADUpdateSQL.FetchRowSQL

What do you think about this topic? Send feedback!


TADUpdateOptions.RequestLive Property

TADUpdateOptions.RequestLive Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Provided for BDE compatibility.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use RequestLive property for backward compatibility with BDE. Setting RequestLive to True:

  • set ReadOnly to False;
  • includes fiMeta into TADFetchOptions.Items.
Syntax
property RequestLive: Boolean;
See Also

Editing the Data, ReadOnly, TADFetchOptions.Items

What do you think about this topic? Send feedback!


TADUpdateOptions.UpdateChangedFields Property

TADUpdateOptions.UpdateChangedFields Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls which fields to include into UPDATE or INSERT command.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use the UpdateChangedFields property to specify should FireDAC include into UPDATE SET <field list> or INSERT INTO (<field list>) commands all fields allowed for updating (False) or include only changed fields (True). The default value is True.

A field is allowed to update, if it has ReadOnly = False, pfInUpdate in TField.ProviderFlags. There are possible other options for auto incremental fields.

Setting UpdateChangedFields to True guarantees, that only:

  • not NULL fields will be included into INSERT command;
  • changed by user / application fields will be included into UPDATE command.

That allows to minimize database recover / transaction rollback information generation. Also fire only table triggers for really changed fields.

Setting UpdateChangedFields to False allows to optimize posting updates for multiple records, as it does not require to regenerate updates posting command for each record. Consider to set FastUpdates to True.

Syntax
property UpdateChangedFields: Boolean;
See Also

Editing the Data, CacheUpdatesCommands, UpdateMode, FastUpdates

What do you think about this topic? Send feedback!


TADUpdateOptions.UpdateMode Property

TADUpdateOptions.UpdateMode Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls how the FireDAC locates records when posting updates.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use UpdateMode property to specify the criteria for locating a record in the database when posting updates. The default value is upWhereKeyOnly.

UpdateMode specifies whether records are located using all columns (fields), on only the key fields, or on the key fields plus the original values of fields that have been modified. To control how FireDAC locates records by specifying individual fields, use the field components' ProviderFlags property.

Syntax
property UpdateMode: TUpdateMode;
See Also

Unique Identifying Fields, Update Command Generation, TField.ProviderFlags, TADBottomUpdateOptions.KeyFields

What do you think about this topic? Send feedback!


TADUpdateOptions.UpdateNonBaseFields Property

TADUpdateOptions.UpdateNonBaseFields Property
TADUpdateOptions Class TADUpdateOptions Members uADStanOption Namespace published See Also Send Feedback

Controls should fields from the joined non-base table to be included into UPDATE or INSERT command.

Group

published

Links
TADUpdateOptions Class, TADUpdateOptions Members, uADStanOption Namespace, published, See Also
Description

Use UpdateNonBaseFields to enable (True) or disable (False) non-base table fields inclusion into UPDATE or INSERT command. The default value is False. UpdateNonBaseFields must be specified before preparing / opening a dataset.

The options is useful when the original SQL command is a SELECT with joins of few tables. The first leftmost table is a base table. Which columns are base and which are non-base is determined using SELECT list metadata - column original table name, column original name. Most DBMS return this infromation, excluding Oracle and Advantage. See Overriding Posting Updates for details how to setup a DBMS to return this info. Note, in the following SELECT cases all fields may be non-base fields:

  • with set operators - UNION, INTERSECT, MINUS, etc;
  • with grouping.

In most cases updates must be allowed to the base table columns only. And prohibited for other "lookup" tables. To do so set UpdateNonBaseFields to False. If application needs to exclude non-base columns from updating SQL commands, but enable editing for them, then set CheckReadOnly to False.

Syntax
property UpdateNonBaseFields: Boolean;
See Also

Overriding Posting Updates, UpdateChangedFields, CheckReadOnly

What do you think about this topic? Send feedback!


Structs, Records, Enums

Structs, Records, Enums
Enumerations uADStanOption Namespace Legend Send Feedback

The following table lists structs, records, enums in this documentation.

Enumerations
Enumeration | Description
TADActionRequest | The enumerated type lists all possible FireDAC requests to a database.
TADAutoFetchAll | Add a short summary here...
Namespace

uADStanOption Namespace

Links
Enumerations, uADStanOption Namespace, Legend
What do you think about this topic? Send feedback!


uADStanOption.TADActionRequest Enumeration

uADStanOption.TADActionRequest Enumeration
Structs, Records, Enums Send Feedback

The enumerated type lists all possible FireDAC requests to a database.

Group

Structs, Records, Enums

File

uADStanOption

Links
Structs, Records, Enums
Description

The TADActionRequest enumerated type lists all possible FireDAC database actions, performed as part of the dataset editing operations.

Value | Description
arNone | No action. Used internally.
arFromRow | The action will be determined from the current row status (inserted, modified, deleted). Used internally.
arSelect | Execute the dataset query to select the DB rows. Used internally.
arInsert | Insert a row to a DB.
arUpdate | Update a row in a DB.
arDelete | Delete a row from a DB.
arLock | Lock a row in a DB.
arUnlock | Unlock a row in a DB.
arFetchRow | ReFetch a row from a DB.
arUpdateHBlobs | Update Oracle BLOB's in a DB.
arDeleteAll | Delete all dataset rows from a DB. Used internally.
arFetchGenerators | Fetch generator / sequence values for a row columns.
Syntax
TADActionRequest = (
);
What do you think about this topic? Send feedback!


uADStanOption.TADAutoFetchAll Enumeration

uADStanOption.TADAutoFetchAll Enumeration
Example Structs, Records, Enums See Also Send Feedback

Add a short summary here...

Group

Structs, Records, Enums

File

uADStanOption

Links
Example, Structs, Records, Enums, See Also
Description

Add a description here...

Syntax
TADAutoFetchAll = (
);
See Also

List here...

Example
What do you think about this topic? Send feedback!


Classes

Classes
Classes Legend
Classes
Class | Description
TADAdaptedDataSet | The TADAdaptedDataSet class uses data adapter to execute DBMS queries, open DBMS cursors, fetch rows and post changes back to DBMS.
TADCommand | The class is responsible for execution of SQL commands.
TADConnection | The class is responsible to connection establishment with a DBMS.
TADCustomCommand | The base class is responsible for execution of SQL commands.
TADCustomConnection | The class is responsible to connection establishment with a DBMS.
TADCustomEventAlerter | The class is responsible for handling the database event notifications.
TADCustomLocalSQL | The base class for the Local SQL engine.
TADCustomManager | The class is responsible to connection definitions and connections management.
TADCustomMemTable | The class implementing in-memory dataset.
TADCustomQuery | The class implementing dataset, capable to execute SQL queries.
TADCustomSchemaAdapter | The class implementing Centralized Cached Updates support.
TADCustomStoredProc | The class implementing dataset, capable to execute server side stored procedures.
TADCustomTransaction | The class is responsible for connection transaction management.
TADCustomUpdateObject | The base class for update objects used to override updates posting.
TADEventAlerter | The class is responsible for handling the database event notifications.
TADLocalSQLDataSet | TADLocalSQLDataSet represents a dataset registered with Local SQL engine.
TADLocalSQLDataSets | TADLocalSQLDataSets is a collection of TADLocalSQLDataSet objects.
TADManager | The class is responsible to connection definitions and connections management.
TADMemTable | The class implementing in-memory dataset.
TADMetaInfoCommand | The class is responsible for execution of meta-data commands.
TADMetaInfoQuery | The class implementing dataset, capable to execute meta-info queries.
TADQuery | The class implementing dataset, capable to execute SQL queries.
TADRdbmsDataSet | The TADRdbmsDataSet class includes everything, required by descendants to execute SQL commands.
TADSchemaAdapter | The class implementing Centralized Cached Updates support.
TADStoredProc | The class implementing dataset, capable to execute server side stored procedures.
TADTable | The class implementing dataset, working with single database table.
TADTransaction | The class is responsible for connection transaction management.
TADUpdateSQL | TADUpdateSQL applies updates on behalf of queries or stored procedures that can't post updates directly.


Classes

Legend
Legend
Class


Legend

Legend
Classes
Legend
Class


Classes

Classes
Classes Legend
Classes
Class | Description
TADAggregate | TADAggregate represents a maintained client aggregate value in an FireDAC dataset.
TADAggregates | TADAggregates is a collection of TADAggregate objects.
TADAutoIncField | TADAutoIncField represents integer auto incremental field in an FireDAC dataset.
TADBlobStream | TADBlobStream is a stream object giving access to BLOB / Memo fields.
TADDataSet | The TADDataSet is a direct TDataSet descendant, introducing base functionality for all FireDAC datasets.
TADIndex | TADIndex represents a maintained client view to records in an FireDAC dataset.
TADIndexes | TADIndexes is a collection of TADIndex objects.
TADMasterDataLink | TADMasterDataLink controlls master-detail link between two datasets.
TADSQLTimeIntervalField | TADSQLTimeIntervalField represents a time interval field in a dataset.
TADWideMemoField | TADWideMemoField represents a Unicode encoded memo field in a dataset.
TADXMLField | TADXMLField represents a Unicode encoded XML data field in a dataset.


Classes

Classes
Classes Legend
Classes
Class | Description
TADGUIxAsyncExecuteDialog | The dialog showing a SQL query execution progress.
TADGUIxComponent | The base class for all FireDAC GUIx components.
TADGUIxErrorDialog | The dialog displaying FireDAC exceptions.
TADGUIxLoginDialog | The dialog allows the users to enter their DB credentials.
TADGUIxScriptDialog | The dialog showing a SQL script execution progress.
TADGUIxWaitCursor | The component allowing to control the wait cursor.


Classes

Classes
Classes Legend
Classes
Class | Description
TADScript | The class implementing SQL script engine, capable to execute a series of SQL queries.
TADScriptCommand | The base class for custom script commands.
TADScriptCommandRegistry | The list of the registered script commands.
TADScriptOptions | The class implementing SQL script engine options.
TADSQLScript | An in-memory stored SQL script.
TADSQLScripts | TADSQLScripts is a collection of the TADSQLScript objects.


Classes

Classes
Classes Legend
Classes
Class | Description
TADMoniRemoteClientLink | Use the TADMoniRemoteClientLink component to link ADMonitor tracing capabilities to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
TADADSBackup | The class implementing Advantage backup database service.
TADADSBackupRestore | The base class for backup and restored Advantage service classes.
TADADSRestore | The class implementing Advantage service restoring a database from a backup.
TADADSService | The base class for all Advantage service classes.
TADADSUtility | The class implementing Advantage table utilities.
TADPhysADSDriverLink | Use the TADPhysADSDriverLink component to link the Advantage Database Server driver to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
TADASABackup | The class implementing SQL Anywhere backup database service.
TADASAService | The base class for all Sybase SQL Anywhere service classes.
TADASAValidate | The class implementing SQL Anywhere database validate service.
TADPhysASADriverLink | Use the TADPhysASADriverLink component to link the Sybase SQL Anywhere driver to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysDataSnapDriverLink | Use the TADPhysDataSnapDriverLink component to link the Multi-Tier DataSnap driver to an application.


Classes

Classes
Classes Legend
Classes
Class | Description
EDB2NativeException | Class representing a IBM DB2 driver exception.
TADPhysDB2DriverLink | Use the TADPhysDB2DriverLink component to link the IBM DB2 driver to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysDBXDriverLink | Use the TADPhysDBXDriverLink component to link the dbExpress v 1-3 bridge driver to an application.


Classes

Classes
Classes Legend
Classes
Class | Description
TADIBBackup | The class implementing FB/IB backup database service.
TADIBNBackup | The class implementing Firebird-only backup database service.
TADIBNRestore | The class implementing Firebird-only restored database service.
TADIBRestore | The class implementing FB/IB service restoring a database from a backup.
TADIBSecurity | The class implementing FB/IB database security management service.
TADIBService | The base class for all FB/IB service classes.
TADIBTrace | The class implementing Firebird database trace service.
TADIBValidate | The class implementing FB/IB database validate and repair service.
TADPhysIBDriverLink | Use the TADPhysIBDriverLink component to link the FB/IB driver to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysDriverLink | The TADPhysDriverLink component is a base class for all driver link components.
TADPhysDriverService | The TADPhysDriverService component is a base class for all driver service components.


Classes

Classes
Classes Legend
Classes
Class | Description
EMSAccessNativeException | Class representing a Microsoft Access driver exception.
TADMSAccessService | The class implementing Microsoft Access database create, drop, compact and repair services.
TADPhysMSAccessDriverLink | Use the TADPhysMSAccessDriverLink component to link the Microsoft Access driver to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
EMSSQLNativeException | Class representing a Microsoft SQL Server driver exception.
TADMSSQLError | TADMSSQLError represents FireDAC SQL Server errors, warnings and messages for the EMSSQLNAtiveException exception class.
TADPhysMSSQLDriverLink | Use the TADPhysMSSQLDriverLink component to link the Microsoft SQL Server driver to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysMySQLDriverLink | Use the TADPhysMySQLDriverLink component to link the MySQL Server driver to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysODBCDriverLink | Use the TADPhysODBCDriverLink component to link the ODBC bridge driver to an application.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysODBCBaseDriverLink | The TADPhysODBCBaseDriverLink component is a base class for all ODBC based driver link components.
TADPhysODBCBaseService | The TADPhysODBCBaseService component is a base class for all ODBC based driver service components.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysOracleDriverLink | Use the TADPhysOracleDriverLink component to link the Oracle Database driver to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysPgDriverLink | Use the TADPhysPgDriverLink component to link the PostgreSQL driver to an application and setup it.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysSQLiteDriverLink | Use the TADPhysSQLiteDriverLink component to link the SQLite driver to an application and setup it.
TADSQLiteBackup | The class implementing SQLite backup, restore, copy database functionality.
TADSQLiteCollation | The class implementing custom SQLite collation.
TADSQLiteFunction | The class implementing custom SQLite function.
TADSQLiteRTree | The class implementing custom SQLite RTree module.
TADSQLiteSecurity | The class allowing to manage SQLite database encryption.
TADSQLiteService | The base class for all SQLite service classes.
TADSQLiteValidate | The class implementing SQLite database validate service.


Classes

Classes
Classes Legend
Classes
Class | Description
TADLocalSQL | The class implementing the SQLite based Local SQL engine.


Classes

Classes
Classes Legend
Classes
Class | Description
TADPhysTDBXDriverLink | Use the TADPhysTDBXDriverLink component to link the dbExpress v 4 bridge driver to an application.


Classes

Classes
Classes Legend
Classes
Class | Description
ETDBXNativeException | Represents exception class for all TDBX based drivers.


Classes

Classes
Classes Legend
Classes
Class | Description
EADDBArrayExecuteError | EADDBArrayExecuteError is used as an Array DML error description item.
EADDBEngineException | EADDBEngineException is the base exception class for all FireDAC DBMS related errors.
EADException | EADException is the base exception class for all FireDAC exceptions.
TADDBError | TADDBError represents FireDAC / DBMS errors, warnings and messages for the EADDBEngineException exception class.


Classes

Classes
Classes Legend
Classes
Class | Description
TADBottomResourceOptions | The set of options controlling dataset persistence.
TADBottomUpdateOptions | The set of options controlling dataset editing and updates posting.
TADCustomOptions | The base class for all option classes.
TADEventAlerterOptions | The set of options controlling event alerter behaviour.
TADFetchOptions | The set of options controlling data and metadata fetching.
TADFormatOptions | The set of options controlling representation of fetched or sending data.
TADMapRule | TADMapRule represents a maintained client view to records in an FireDAC dataset...
TADMapRules | TADMapRules is a collection of TADMapRule objects.
TADResourceOptions | The set of options controlling SQL command preprocessor, command execution and dataset persistence.
TADTopResourceOptions | The set of options controlling SQL automatic connection recover, dataset persistence and server output.
TADTxOptions | The set of options controlling transaction behaviour.
TADUpdateOptions | The set of options controlling dataset editing and updates posting.


Functions

Functions
Functions Legend
Functions
Function | Description
ADManager | Function returns reference to global TADCustomManager object.
ADSetConnectionClass | Sets the TADCustomConnection descendant class.
ADSetManagerClass | Set the TADCustomManager descendant class.


Functions

Legend
Legend
Method


Legend

Legend
Functions
Legend
Method


TADAdaptedDataSet Members Events

TADAdaptedDataSet Members Events
TADAdaptedDataSet Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Events

Legend
Legend
Event


Legend

Legend
TADAdaptedDataSet Members
Legend
Property
read only
write only
protected
Event
Method
virtual


TADAdaptedDataSet Members Methods

TADAdaptedDataSet Members Methods
TADAdaptedDataSet Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


Methods

Legend
Legend
Method
virtual


TADAdaptedDataSet Members Properties

TADAdaptedDataSet Members Properties
TADAdaptedDataSet Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.


Properties

Legend
Legend
Property
read only
write only
protected


TADCommand Members Events

TADCommand Members Events
TADCommand Members Legend
Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterFetch | The event fires after fetching from command cursor.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeFetch | The event fires before fetching from command cursor.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.


Legend

Legend
TADCommand Members
Legend
Property
read only
Event
Method


TADCommand Members Methods

TADCommand Members Methods
TADCommand Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current command operation.
AcquireConnection | Acquires reference to the actual connection object.
Close | Closes command current cursor.
CloseAll | Closes all command cursors.
Define | Defines DatS manager for command multiple result sets.
Define | Define DatS table structure for command's current cursor.
Disconnect | Use Disconnect method to release DBMS resources, used by this command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Fetch | Fetches rows from current command cursor.
FillParams | Fills the Params collection.
FindMacro | Returns macro by its name.
FindParam | Returns parameter by its name.
GetConnection | Returns the connection object.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Open | Executes SQL command, returning cursor.
OpenOrExecute | Execute SQL command, optionally returning cursor.
ParamByName | Returns parameter by its name.
Prepare | Prepares SQL command for execution.
ReleaseConnection | Releases reference to the actual connection object.
Unprepare | Releases SQL command resources.


Methods

Legend
Legend
Method


TADCommand Members Properties

TADCommand Members Properties
TADCommand Members Legend
Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Identifies base object name for some of command kinds.
BindedBy | Determines how command is connected to connection object.
CatalogName | Identifies catalog name for some command kinds.
CommandIntf | Returns IADPhysCommand interface.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
DataSet | Reference to dataset object owning this command.
FetchOptions | The set of options to control rows fetching.
FixedCommandKind | True, if the CommandKind property value is set explicitly.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
Overload | Oracle stored procedure overload index.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | The collection of parameters for a SQL command.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Identifies schema name for some of command kinds.
SQLText | The SQL command text as it will be sent to the DBMS.
State | Returns the current state of the command object.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.
Values | Provides access to the values for all parameters for the command.


Properties

Legend
Legend
Property
read only


TADConnection Members Events

TADConnection Members Events
TADConnection Members Legend
Events
Event | Description
AfterCommit | Fires after transaction is committed.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
OnError | Fires before FireDAC will raise exception.
OnLogin | Fires when an application connects to a DBMS.
OnLosted | Fires after FireDAC was not able to restore losted connection to DBMS.
OnRecover | Fires after FireDAC discovered that connection to DBMS is losted.
OnRestored | Fires after FireDAC successfully restored losted connection to DBMS.


Legend

Legend
TADConnection Members
Legend
Event
Property
read only
Method
virtual


TADConnection Members Methods

TADConnection Members Methods
TADConnection Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort all running dataset operations on this connection.
ApplyUpdates | Applies change logs of specified datasets to the DBMS.
Assign | Assigns all properties of one connection to this connection.
CheckActive | Checks to see if the connection is active.
CheckConnectionDef | Checks that connection definition is filled correctly.
CheckInactive | Checks to see if the connection is inactive.
CheckOnline | Checks to see if the connection is in online mode.
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
DecodeObjectName | Splits DB object name into parts.
EncodeObjectName | Assembles DB object name from it parts.
ExecSQL | Executes a SQL command without parameters.
ExecSQL | Executes SQL command with parameters.
ExecSQL | Executes a SQL command with parameters.
ExecSQLScalar | Executes a SQL command without parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetInfoReport | Populates a string list with a detailed report about a connection state.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetLastAutoGenValue | Returns last auto generated value.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
Offline | Sets connection to offline mode.
Online | Sets connection to online mode.
Open | Open connection to the database, using specified connection string.
Open | Open connection to the database, using specified user name and password.
Open | Open connection to the database, using specified connection parameters, user name and password.
Ping | Pings the DBMS server.
RefreshMetadataCache | Invalidates meta data cache.
ReleaseClients | Performs resource releasing operation on all associated datasets and commands.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.


TADConnection Members Properties

TADConnection Members Properties
TADConnection Members Legend
Properties
Property | Description
CliHandle | CLI handle for connection sharing.
CliObj | Returns a CLI connection wrapping object.
CommandCount | The number of assocciated TADCustomCommand objects.
Commands | Returns assocciated TADCustomCommand objects.
Connected | Gets / sets connection active status.
ConnectedStoredUsage | Controls how to use Connected property value saved to DFM.
ConnectionDefName | The name of connection definition to use.
ConnectionIntf | Returns the IADPhysConnection interface.
ConnectionMetaDataIntf | Returns an IADPhysConnectionMetadata interface.
ConnectionName | Specifies the name of the connection to associate with this connection object.
DataSets | Returns assocciated TADDataSet objects.
DriverName | Specifies the ID of the FireDAC driver for the connection.
FetchOptions | The set of default options to control rows fetching.
FormatOptions | The set of default options to control data representation.
InTransaction | Indicates whether a connection transaction is in progress or not.
IsSQLBased | Property returns True, if a data source supports SQL language.
LastUsed | The date and time of last usage of the connection.
LoginDialog | Gets / sets the reference to login dialog interface.
LoginPrompt | Specifies whether a login dialog appears immediately before opening a new connection.
Messages | Returns a list of messages returned by DBMS after recent database operation.
Offlined | Gets / sets connection offline status.
OptionsIntf | The reference to IADStanOptions interface.
Params | Lists database connection parameters for the FireDAC connection definition associated with the connection object.
RDBMSKind | Returns the brand of DBMS currently connected.
RefCount | Returns the number of references to this connection object.
ResourceOptions | The set of default options to control resources usage.
ResultConnectionDef | The actual connection definition used to establish connection to a DBMS.
SharedCliHandle | CLI handle shared with other connection.
Temporary | Shows whether a connection object is created on fly (temporary one) and managed automatically or a persistent one explicitly created, managed, and freed by the application.
Transaction | The reference to TADCustomTransaction object.
TxOptions | The set of options to control transactions.
UpdateOptions | The set of default options to control data updating.
UpdateTransaction | The reference to TADCustomTransaction object, which will be used to post changes to DB.


TADCustomCommand Members Events

TADCustomCommand Members Events
TADCustomCommand Members Legend
Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterFetch | The event fires after fetching from command cursor.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeFetch | The event fires before fetching from command cursor.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.


Legend

Legend
TADCustomCommand Members
Legend
Property
read only
Event
Method


TADCustomCommand Members Methods

TADCustomCommand Members Methods
TADCustomCommand Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current command operation.
AcquireConnection | Acquires reference to the actual connection object.
Close | Closes command current cursor.
CloseAll | Closes all command cursors.
Define | Defines DatS manager for command multiple result sets.
Define | Define DatS table structure for command's current cursor.
Disconnect | Use Disconnect method to release DBMS resources, used by this command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Fetch | Fetches rows from current command cursor.
FillParams | Fills the Params collection.
FindMacro | Returns macro by its name.
FindParam | Returns parameter by its name.
GetConnection | Returns the connection object.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Open | Executes SQL command, returning cursor.
OpenOrExecute | Execute SQL command, optionally returning cursor.
ParamByName | Returns parameter by its name.
Prepare | Prepares SQL command for execution.
ReleaseConnection | Releases reference to the actual connection object.
Unprepare | Releases SQL command resources.


TADCustomCommand Members Properties

TADCustomCommand Members Properties
TADCustomCommand Members Legend
Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Identifies base object name for some of command kinds.
BindedBy | Determines how command is connected to connection object.
CatalogName | Identifies catalog name for some command kinds.
CommandIntf | Returns IADPhysCommand interface.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
DataSet | Reference to dataset object owning this command.
FetchOptions | The set of options to control rows fetching.
FixedCommandKind | True, if the CommandKind property value is set explicitly.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
Overload | Oracle stored procedure overload index.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | The collection of parameters for a SQL command.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Identifies schema name for some of command kinds.
SQLText | The SQL command text as it will be sent to the DBMS.
State | Returns the current state of the command object.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.
Values | Provides access to the values for all parameters for the command.


TADCustomConnection Members Events

TADCustomConnection Members Events
TADCustomConnection Members Legend
Events
Event | Description
AfterCommit | Fires after transaction is committed.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
OnError | Fires before FireDAC will raise exception.
OnLogin | Fires when an application connects to a DBMS.
OnLosted | Fires after FireDAC was not able to restore losted connection to DBMS.
OnRecover | Fires after FireDAC discovered that connection to DBMS is losted.
OnRestored | Fires after FireDAC successfully restored losted connection to DBMS.


Legend

Legend
TADCustomConnection Members
Legend
Event
Property
read only
Method
virtual


TADCustomConnection Members Methods

TADCustomConnection Members Methods
TADCustomConnection Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort all running dataset operations on this connection.
ApplyUpdates | Applies change logs of specified datasets to the DBMS.
Assign | Assigns all properties of one connection to this connection.
CheckActive | Checks to see if the connection is active.
CheckConnectionDef | Checks that connection definition is filled correctly.
CheckInactive | Checks to see if the connection is inactive.
CheckOnline | Checks to see if the connection is in online mode.
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
DecodeObjectName | Splits DB object name into parts.
EncodeObjectName | Assembles DB object name from it parts.
ExecSQL | Executes a SQL command without parameters.
ExecSQL | Executes SQL command with parameters.
ExecSQL | Executes a SQL command with parameters.
ExecSQLScalar | Executes a SQL command without parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetInfoReport | Populates a string list with a detailed report about a connection state.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetLastAutoGenValue | Returns last auto generated value.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
Offline | Sets connection to offline mode.
Online | Sets connection to online mode.
Open | Open connection to the database, using specified connection string.
Open | Open connection to the database, using specified user name and password.
Open | Open connection to the database, using specified connection parameters, user name and password.
Ping | Pings the DBMS server.
RefreshMetadataCache | Invalidates meta data cache.
ReleaseClients | Performs resource releasing operation on all associated datasets and commands.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.


TADCustomConnection Members Properties

TADCustomConnection Members Properties
TADCustomConnection Members Legend
Properties
Property | Description
CliHandle | CLI handle for connection sharing.
CliObj | Returns a CLI connection wrapping object.
CommandCount | The number of assocciated TADCustomCommand objects.
Commands | Returns assocciated TADCustomCommand objects.
Connected | Gets / sets connection active status.
ConnectedStoredUsage | Controls how to use Connected property value saved to DFM.
ConnectionDefName | The name of connection definition to use.
ConnectionIntf | Returns the IADPhysConnection interface.
ConnectionMetaDataIntf | Returns an IADPhysConnectionMetadata interface.
ConnectionName | Specifies the name of the connection to associate with this connection object.
DataSets | Returns assocciated TADDataSet objects.
DriverName | Specifies the ID of the FireDAC driver for the connection.
FetchOptions | The set of default options to control rows fetching.
FormatOptions | The set of default options to control data representation.
InTransaction | Indicates whether a connection transaction is in progress or not.
IsSQLBased | Property returns True, if a data source supports SQL language.
LastUsed | The date and time of last usage of the connection.
LoginDialog | Gets / sets the reference to login dialog interface.
LoginPrompt | Specifies whether a login dialog appears immediately before opening a new connection.
Messages | Returns a list of messages returned by DBMS after recent database operation.
Offlined | Gets / sets connection offline status.
OptionsIntf | The reference to IADStanOptions interface.
Params | Lists database connection parameters for the FireDAC connection definition associated with the connection object.
RDBMSKind | Returns the brand of DBMS currently connected.
RefCount | Returns the number of references to this connection object.
ResourceOptions | The set of default options to control resources usage.
ResultConnectionDef | The actual connection definition used to establish connection to a DBMS.
SharedCliHandle | CLI handle shared with other connection.
Temporary | Shows whether a connection object is created on fly (temporary one) and managed automatically or a persistent one explicitly created, managed, and freed by the application.
Transaction | The reference to TADCustomTransaction object.
TxOptions | The set of options to control transactions.
UpdateOptions | The set of default options to control data updating.
UpdateTransaction | The reference to TADCustomTransaction object, which will be used to post changes to DB.


TADCustomEventAlerter Members Events

TADCustomEventAlerter Members Events
TADCustomEventAlerter Members Legend
Events
Event | Description
OnAlert | The event fires, when a DBMS event is fired.
OnTimeout | The event fires, when a DBMS event is timed out.


Legend

Legend
TADCustomEventAlerter Members
Legend
Property
read only
Event
Method


TADCustomEventAlerter Members Methods

TADCustomEventAlerter Members Methods
TADCustomEventAlerter Members Legend
Methods
Method | Description
Register | Registers the events with a DBMS.
Signal | Fires a DBMS event.
Unregister | Unregisters the events with a DBMS.


TADCustomEventAlerter Members Properties

TADCustomEventAlerter Members Properties
TADCustomEventAlerter Members Legend
Properties
Property | Description
Active | Controls the event registration state of the event alerter.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
EventAlerterIntf | Returns IADPhysEventAlerter interface.
Names | Specifies the event names handled by this alerter.
Options | The set of even alerter options.


TADCustomLocalSQL Members Events

TADCustomLocalSQL Members Events
TADCustomLocalSQL Members Legend
Events
Event | Description
OnGetDataSet | The event firing when Local SQL engine looks for a dataset object.
OnReadDataSet | The event firing when Local SQL is going to read a dataset object.


Legend

Legend
TADCustomLocalSQL Members
Legend
Property
Event


TADCustomLocalSQL Members Properties

TADCustomLocalSQL Members Properties
TADCustomLocalSQL Members Legend
Properties
Property | Description
Active | Activates Local SQL engine.
Connection | Specifies the FireDAC connection component to use.
DataSets | Collection of the registered datasets.


Properties

Legend
Legend
Property


TADCustomManager Members Events

TADCustomManager Members Events
TADCustomManager Members Legend
Events
Event | Description
AfterLoadConnectionDefFile | Fires after connection definitions file is loaded.
AfterShutdown | Fires after manager is finished.
AfterStartup | Fires after manager is started.
BeforeLoadConnectionDefFile | Fires before connection definitions file is loaded.
BeforeShutdown | Fires before manager will be finished.
BeforeStartup | Fires before manager will be started.


Legend

Legend
TADCustomManager Members
Legend
Property
read only
Event
Method


TADCustomManager Members Methods

TADCustomManager Members Methods
TADCustomManager Members Legend
Methods
Method | Description
AddConnectionDef | Adds private connection definition.
Close | Terminates FireDAC manager.
CloseConnectionDef | Closes all connections for a specified connection definition name.
DeleteConnectionDef | Deletes connection definition.
DropConnections | Closes all unused connections.
FindConnection | Find the TADCustomConnection instance with ConnectionName equal to AConnectionName.
GetBaseDriverID | Returns ID of a base driver for the specified driver ID.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetConnectionDefNames | Fills the list by existing connection definition names.
GetConnectionDefParams | Fills the list by connection definition parameters.
GetConnectionNames | Fills the list by connection names.
GetDriverNames | Fills the list by registered driver ID's.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetRDBMSKind | Returns a DBMS kind for the specified driver ID.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
IsConnectionDef | Check if name is connection definition name.
LoadConnectionDefFile | Loads connection definitions file.
ModifyConnectionDef | Modifies parameters of an existing connection definition.
Open | Activates FireDAC manager.
RefreshConnectionDefFile | Refreshes connection definition list.
RefreshMetadataCache | Invalidates meta data cache for all connections.
SaveConnectionDefFile | Saves connection definitions into a file.


TADCustomManager Members Properties

TADCustomManager Members Properties
TADCustomManager Members Legend
Properties
Property | Description
Active | Gets or sets FireDAC manager active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
ActualConnectionDefFileName | Returns expanded connection definition file name.
ActualDriverDefFileName | Returns expanded driver definition file name.
AutoCreated | Is manager object auto created.
CanRefreshConnectionDefFile | Checks if connection definition list may be refreshed.
ConnectionCount | The number of connection objects.
ConnectionDefFileAutoLoad | Controls how connection definitions file must be loaded.
ConnectionDefFileLoaded | Checks is loaded the connection definitions file.
ConnectionDefFileName | Gets / sets the name of a connection definitions file.
ConnectionDefs | The list of connection definitions.
Connections | The application connection objects.
DriverDefFileAutoLoad | Controls how driver definitions file must be loaded.
DriverDefFileName | Gets / sets the name of a driver definitions file.
DriverDefs | The list of driver definitions.
FetchOptions | The "root" fetch options.
FormatOptions | The "root" data format options.
ResourceOptions | The "root" resources control options.
SilentMode | Gets or sets FireDAC global "silent" flag.
State | Returns the current state of FireDAC manager.
UpdateOptions | The "root" data updating options.
WaitCursor | Gets or sets FireDAC wait cursor shape.


TADCustomMemTable Members Events

TADCustomMemTable Members Events
TADCustomMemTable Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADCustomMemTable Members
Legend
Property
write only
read only
protected
Method
virtual
Event


TADCustomMemTable Members Methods

TADCustomMemTable Members Methods
TADCustomMemTable Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
AppendData | Appends data to this dataset from other dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
ConstraintsDisabled | Shortcut for ConstraintsEnabled.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetOptionalParam | Returns an optional custom parameter, associated with a dataset.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MergeChangeLog | Shortcut for CommitUpdates.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetOptionalParam | Sets an optional custom parameter, associated with a dataset.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


TADCustomMemTable Members Properties

TADCustomMemTable Members Properties
TADCustomMemTable Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | Add a short summary here...
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
CommandText | Shortcut for Adapter.SelectCommand.CommandText.Text.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
DisableStringTrim | Shortcut for FormatOptions.StrsTrim.
FetchOnDemand | Shortcut for FormatOptions.Mode.
FetchOptions | The set of options to control rows fetching.
FileName | Shortcut for ResourceOptions.PersistentFileName.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
IsClone | Returns True, if this dataset is a cloned dataset.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
LogChanges | Shortcut for CachedUpdates.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
PacketRecords | Shortcut for FetchOptions.RowsetSize.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
ProviderEOF | Shortcut for SourceEOF.
ReadOnly | Shortcut for UpdateOptions.ReadOnly.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
StatusFilter | Shortcut for FilterChanges.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.
XMLData | Represents dataset content as an XML.


Properties

Legend
Legend
Property
write only
read only
protected


TADCustomQuery Members Events

TADCustomQuery Members Events
TADCustomQuery Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADCustomQuery Members
Legend
Property
read only
write only
protected
Method
virtual
Event


TADCustomQuery Members Methods

TADCustomQuery Members Methods
TADCustomQuery Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecSQL | Executes the SQL statement for the query.
ExecSQL | Executes the specified SQL statement for the query.
ExecSQL | Executes the specified SQL statement and parameter values for the query.
ExecSQL | Executes the specified SQL statement and assigns parameter values for the query.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


TADCustomQuery Members Properties

TADCustomQuery Members Properties
TADCustomQuery Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DataSource | Specifies the data source object from which associated dataset to get matching field values to the details dataset parameters.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the query SQL text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
SQL | Contains the text of the SQL statement to execute for the query.
Table | The reference to DatS table object, actually representing the internal data storage.
Text | Points to the actual text of the SQL query passed to the DBMS CLI.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.


Legend

Legend
TADCustomSchemaAdapter Members
Legend
Property
read only
Method


TADCustomSchemaAdapter Members Methods

TADCustomSchemaAdapter Members Methods
TADCustomSchemaAdapter Members Legend
Methods
Method | Description
ApplyUpdates | Applies changes for all records in the centralized change journal to the database.
Reconcile | Clears successfully updated records from the centralized cache of changes.


TADCustomSchemaAdapter Members Properties

TADCustomSchemaAdapter Members Properties
TADCustomSchemaAdapter Members Legend
Properties
Property | Description
Count | Returns the number of associated table adapters.
TableAdapters | Returns references to the associated table adapters.


TADCustomStoredProc Members Events

TADCustomStoredProc Members Events
TADCustomStoredProc Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADCustomStoredProc Members
Legend
Property
read only
write only
protected
Method
virtual
Event


TADCustomStoredProc Members Methods

TADCustomStoredProc Members Methods
TADCustomStoredProc Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DescriptionsAvailable | Determines if parameter information is available from the stored procedure on the server.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecFunc | Executes a stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter values for the stored function arguments and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter data type and values for the stored proc arguments and returns its value.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure and assigns parameter values for the stored proc arguments.
ExecProc | Executes the specified stored procedure and assigns parameter data type and values for the stored proc arguments.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


TADCustomStoredProc Members Properties

TADCustomStoredProc Members Properties
TADCustomStoredProc Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the stored procedure names to the specified catalog.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
Overload | Specifies which Oracle overloaded packaged stored procedure to execute.
PackageName | Limits the stored procedure names to the specified package name.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the number of parameters for the stored procedure.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the stored procedure names to the specified schema.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
StoredProcName | Identifies the name of the stored procedure on the server to call.
Table | The reference to DatS table object, actually representing the internal data storage.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.


TADCustomTransaction Members Events

TADCustomTransaction Members Events
TADCustomTransaction Members Legend
Events
Event | Description
AfterCommit | Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.


Legend

Legend
TADCustomTransaction Members
Legend
Property
read only
Event
Method


TADCustomTransaction Members Methods

TADCustomTransaction Members Methods
TADCustomTransaction Members Legend
Methods
Method | Description
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.


TADCustomTransaction Members Properties

TADCustomTransaction Members Properties
TADCustomTransaction Members Legend
Properties
Property | Description
Active | Indicates whether a database transaction is in progress or not.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
DataSetCount | Returns the number of datasets associated with this transaction.
DataSets | Returns the dataset associated with this transaction by it index.
Options | The set of options controlling transactions behaviour.
TransactionIntf | Returns IADPhysTransaction interface.


Legend

Legend
TADCustomUpdateObject Members
Legend
Property
Method
abstract


TADCustomUpdateObject Members Methods

TADCustomUpdateObject Members Methods
TADCustomUpdateObject Members Legend
Methods
Method | Description
Apply | Applies record update request to DB for current record in DataSet.


Methods

Legend
Legend
Method
abstract


TADCustomUpdateObject Members Properties

TADCustomUpdateObject Members Properties
TADCustomUpdateObject Members Legend
Properties
Property | Description
DataSet | Identifies the dataset on which change log update object will operate.


TADEventAlerter Members Events

TADEventAlerter Members Events
TADEventAlerter Members Legend
Events
Event | Description
OnAlert | The event fires, when a DBMS event is fired.
OnTimeout | The event fires, when a DBMS event is timed out.


Legend

Legend
TADEventAlerter Members
Legend
Property
read only
Event
Method


TADEventAlerter Members Methods

TADEventAlerter Members Methods
TADEventAlerter Members Legend
Methods
Method | Description
Register | Registers the events with a DBMS.
Signal | Fires a DBMS event.
Unregister | Unregisters the events with a DBMS.


TADEventAlerter Members Properties

TADEventAlerter Members Properties
TADEventAlerter Members Legend
Properties
Property | Description
Active | Controls the event registration state of the event alerter.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
EventAlerterIntf | Returns IADPhysEventAlerter interface.
Names | Specifies the event names handled by this alerter.
Options | The set of even alerter options.


Legend

Legend
TADLocalSQLDataSet Members
Legend
Property
read only


TADLocalSQLDataSet Members Properties

TADLocalSQLDataSet Members Properties
TADLocalSQLDataSet Members Legend
Properties
Property | Description
ActualName | Returns actual dataset name.
Adapter | Specifies a dataset reference for the Local SQL engine.
DataSet | Specifies a dataset reference for the Local SQL engine.
IsValid | Returns True, if dataset may be registered.
Name | Specifies alternative dataset name.
Temporary | Designates implicitly registered datasets.


Legend

Legend
TADLocalSQLDataSets Members
Legend
Property
Method


TADLocalSQLDataSets Members Methods

TADLocalSQLDataSets Members Methods
TADLocalSQLDataSets Members Legend
Methods
Method | Description
Add | Appends new TADLocalSQLDataSet object to a collection.
Add | Appends new TADLocalSQLDataSet object with specified arguments to a collection.
Remove | Removes dataset registration from the collection.


TADLocalSQLDataSets Members Properties

TADLocalSQLDataSets Members Properties
TADLocalSQLDataSets Members Legend
Properties
Property | Description
Items | Returns TADLocalSQLDataSet object by it index.


TADManager Members Events

TADManager Members Events
TADManager Members Legend
Events
Event | Description
AfterLoadConnectionDefFile | Fires after connection definitions file is loaded.
AfterShutdown | Fires after manager is finished.
AfterStartup | Fires after manager is started.
BeforeLoadConnectionDefFile | Fires before connection definitions file is loaded.
BeforeShutdown | Fires before manager will be finished.
BeforeStartup | Fires before manager will be started.


Legend

Legend
TADManager Members
Legend
Property
read only
Event
Method


TADManager Members Methods

TADManager Members Methods
TADManager Members Legend
Methods
Method | Description
AddConnectionDef | Adds private connection definition.
Close | Terminates FireDAC manager.
CloseConnectionDef | Closes all connections for a specified connection definition name.
DeleteConnectionDef | Deletes connection definition.
DropConnections | Closes all unused connections.
FindConnection | Find the TADCustomConnection instance with ConnectionName equal to AConnectionName.
GetBaseDriverID | Returns ID of a base driver for the specified driver ID.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetConnectionDefNames | Fills the list by existing connection definition names.
GetConnectionDefParams | Fills the list by connection definition parameters.
GetConnectionNames | Fills the list by connection names.
GetDriverNames | Fills the list by registered driver ID's.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetRDBMSKind | Returns a DBMS kind for the specified driver ID.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
IsConnectionDef | Check if name is connection definition name.
LoadConnectionDefFile | Loads connection definitions file.
ModifyConnectionDef | Modifies parameters of an existing connection definition.
Open | Activates FireDAC manager.
RefreshConnectionDefFile | Refreshes connection definition list.
RefreshMetadataCache | Invalidates meta data cache for all connections.
SaveConnectionDefFile | Saves connection definitions into a file.


TADManager Members Properties

TADManager Members Properties
TADManager Members Legend
Properties
Property | Description
Active | Gets or sets FireDAC manager active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
ActualConnectionDefFileName | Returns expanded connection definition file name.
ActualDriverDefFileName | Returns expanded driver definition file name.
AutoCreated | Is manager object auto created.
CanRefreshConnectionDefFile | Checks if connection definition list may be refreshed.
ConnectionCount | The number of connection objects.
ConnectionDefFileAutoLoad | Controls how connection definitions file must be loaded.
ConnectionDefFileLoaded | Checks is loaded the connection definitions file.
ConnectionDefFileName | Gets / sets the name of a connection definitions file.
ConnectionDefs | The list of connection definitions.
Connections | The application connection objects.
DriverDefFileAutoLoad | Controls how driver definitions file must be loaded.
DriverDefFileName | Gets / sets the name of a driver definitions file.
DriverDefs | The list of driver definitions.
FetchOptions | The "root" fetch options.
FormatOptions | The "root" data format options.
ResourceOptions | The "root" resources control options.
SilentMode | Gets or sets FireDAC global "silent" flag.
State | Returns the current state of FireDAC manager.
UpdateOptions | The "root" data updating options.
WaitCursor | Gets or sets FireDAC wait cursor shape.


TADMemTable Members Events

TADMemTable Members Events
TADMemTable Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADMemTable Members
Legend
Property
read only
write only
protected
Event
Method
virtual


TADMemTable Members Methods

TADMemTable Members Methods
TADMemTable Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
AppendData | Appends data to this dataset from other dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
ConstraintsDisabled | Shortcut for ConstraintsEnabled.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetOptionalParam | Returns an optional custom parameter, associated with a dataset.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MergeChangeLog | Shortcut for CommitUpdates.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetOptionalParam | Sets an optional custom parameter, associated with a dataset.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


TADMemTable Members Properties

TADMemTable Members Properties
TADMemTable Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | Add a short summary here...
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
CommandText | Shortcut for Adapter.SelectCommand.CommandText.Text.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
DisableStringTrim | Shortcut for FormatOptions.StrsTrim.
FetchOnDemand | Shortcut for FormatOptions.Mode.
FetchOptions | The set of options to control rows fetching.
FileName | Shortcut for ResourceOptions.PersistentFileName.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
IsClone | Returns True, if this dataset is a cloned dataset.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
LogChanges | Shortcut for CachedUpdates.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
PacketRecords | Shortcut for FetchOptions.RowsetSize.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
ProviderEOF | Shortcut for SourceEOF.
ReadOnly | Shortcut for UpdateOptions.ReadOnly.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
StatusFilter | Shortcut for FilterChanges.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.
XMLData | Represents dataset content as an XML.


TADMetaInfoCommand Members Events

TADMetaInfoCommand Members Events
TADMetaInfoCommand Members Legend
Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterFetch | The event fires after fetching from command cursor.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeFetch | The event fires before fetching from command cursor.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.


Legend

Legend
TADMetaInfoCommand Members
Legend
Property
read only
Event
Method


TADMetaInfoCommand Members Methods

TADMetaInfoCommand Members Methods
TADMetaInfoCommand Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current command operation.
AcquireConnection | Acquires reference to the actual connection object.
Close | Closes command current cursor.
CloseAll | Closes all command cursors.
Define | Defines DatS manager for command multiple result sets.
Define | Define DatS table structure for command's current cursor.
Disconnect | Use Disconnect method to release DBMS resources, used by this command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Fetch | Fetches rows from current command cursor.
FillParams | Fills the Params collection.
FindMacro | Returns macro by its name.
FindParam | Returns parameter by its name.
GetConnection | Returns the connection object.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Open | Executes SQL command, returning cursor.
OpenOrExecute | Execute SQL command, optionally returning cursor.
ParamByName | Returns parameter by its name.
Prepare | Prepares SQL command for execution.
ReleaseConnection | Releases reference to the actual connection object.
Unprepare | Releases SQL command resources.


TADMetaInfoCommand Members Properties

TADMetaInfoCommand Members Properties
TADMetaInfoCommand Members Legend
Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Gets / sets the name of base object.
BindedBy | Determines how command is connected to connection object.
CatalogName | Identifies catalog name for some command kinds.
CommandIntf | Returns IADPhysCommand interface.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
DataSet | Reference to dataset object owning this command.
FetchOptions | The set of options to control rows fetching.
FixedCommandKind | True, if the CommandKind property value is set explicitly.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
MetaInfoKind | Gets / sets the kind of metadata to retrieve.
ObjectName | Gets / sets the name of object to get detailed information about it.
ObjectScopes | Gets / sets object scopes filter.
Overload | Oracle stored procedure overload index.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | The collection of parameters for a SQL command.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Identifies schema name for some of command kinds.
SQLText | The SQL command text as it will be sent to the DBMS.
State | Returns the current state of the command object.
TableKinds | Gets / sets table kind filter.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.
Values | Provides access to the values for all parameters for the command.
Wildcard | Gets / sets objects filter by their name.


TADMetaInfoQuery Members Events

TADMetaInfoQuery Members Events
TADMetaInfoQuery Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADMetaInfoQuery Members
Legend
Property
read only
write only
protected
Event
Method
virtual


TADMetaInfoQuery Members Methods

TADMetaInfoQuery Members Methods
TADMetaInfoQuery Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


TADMetaInfoQuery Members Properties

TADMetaInfoQuery Members Properties
TADMetaInfoQuery Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
BaseObjectName | Gets / sets the name of base object.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Specified the DBMS catalog name
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
MetaInfoKind | Gets / sets the kind of metadata to retrieve.
ObjectName | Gets / sets the name of object to get detailed information about it.
ObjectScopes | Gets / sets object scopes filter.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Specified the DBMS schema name.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
TableKinds | Gets / sets tables filter by their kinds.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.
Wildcard | Gets / sets objects filter by their name.


TADQuery Members Events

TADQuery Members Events
TADQuery Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADQuery Members
Legend
Property
read only
write only
protected
Event
Method
virtual


TADQuery Members Methods

TADQuery Members Methods
TADQuery Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecSQL | Executes the SQL statement for the query.
ExecSQL | Executes the specified SQL statement for the query.
ExecSQL | Executes the specified SQL statement and parameter values for the query.
ExecSQL | Executes the specified SQL statement and assigns parameter values for the query.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


TADQuery Members Properties

TADQuery Members Properties
TADQuery Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DataSource | Specifies the data source object from which associated dataset to get matching field values to the details dataset parameters.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the query SQL text.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
SQL | Contains the text of the SQL statement to execute for the query.
Table | The reference to DatS table object, actually representing the internal data storage.
Text | Points to the actual text of the SQL query passed to the DBMS CLI.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.


TADRdbmsDataSet Members Events

TADRdbmsDataSet Members Events
TADRdbmsDataSet Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADRdbmsDataSet Members
Legend
Property
read only
write only
protected
Event
Method
virtual


TADRdbmsDataSet Members Methods

TADRdbmsDataSet Members Methods
TADRdbmsDataSet Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


TADRdbmsDataSet Members Properties

TADRdbmsDataSet Members Properties
TADRdbmsDataSet Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.


TADStoredProc Members Events

TADStoredProc Members Events
TADStoredProc Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADStoredProc Members
Legend
Property
read only
write only
protected
Event
Method
virtual


TADStoredProc Members Methods

TADStoredProc Members Methods
TADStoredProc Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DescriptionsAvailable | Determines if parameter information is available from the stored procedure on the server.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Disconnects the dataset from DBMS.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecFunc | Executes a stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter values for the stored function arguments and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter data type and values for the stored proc arguments and returns its value.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure and assigns parameter values for the stored proc arguments.
ExecProc | Executes the specified stored procedure and assigns parameter data type and values for the stored proc arguments.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


TADStoredProc Members Properties

TADStoredProc Members Properties
TADStoredProc Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the stored procedure names to the specified catalog.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
Overload | Specifies which Oracle overloaded packaged stored procedure to execute.
PackageName | Limits the stored procedure names to the specified package name.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the number of parameters for the stored procedure.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the stored procedure names to the specified schema.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
StoredProcName | Identifies the name of the stored procedure on the server to call.
Table | The reference to DatS table object, actually representing the internal data storage.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.


TADTable Members Events

TADTable Members Events
TADTable Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADTable Members
Legend
Property
read only
write only
protected
Method
virtual
Event


TADTable Members Methods

TADTable Members Methods
TADTable Members Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Disconnects the dataset from DBMS.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
ExecSQL | Executes the SQL statement for the query.
ExecSQL | Executes the specified SQL statement for the query.
ExecSQL | Executes the specified SQL statement and parameter values for the query.
ExecSQL | Executes the specified SQL statement and assigns parameter values for the query.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindMacro | Returns macro by its name.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetCustomWhere | Allows to submit a custom WHERE phrase or additional filtering condition.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetResults | Forces DBMS to return the output parameter values.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Offline | Sets dataset to offline mode.
Open | Executes the specified SQL statement and opens dataset.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Prepare | Prepares SQL command for execution.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefireSQL | Allows to rebuild a SELECT statement and reopen the table.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
Unprepare | Releases SQL command resources.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


Methods

Legend
Legend
Method
virtual
protected


TADTable Members Properties

TADTable Members Properties
TADTable Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | The reference to a data adapter.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the table names to the catalog.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Command | The reference to a command, used to execute / open queries.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DataSource | Specifies the data source object from which associated dataset to get matching field values to the details dataset parameters.
DatSManager | The reference to the inmemory data storage manager.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
Exists | Returns True when the specified table exists.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
LocalSQL | The reference to a Local SQL engine.
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
ParamCount | Returns the current number of parameters in the query SQL text.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
PointedConnection | The actual connection object.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SavePoint | Gets / sets the change log version number.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the table names to the schema.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
SQL | Contains the text of the SQL statement to execute for the query.
Table | The reference to DatS table object, actually representing the internal data storage.
TableName | Gets / sets table name to open.
Text | Points to the actual text of the SQL query passed to the DBMS CLI.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
UpdateTransaction | Gets / sets reference to transaction object.
View | The reference to base DatS view object.


TADTransaction Members Events

TADTransaction Members Events
TADTransaction Members Legend
Events
Event | Description
AfterCommit | Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.


Legend

Legend
TADTransaction Members
Legend
Event
Property
read only
Method


TADTransaction Members Methods

TADTransaction Members Methods
TADTransaction Members Legend
Methods
Method | Description
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.


TADTransaction Members Properties

TADTransaction Members Properties
TADTransaction Members Legend
Properties
Property | Description
Active | Indicates whether a database transaction is in progress or not.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
DataSetCount | Returns the number of datasets associated with this transaction.
DataSets | Returns the dataset associated with this transaction by it index.
Options | The set of options controlling transactions behaviour.
TransactionIntf | Returns IADPhysTransaction interface.


Legend

Legend
TADUpdateSQL Members
Legend
Property
read only
Method
virtual


TADUpdateSQL Members Methods

TADUpdateSQL Members Methods
TADUpdateSQL Members Legend
Methods
Method | Description
Apply | Applies record update request to DB for current record in DataSet.


TADUpdateSQL Members Properties

TADUpdateSQL Members Properties
TADUpdateSQL Members Legend
Properties
Property | Description
Commands | Returns reference to internal command object, that will handle update request.
Connection | Gets / sets the connection object.
ConnectionName | Gets / sets the connection name.
DataSet | Identifies the dataset on which change log update object will operate.
DeleteSQL | Specifies a SQL statement to use when applying a deletion of a record.
FetchRowSQL | Specifies a SQL statement to use to refetch a single record.
InsertSQL | Specifies a SQL statement to use when applying an insertion of a record.
LockSQL | Specifies the SQL statement to use when locking a record.
ModifySQL | Specifies the SQL statement to use when applying an update of a record.
SQL | Gets / sets a specified SQL statement used when applying updates to DB.
UnlockSQL | Specifies the SQL statement to use when unlocking a record.


Legend

Legend
TADAggregate Members
Legend
Property
read only


TADAggregate Members Properties

TADAggregate Members Properties
TADAggregate Members Legend
Properties
Property | Description
Active | Controls when aggregated value must be calculated.
ActualActive | Returns True, if aggregated value is really calculated.
DataSet | Returns the reference to containing dataset.
DataType | Returns the data type of aggregated value.
Expression | Specifies the expression to be calculated.
GroupingLevel | Specifies the set of records in the group.
IndexName | Specifies the index name, for which aggregated value applies.
InUse | Indicates whether the aggregate value is currently available.
Name | Specifies the name of an aggregated value.
Value | Returns the calculated value of the aggregate expression.


Legend

Legend
TADAggregates Members
Legend
Property
Method


TADAggregates Members Methods

TADAggregates Members Methods
TADAggregates Members Legend
Methods
Method | Description
Add | Appends new TADAggregate object to a collection.
AggregateByName | Find TADAggregate object by its name and raises exception if it is not found.
FindAggregate | Find TADAggregate object by its name.


TADAggregates Members Properties

TADAggregates Members Properties
TADAggregates Members Legend
Properties
Property | Description
Items | Returns TADAggregate object by it index.


Legend

Legend
TADAutoIncField Members
Legend
Property


TADAutoIncField Members Properties

TADAutoIncField Members Properties
TADAutoIncField Members Legend
Properties
Property | Description
AutoIncrementSeed | Specifies initial value for client side auto incrementing value.
AutoIncrementStep | Specifies incrementing step for client side auto incrementing value.
ClientAutoIncrement | Specifies when dataset need to generate auto incremental value for new record column.
GeneratorName | Specifies name of a sequence / generator to the field.
IdentityInsert | Enables to explicitly assign values to the auto incremental column.
ServerAutoIncrement | Specifies when DBMS generates auto incremental value for new record column.


Legend

Legend
TADBlobStream Members
Legend
Constructor


TADBlobStream Members Methods

TADBlobStream Members Methods
TADBlobStream Members Legend
Methods
Method | Description
Create | Creates new TADBlobStream object.
Truncate | Truncates BLOB value to zero length.


Methods

Legend
Legend
Constructor


TADDataSet Members Events

TADDataSet Members Events
TADDataSet Members Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
TADDataSet Members
Legend
Property
read only
protected
Event
Method
virtual


TADDataSet Members Methods

TADDataSet Members Methods
TADDataSet Members Legend
Methods
Method | Description
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


TADDataSet Members Properties

TADDataSet Members Properties
TADDataSet Members Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
FormatOptions | The set of options to control data representation.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
ResourceOptions | The set of options to control resources usage.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.


Properties

Legend
Legend
Property
read only
protected


Legend

Legend
TADIndex Members
Legend
Property
read only


TADIndex Members Properties

TADIndex Members Properties
TADIndex Members Legend
Properties
Property | Description
Active | Controls when dataset view must be maintained.
ActualActive | Returns True, if dataset view is really maintained.
CaseInsFields | Specifies fields for which sorting must be case-insensitive.
DataSet | Returns the reference to containing dataset.
DescFields | Specifies fields for which sorting must be done in descending order.
Distinct | Controls returning of distinct view value.
Expression | Specifies expression which must be used to sort records.
Fields | Identifies the fields that comprise the index.
Filter | Specifies the text of a view filter.
FilterOptions | Specifies filtering options.
Name | Specifies the name of dataset view.
Options | Specifies sorting options.
Selected | Specifies, if a dataset view is the current dataset view.


Legend

Legend
TADIndexes Members
Legend
Property
Method


TADIndexes Members Methods

TADIndexes Members Methods
TADIndexes Members Legend
Methods
Method | Description
Add | Appends new TADIndex object to a collection.
FindIndex | Find TADIndex object by its name.
FindIndexForFields | Find existing TADIndex object by sort fields and options.
IndexByName | Find TADIndex object by its name and raises exception if it is not found.


TADIndexes Members Properties

TADIndexes Members Properties
TADIndexes Members Legend
Properties
Property | Description
Items | Returns TADIndex object by it index.


Legend

Legend
TADMasterDataLink Members
Legend
Property
read only
Method


TADMasterDataLink Members Methods

TADMasterDataLink Members Methods
TADMasterDataLink Members Legend
Methods
Method | Description
CancelSync | Cancels delayed detail dataset refreshing.
DisableDelayedScroll | Disables delayed refresh of detail dataset.
DisableScroll | Disables refreshing of detail dataset.
EnableDelayedScroll | Reenables delayed refresh of detail dataset.
EnableScroll | Reenables refresh of detail dataset.
Synchronize | Synchronizes detail dataset with master dataset.


TADMasterDataLink Members Properties

TADMasterDataLink Members Properties
TADMasterDataLink Members Legend
Properties
Property | Description
ActualDelayedScrollEnabled | Returns True, if a scrolling will be really delayed.
DelayedScrollEnabled | Returns True, if a delayed scrolling is enabled.


Legend

Legend
TADSQLTimeIntervalField Members
Legend
Property
read only


TADSQLTimeIntervalField Members Properties

TADSQLTimeIntervalField Members Properties
TADSQLTimeIntervalField Members Legend
Properties
Property | Description
AsSQLTimeInterval | Value of the time interval field.
IntervalKind | Returns time interval kind.


Legend

Legend
TADWideMemoField Members
Legend
Property


TADWideMemoField Members Properties

TADWideMemoField Members Properties
TADWideMemoField Members Legend
Properties
Property | Description
Value | Value of long text field.


Legend

Legend
TADXMLField Members
Legend
Property
read only


TADXMLField Members Properties

TADXMLField Members Properties
TADXMLField Members Legend
Properties
Property | Description
SchemaName | Returns optional XML schema name.
Value | Value of long text field.


TADGUIxAsyncExecuteDialog Members Events

TADGUIxAsyncExecuteDialog Members Events
TADGUIxAsyncExecuteDialog Members Legend
Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.


Legend

Legend
TADGUIxAsyncExecuteDialog Members
Legend
Property
read only
Event


TADGUIxAsyncExecuteDialog Members Properties

TADGUIxAsyncExecuteDialog Members Properties
TADGUIxAsyncExecuteDialog Members Legend
Properties
Property | Description
AsyncDialog | Reference to dialog interface.
Caption | The dialog caption.
HideDelay | Specifies a delay before dialog hiding.
Prompt | Specifies the dialog prompt.
Provider | Specifies implementation kind.
ShowDelay | Specifies a delay before dialog showing.


Legend

Legend
TADGUIxComponent Members
Legend
Property


TADGUIxComponent Members Properties

TADGUIxComponent Members Properties
TADGUIxComponent Members Legend
Properties
Property | Description
Provider | Specifies implementation kind.


Legend

Legend
TADGUIxErrorDialog Members
Legend
Property
read only
Method


TADGUIxErrorDialog Members Methods

TADGUIxErrorDialog Members Methods
TADGUIxErrorDialog Members Legend
Methods
Method | Description
Execute | Displays the error dialog.


TADGUIxErrorDialog Members Properties

TADGUIxErrorDialog Members Properties
TADGUIxErrorDialog Members Legend
Properties
Property | Description
Caption | The dialog caption.
Enabled | Controls the dialog usage.
ErrorDialog | Reference to dialog interface.
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
Provider | Specifies implementation kind.
StayOnTop | Controls the position of dialog.


TADGUIxLoginDialog Members Events

TADGUIxLoginDialog Members Events
TADGUIxLoginDialog Members Legend
Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.


Legend

Legend
TADGUIxLoginDialog Members
Legend
Property
read only
Method
Event


TADGUIxLoginDialog Members Methods

TADGUIxLoginDialog Members Methods
TADGUIxLoginDialog Members Legend
Methods
Method | Description
Execute | Executes the login dialog.
GetAllLoginParams | Fills the VisibleItems.


TADGUIxLoginDialog Members Properties

TADGUIxLoginDialog Members Properties
TADGUIxLoginDialog Members Legend
Properties
Property | Description
Caption | The dialog caption.
ChangeExpiredPassword | Controls the user ability to change an expired password.
ConnectionDef | Specifies the connection definition to modify.
HistoryEnabled | Controls the login history storage.
HistoryKey | Specifies where to store login history.
HistoryStorage | Specifies what storage kind to use for the login history.
HistoryWithPassword | Controls should the login history contain the passwords or not.
LoginDialog | Reference to dialog interface.
LoginRetries | Specifies the number of unsuccessful login retries.
OnChangePassword | Fires when user password is expired.
OnLogin | Fires when user should provide database credentials.
Provider | Specifies implementation kind.
VisibleItems | Specifies the visible login dialog fields.


TADGUIxScriptDialog Members Events

TADGUIxScriptDialog Members Events
TADGUIxScriptDialog Members Legend
Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.


Legend

Legend
TADGUIxScriptDialog Members
Legend
Property
read only
Event


TADGUIxScriptDialog Members Properties

TADGUIxScriptDialog Members Properties
TADGUIxScriptDialog Members Legend
Properties
Property | Description
Caption | The dialog caption.
OnInput | Fires when a script executes ACCEPT command.
OnOutput | Fires when a script provides some feedback to a user.
OnPause | Fires when a script executes PAUSE command.
OnProgress | Fires when a script updates the job progress.
Options | Specifies the dialog options.
Provider | Specifies implementation kind.
ScriptDialog | Reference to dialog interface.


TADGUIxWaitCursor Members Events

TADGUIxWaitCursor Members Events
TADGUIxWaitCursor Members Legend
Events
Event | Description
OnHide | Fires before the wait cursor will be hidden.
OnShow | Fires after the wait cursor will be shown.


Legend

Legend
TADGUIxWaitCursor Members
Legend
Property
read only
Event


TADGUIxWaitCursor Members Properties

TADGUIxWaitCursor Members Properties
TADGUIxWaitCursor Members Legend
Properties
Property | Description
Provider | Specifies implementation kind.
ScreenCursor | Specifies the cursor to use when FireDAC is busy.
WaitCursor | Returns reference to wait cursor interface.


TADScript Members Events

TADScript Members Events
TADScript Members Legend
Events
Event | Description
AfterExecute | The event is fired after the execution is finished.
AfterScript | The event is fired after the script processing is finished.
BeforeExecute | The event is fired before the execution is started.
BeforeScript | The event is fired vefore the script processing is started.
OnConsoleGet | The event allows to an end-user to enter a value.
OnConsoleLockUpdate | The event allows to temporary lock an end-user interface.
OnConsolePut | The event allows to produce an end-user output.
OnError | The event fires, when an error happens, while script engine is communicating with DBMS.
OnGetText | The event fires, when a script engine needs a reference to a stream.
OnHostCommand | The event fires, when a script engine needs to execute external host OS command.
OnPause | The event fires, when a script engine needs to make a pause in script execution.
OnProgress | The event is firing, while a script engine is processing a script.
OnReleaseText | The event fires, when a script engine needs to release a reference to a stream.
OnSpoolPut | The event allows to produce a script execution trace output.


Legend

Legend
TADScript Members
Legend
Property
read only
Method
Event


TADScript Members Methods

TADScript Members Methods
TADScript Members Legend
Methods
Method | Description
AbortJob | Aborts the script validation of execution.
ExecuteAll | Executes a SQL script.
ExecuteFile | Executes the specified SQL script file.
ExecuteFile | Executes the specified SQL script file with the specified arguments.
ExecuteScript | Executes a SQL script contained in the string list.
ExecuteScript | Executes a SQL script contained in the string list with the specified arguments.
ExecuteStep | Extracts and executes a next command from the SQL script.
ValidateAll | Validates the SQL script.
ValidateStep | Validates a next command in the SQL script.


TADScript Members Properties

TADScript Members Properties
TADScript Members Legend
Properties
Property | Description
AllSpools | A list of the all produced spool files.
Arguments | The script arguments.
CallStack | Returns the current script call stack.
Connection | Specifies a connection object.
CurrentCommand | A reference to the current SQL script command.
EOF | Returns True, if current position is beyond the last command in SQL script.
FetchOptions | Fetch options for the SQL commands.
Finished | Controls the script execution.
FormatOptions | Format options for the SQL commands.
LastSpoolFileName | Returns the name of the current active spool file.
Macros | The script macros.
Params | The parameters for the script SQL commands.
Position | Controls the current SQL script position.
ProcessedAfterCommit | Returns the number of the SQL commands processed after last commiting of a transaction.
ResourceOptions | Resource options for the SQL commands.
ScriptDialog | A reference to a script feedback dialog.
ScriptOptions | The script control options.
SQLScriptFileName | The SQL script file name.
SQLScripts | The collection of the SQL scripts.
Status | Returns the script engine current status.
TotalErrors | The number of exceptions raised.
TotalJobDone | The already processed part of the script.
TotalJobSize | The total size of the script.
TotalPct10Done | The percents of the already processed part of the script.
Transaction | Specifies a transaction object.


Legend

Legend
TADScriptCommand Members
Legend
Property
read only
Method
virtual


TADScriptCommand Members Methods

TADScriptCommand Members Methods
TADScriptCommand Members Legend
Methods
Method | Description
AbortJob | Implements SQL script command abortion.
Execute | Implements the script control command execution.
Help | Implements the command help output.
Keywords | Implements command keywords providing.
Parse | Implements script command parsing.
Validate | Implements the script control command validation.


TADScriptCommand Members Properties

TADScriptCommand Members Properties
TADScriptCommand Members Legend
Properties
Property | Description
Engine | Returns a reference to SQL script engine.
EngineIntf | Returns reference to SQL script engine private API.
Parser | Returns reference to a SQL Script parser object.
Position | Returns the current script command position.


Legend

Legend
TADScriptCommandRegistry Members
Legend
Property
read only
Method


TADScriptCommandRegistry Members Methods

TADScriptCommandRegistry Members Methods
TADScriptCommandRegistry Members Legend
Methods
Method | Description
AddCommand | Registers new command class.
LookupCommand | Finds a command class by the command name.


TADScriptCommandRegistry Members Properties

TADScriptCommandRegistry Members Properties
TADScriptCommandRegistry Members Legend
Properties
Property | Description
Commands | Returns reference to a command class by the index.
Count | Returns the number of registered command classes.


Legend

Legend
TADScriptOptions Members
Legend
Property
Method
virtual


TADScriptOptions Members Methods

TADScriptOptions Members Methods
TADScriptOptions Members Legend
Methods
Method | Description
Assign | Assigns a TADScriptOptions object to this object.
Reset | Reset this object property values to their default state.


TADScriptOptions Members Properties

TADScriptOptions Members Properties
TADScriptOptions Members Legend
Properties
Property | Description
AutoPrintParams | Controls the output of the parameter values after a SQL command execution.
BreakOnError | Controls an action the script engine should take if an error has happened.
CharacterSet | Specifies the default connection character set.
ClientLib | Specifies the default connection client library.
ColumnHeadings | Controls output of the result set column headers.
CommandSeparator | Specifies the SQL command separator.
CommitEachNCommands | Specifies the number of SQL commands, after which a COMMIT must be performed.
ConsoleOutput | Controls the script engine output to a console.
DefaultDataPath | Specifies default path to the data files for the COPY command.
DefaultScriptPath | Specifies default path to the script files.
DriverID | Specifies the default connection driver ID.
DropNonexistObj | Controls the dropping of the nonexistent database objects.
EchoCommands | Specifies what parts of a SQL script must be echoed to console.
EchoCommandTrim | Controls the command echo output trimming.
FeedbackCommands | Controls the feedback output after each SQL command execution.
FeedbackScript | Controls the feedback output after each SQL script execution.
FileEncoding | Specifies the SQL script file encoding.
FileEndOfLine | Specifies the SQL script file end-of-line character sequence.
IgnoreError | Controls the script engine action on the errors.
LineSize | Specifies the maximum line width.
MacroExpand | Controls macro substitution for script engine.
MaxStringWidth | Specifies the maximum string field value size.
PageSize | Specifies the rowset page size.
ParamArraySize | Specifies the Array DML size.
RaisePLSQLErrors | Controls raising of exceptions after the PL/SQL compilation errors.
SpoolFileName | Specifies the spool file name.
SpoolOutput | Controls the spooling output mode.
SQLDialect | Specifies the SQL dialect for new Firebird or Interbase connections.
Timing | Controls the command performance feedback.
TrimConsole | Controls the right spaces trimming from the console output.
TrimSpool | Controls the right spaces trimming from the spool output.
Verify | Enables to show a complete SQL command text before execution.


Legend

Legend
TADSQLScript Members
Legend
Property


TADSQLScript Members Properties

TADSQLScript Members Properties
TADSQLScript Members Legend
Properties
Property | Description
Name | The name of a script.
SQL | The SQL script.


Legend

Legend
TADSQLScripts Members
Legend
Property
Method


TADSQLScripts Members Methods

TADSQLScripts Members Methods
TADSQLScripts Members Legend
Methods
Method | Description
Add | Add new SQL script object to a collection.
FindScript | Returns a SQL script by its name.


TADSQLScripts Members Properties

TADSQLScripts Members Properties
TADSQLScripts Members Legend
Properties
Property | Description
Items | Returns SQL script object by its index.


Legend

Legend
TADMoniRemoteClientLink Members
Legend
Property


TADMoniRemoteClientLink Members Properties

TADMoniRemoteClientLink Members Properties
TADMoniRemoteClientLink Members Legend
Properties
Property | Description
Host | The IP host address, where ADMonitor is running.
Port | The IP port, where ADMonitor is listening.
Timeout | ADMonitor connection timeout.
Tracing | Add a short summary here...


TADADSBackup Members Events

TADADSBackup Members Events
TADADSBackup Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADADSBackup Members
Legend
Method
Property
read only
Event


TADADSBackup Members Methods

TADADSBackup Members Methods
TADADSBackup Members Legend
Methods
Method | Description
Backup | Performs the backup task.


TADADSBackup Members Properties

TADADSBackup Members Properties
TADADSBackup Members Legend
Properties
Property | Description
BackupPath | Specifies the path to place the backup image in.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Exclude | Specifies the tables to exclude from backup or restore.
Include | Specifies the tables to include into backup or restore.
Options | Specifies the backup options.
Password | Specifies the SQL user password to connect to the DB server.
Results | The reference to the backup / restore errors list.
TableTypeMap | Specifies the table type to file extension mapping.
UserName | Specifies the SQL user name to connect to the DB server.


TADADSBackupRestore Members Events

TADADSBackupRestore Members Events
TADADSBackupRestore Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADADSBackupRestore Members
Legend
Property
read only
Event


TADADSBackupRestore Members Properties

TADADSBackupRestore Members Properties
TADADSBackupRestore Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Exclude | Specifies the tables to exclude from backup or restore.
Include | Specifies the tables to include into backup or restore.
Password | Specifies the SQL user password to connect to the DB server.
Results | The reference to the backup / restore errors list.
TableTypeMap | Specifies the table type to file extension mapping.
UserName | Specifies the SQL user name to connect to the DB server.


TADADSRestore Members Events

TADADSRestore Members Events
TADADSRestore Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADADSRestore Members
Legend
Method
Property
read only
Event


TADADSRestore Members Methods

TADADSRestore Members Methods
TADADSRestore Members Legend
Methods
Method | Description
Restore | Performs the restore task.


TADADSRestore Members Properties

TADADSRestore Members Properties
TADADSRestore Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DDPassword | Specify the data dictionary password.
DestinationPath | Path to restore the database to.
DriverLink | Specifies the DriverLink.
Exclude | Specifies the tables to exclude from backup or restore.
Include | Specifies the tables to include into backup or restore.
Options | Specifies the restore options.
Password | Specifies the SQL user password to connect to the DB server.
Results | The reference to the backup / restore errors list.
SourcePassword | Source dictionary password.
SourcePath | Path to the existing backup image.
TableTypeMap | Specifies the table type to file extension mapping.
UserName | Specifies the SQL user name to connect to the DB server.


TADADSService Members Events

TADADSService Members Events
TADADSService Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADADSService Members
Legend
Property
read only
Event


TADADSService Members Properties

TADADSService Members Properties
TADADSService Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Password | Specifies the SQL user password to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.


TADADSUtility Members Events

TADADSUtility Members Events
TADADSUtility Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Fires after a table is processed.


Legend

Legend
TADADSUtility Members
Legend
Method
Event
Property
read only


TADADSUtility Members Methods

TADADSUtility Members Methods
TADADSUtility Members Legend
Methods
Method | Description
Decrypt | Decrypts encrypted table and removes the password.
Encrypt | Encrypts a table and assigns a password.
Pack | Packs a table.
Recall | Recalls all deleted records in a table.
Reindex | Rebuilds all open indexes associated with the given table.
Zap | Removes all records from the table and re-indexes it.


TADADSUtility Members Properties

TADADSUtility Members Properties
TADADSUtility Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Password | Specifies the SQL user password to connect to the DB server.
TablePassword | Specifies encryption password for free tables.
Tables | The list of tables to process.
TableType | Specifies a table type.
UserName | Specifies the SQL user name to connect to the DB server.


TADPhysADSDriverLink Members Events

TADPhysADSDriverLink Members Events
TADPhysADSDriverLink Members Legend
Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.


Legend

Legend
TADPhysADSDriverLink Members
Legend
Property
read only
Method
Event


TADPhysADSDriverLink Members Methods

TADPhysADSDriverLink Members Methods
TADPhysADSDriverLink Members Legend
Methods
Method | Description
Release | Releases the driver resources, allowing to initialize the driver with different parameters.


TADPhysADSDriverLink Members Properties

TADPhysADSDriverLink Members Properties
TADPhysADSDriverLink Members Legend
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DateFormat | Specifies the default driver date format.
Decimals | Specifies the default number of digits after decimal point.
DefaultPath | Specifies the default path for the free tables.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
Epoch | Specifies the default epoch for dates with two year digits.
Exact | Specifies the default string comparison mode.
SearchPath | Specifies the search path for the free tables.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
ShowDeleted | Specifies the deleted records visibility mode.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.


TADASABackup Members Events

TADASABackup Members Events
TADASABackup Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADASABackup Members
Legend
Method
Property
read only
Event


TADASABackup Members Methods

TADASABackup Members Methods
TADASABackup Members Legend
Methods
Method | Description
Backup | Starts the backup task.


TADASABackup Members Properties

TADASABackup Members Properties
TADASABackup Members Legend
Properties
Property | Description
CheckpointLogType | Control copying of checkpoint log.
CliObj | Returns a reference to the driver CLI object.
ConnectParams | Specify connection parameters.
DriverLink | Specifies the DriverLink.
Flags | Specifies additional backup flags.
HotlogFilename | Specifies the file name for the live backup file.
OnProgress | Specifies the event handler allowing to communicate with the DB server.
OutputDir | Specifies the directory the backup files are copied to.
PageBlocksize | Specifies the maximum block size to be used to transfer pages from the database server to dbbackup.
StartLine | Specifies the start line.
ToolLib | Reference to the tool library.


TADASAService Members Events

TADASAService Members Events
TADASAService Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADASAService Members
Legend
Property
read only
Event


TADASAService Members Properties

TADASAService Members Properties
TADASAService Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
OnProgress | Specifies the event handler allowing to communicate with the DB server.
ToolLib | Reference to the tool library.


TADASAValidate Members Events

TADASAValidate Members Events
TADASAValidate Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADASAValidate Members
Legend
Method
Property
read only
Event


TADASAValidate Members Methods

TADASAValidate Members Methods
TADASAValidate Members Legend
Methods
Method | Description
Validate | Starts the validation task.


TADASAValidate Members Properties

TADASAValidate Members Properties
TADASAValidate Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
ConnectParams | Specify connection parameters.
DriverLink | Specifies the DriverLink.
Flags | Specifies additional validate flags.
OnProgress | Specifies the event handler allowing to communicate with the DB server.
StartLine | Specifies the start line.
Tables | Specifies the table or materialized view list to validate.
ToolLib | Reference to the tool library.
ValidateType | Specifies the database validation mode.


TADPhysASADriverLink Members Events

TADPhysASADriverLink Members Events
TADPhysASADriverLink Members Legend
Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.


Legend

Legend
TADPhysASADriverLink Members
Legend
Property
read only
Method
Event


TADPhysASADriverLink Members Methods

TADPhysASADriverLink Members Methods
TADPhysASADriverLink Members Legend
Methods
Method | Description
GetDrivers | Returns the list of ODBC driver names.
GetDSNs | Returns the list of ODBC data source names.
Release | Releases the driver resources, allowing to initialize the driver with different parameters.


TADPhysASADriverLink Members Properties

TADPhysASADriverLink Members Properties
TADPhysASADriverLink Members Legend
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
ODBCAdvanced | The ODBC driver common parameters.
ODBCDriver | The ODBC driver name.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
ToolLib | Specifies the path to the DBTOOLn.DLL.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.


TADIBBackup Members Events

TADIBBackup Members Events
TADIBBackup Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.


Legend

Legend
TADIBBackup Members
Legend
Method
Property
read only
Event


TADIBBackup Members Methods

TADIBBackup Members Methods
TADIBBackup Members Legend
Methods
Method | Description
Backup | Starts the backup task.


TADIBBackup Members Properties

TADIBBackup Members Properties
TADIBBackup Members Legend
Properties
Property | Description
BackupFiles | Specifies the backup files.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to backup.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Options | Specifies backup options.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Verbose | Controls the DB Service Manager feedback.


TADIBNBackup Members Events

TADIBNBackup Members Events
TADIBNBackup Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.


Legend

Legend
TADIBNBackup Members
Legend
Method
Property
read only
Event


TADIBNBackup Members Methods

TADIBNBackup Members Methods
TADIBNBackup Members Legend
Methods
Method | Description
Backup | Starts the backup task.


TADIBNBackup Members Properties

TADIBNBackup Members Properties
TADIBNBackup Members Legend
Properties
Property | Description
BackupFile | Specifies a backup file.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to backup.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Level | Specifies the backup level.
Options | Specifies backup options.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.


TADIBNRestore Members Events

TADIBNRestore Members Events
TADIBNRestore Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.


Legend

Legend
TADIBNRestore Members
Legend
Method
Property
read only
Event


TADIBNRestore Members Methods

TADIBNRestore Members Methods
TADIBNRestore Members Legend
Methods
Method | Description
Restore | Starts the restore task.


TADIBNRestore Members Properties

TADIBNRestore Members Properties
TADIBNRestore Members Legend
Properties
Property | Description
BackupFiles | Specifies the backup files.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to restore.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Options | Specifies restore options.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.


TADIBRestore Members Events

TADIBRestore Members Events
TADIBRestore Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.


Legend

Legend
TADIBRestore Members
Legend
Method
Property
read only
Event


TADIBRestore Members Methods

TADIBRestore Members Methods
TADIBRestore Members Legend
Methods
Method | Description
Restore | Starts the restore task.


TADIBRestore Members Properties

TADIBRestore Members Properties
TADIBRestore Members Legend
Properties
Property | Description
BackupFiles | Specifies the backup files.
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to restore.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Options | Specifies restore options.
PageSize | Specifies the page size for a restored database.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Verbose | Controls the DB Service Manager feedback.


TADIBSecurity Members Events

TADIBSecurity Members Events
TADIBSecurity Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.


Legend

Legend
TADIBSecurity Members
Legend
Property
read only
Method
Event


TADIBSecurity Members Methods

TADIBSecurity Members Methods
TADIBSecurity Members Legend
Methods
Method | Description
AddUser | Adds a new user to FB/IB security database.
DeleteUser | Deletes an existing user from FB/IB security database.
DisplayUser | Fetches an existing user properties from FB/IB security database.
DisplayUsers | Fetches all user list from FB/IB security database.
ModifyUser | Modifies an existing user in FB/IB security database.


TADIBSecurity Members Properties

TADIBSecurity Members Properties
TADIBSecurity Members Legend
Properties
Property | Description
AFirstName | A person first name.
AGroupID | A person group ID.
AGroupName | A person group name.
ALastName | A person last name.
AMiddleName | A person middle name.
APassword | A person password.
ARoleName | A person role name.
AUserID | A person ID.
AUserName | A person SQL user name.
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Modified | A list of modified user attributes.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.
Users | The reference to the all users list.


TADIBService Members Events

TADIBService Members Events
TADIBService Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.


Legend

Legend
TADIBService Members
Legend
Property
read only
Event


TADIBService Members Properties

TADIBService Members Properties
TADIBService Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.


TADIBTrace Members Events

TADIBTrace Members Events
TADIBTrace Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.


Legend

Legend
TADIBTrace Members
Legend
Method
Property
read only
Event


TADIBTrace Members Methods

TADIBTrace Members Methods
TADIBTrace Members Legend
Methods
Method | Description
List | Produces a list of trace sessions.
Resume | Resumes a trace session.
Start | Starts new trace session.
Stop | Stops a trace session.
Suspend | Suspends a trace session.


TADIBTrace Members Properties

TADIBTrace Members Properties
TADIBTrace Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Config | Specifies the trace session configuration.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SessionID | The trace session ID.
SessionName | The trace session name.
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.


TADIBValidate Members Events

TADIBValidate Members Events
TADIBValidate Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the DB server feedback.


Legend

Legend
TADIBValidate Members
Legend
Method
Property
read only
Event


TADIBValidate Members Methods

TADIBValidate Members Methods
TADIBValidate Members Legend
Methods
Method | Description
Analyze | Starts the statistics gathering task.
CheckOnly | Starts the read-only validate database task.
Repair | Starts the repair task.
Sweep | Starts the sweep task.


TADIBValidate Members Properties

TADIBValidate Members Properties
TADIBValidate Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to validate / repair.
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Options | Specifies validate / repair options.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.


TADPhysDriverLink Members Events

TADPhysDriverLink Members Events
TADPhysDriverLink Members Legend
Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.


Legend

Legend
TADPhysDriverLink Members
Legend
Property
read only
Method
Event


TADPhysDriverLink Members Methods

TADPhysDriverLink Members Methods
TADPhysDriverLink Members Legend
Methods
Method | Description
Release | Releases the driver resources, allowing to initialize the driver with different parameters.


TADPhysDriverLink Members Properties

TADPhysDriverLink Members Properties
TADPhysDriverLink Members Legend
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.


TADPhysDriverService Members Events

TADPhysDriverService Members Events
TADPhysDriverService Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADPhysDriverService Members
Legend
Property
read only
Event


TADPhysDriverService Members Properties

TADPhysDriverService Members Properties
TADPhysDriverService Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.


TADMSAccessService Members Events

TADMSAccessService Members Events
TADMSAccessService Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADMSAccessService Members
Legend
Method
Property
read only
Event


TADMSAccessService Members Methods

TADMSAccessService Members Methods
TADMSAccessService Members Legend
Methods
Method | Description
Compact | Compacts an Access database.
CreateDB | Creates a new Access database.
Drop | Drops an existing Access database.
Repair | Repairs an existing Access database.


TADMSAccessService Members Properties

TADMSAccessService Members Properties
TADMSAccessService Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | A database file name.
DBVersion | The database format version.
DestDatabase | A destination database file name.
DriverLink | Specifies the DriverLink.
Encrypted | The database encryption mode.
Password | The database password.
ResetPassword | Whether or not to reset the database password.
SortOrder | The database sort order.


Legend

Legend
EMSSQLNativeException Members
Legend
Property
read only


EMSSQLNativeException Members Properties

EMSSQLNativeException Members Properties
EMSSQLNativeException Members Legend
Properties
Property | Description
Errors | Returns an error item.


TADPhysMySQLDriverLink Members Events

TADPhysMySQLDriverLink Members Events
TADPhysMySQLDriverLink Members Legend
Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.


Legend

Legend
TADPhysMySQLDriverLink Members
Legend
Property
read only
Method
Event


TADPhysMySQLDriverLink Members Methods

TADPhysMySQLDriverLink Members Methods
TADPhysMySQLDriverLink Members Legend
Methods
Method | Description
Release | Releases the driver resources, allowing to initialize the driver with different parameters.


TADPhysMySQLDriverLink Members Properties

TADPhysMySQLDriverLink Members Properties
TADPhysMySQLDriverLink Members Legend
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
EmbeddedArgs | Specifies the MySQL Embedded server arguments.
EmbeddedGroups | Specifies the MySQL Embedded server argument groups.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.


TADPhysODBCBaseDriverLink Members Events

TADPhysODBCBaseDriverLink Members Events
TADPhysODBCBaseDriverLink Members Legend
Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.


Legend

Legend
TADPhysODBCBaseDriverLink Members
Legend
Method
Property
read only
Event


TADPhysODBCBaseDriverLink Members Methods

TADPhysODBCBaseDriverLink Members Methods
TADPhysODBCBaseDriverLink Members Legend
Methods
Method | Description
GetDrivers | Returns the list of ODBC driver names.
GetDSNs | Returns the list of ODBC data source names.
Release | Releases the driver resources, allowing to initialize the driver with different parameters.


TADPhysODBCBaseDriverLink Members Properties

TADPhysODBCBaseDriverLink Members Properties
TADPhysODBCBaseDriverLink Members Legend
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
ODBCAdvanced | The ODBC driver common parameters.
ODBCDriver | The ODBC driver name.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.


TADPhysOracleDriverLink Members Events

TADPhysOracleDriverLink Members Events
TADPhysOracleDriverLink Members Legend
Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.


Legend

Legend
TADPhysOracleDriverLink Members
Legend
Method
Property
read only
Event


TADPhysOracleDriverLink Members Methods

TADPhysOracleDriverLink Members Methods
TADPhysOracleDriverLink Members Legend
Methods
Method | Description
GetOracleHomes | Returns the list of installed Oracle homes.
GetTNSServices | Returns the list of TNS aliases.
Release | Releases the driver resources, allowing to initialize the driver with different parameters.


TADPhysOracleDriverLink Members Properties

TADPhysOracleDriverLink Members Properties
TADPhysOracleDriverLink Members Legend
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
NLSLang | Allows to specify the NLS_LANG environment variable value.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.
Threaded | Allows to specify OCI multi-threaded initialization mode.
TNSAdmin | Allows to specify the TNS_ADMIN environment variable value.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.


TADSQLiteBackup Members Events

TADSQLiteBackup Members Events
TADSQLiteBackup Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | The event firing after each copying step.


Legend

Legend
TADSQLiteBackup Members
Legend
Property
read only
Method
Event


TADSQLiteBackup Members Methods

TADSQLiteBackup Members Methods
TADSQLiteBackup Members Legend
Methods
Method | Description
Backup | Executes the backup or copy operation.


TADSQLiteBackup Members Properties

TADSQLiteBackup Members Properties
TADSQLiteBackup Members Legend
Properties
Property | Description
BusyTimeout | Controls the timeout of waiting for a locks to be released.
Catalog | The name of source attached database.
CliObj | Returns a reference to the driver CLI object.
Database | A source database file name.
DatabaseObj | A source database object.
DestCatalog | The name of destination attached database.
DestDatabase | A destination database file name.
DestDatabaseObj | A destination database object.
DestMode | The destination database open mode.
DestPassword | The password for destination database.
DriverLink | Specifies the DriverLink.
PageCount | The total number of pages to copy.
PagesPerStep | Number of pages per single copy step.
Password | The password for source database.
Remaining | The remaining number of pages to copy.
WaitForLocks | Controls the waiting for a locks to be released.


TADSQLiteCollation Members Events

TADSQLiteCollation Members Events
TADSQLiteCollation Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADSQLiteCollation Members
Legend
Property
read only
Event


TADSQLiteCollation Members Properties

TADSQLiteCollation Members Properties
TADSQLiteCollation Members Legend
Properties
Property | Description
Active | Activates and registers a collation.
CliObj | Returns a reference to the driver CLI object.
CollationKind | The collation implementation kind.
CollationName | The unique collation name.
DriverLink | Specifies the DriverLink.
Flags | The scCompareString collation kind collation flags.
Locale | The scCompareString collation kind collation.
OnCompare | The scCustomXxx compare strings event.


TADSQLiteFunction Members Events

TADSQLiteFunction Members Events
TADSQLiteFunction Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADSQLiteFunction Members
Legend
Property
read only
Event


TADSQLiteFunction Members Properties

TADSQLiteFunction Members Properties
TADSQLiteFunction Members Legend
Properties
Property | Description
Active | Activates and registers a function.
Aggregated | Controls the function mode.
ArgumentsCount | The number of formal arguments the function is awaiting.
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
FunctionName | The unique function name.
OnCalculate | The calculate function event.


TADSQLiteRTree Members Events

TADSQLiteRTree Members Events
TADSQLiteRTree Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADSQLiteRTree Members
Legend
Property
read only
Event


TADSQLiteRTree Members Properties

TADSQLiteRTree Members Properties
TADSQLiteRTree Members Legend
Properties
Property | Description
Active | Activates and registers a RTree.
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.
OnCalculate | The RTree match event.
RTreeName | The unique RTree module name.


TADSQLiteSecurity Members Events

TADSQLiteSecurity Members Events
TADSQLiteSecurity Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADSQLiteSecurity Members
Legend
Method
Property
read only
Event


TADSQLiteSecurity Members Methods

TADSQLiteSecurity Members Methods
TADSQLiteSecurity Members Legend
Methods
Method | Description
ChangePassword | Changes the password for encrypted database.
CheckEncryption | Returns the database encryption status.
RemovePassword | Removes the password and decrypts the database.
SetPassword | Adds the password and encrypts the database.


TADSQLiteSecurity Members Properties

TADSQLiteSecurity Members Properties
TADSQLiteSecurity Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | A database file name.
DriverLink | Specifies the DriverLink.
Options | The encryption options.
Password | The database password.
ToPassword | The database password change to.


TADSQLiteService Members Events

TADSQLiteService Members Events
TADSQLiteService Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
TADSQLiteService Members
Legend
Property
read only
Event


TADSQLiteService Members Properties

TADSQLiteService Members Properties
TADSQLiteService Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
DriverLink | Specifies the DriverLink.


TADSQLiteValidate Members Events

TADSQLiteValidate Members Events
TADSQLiteValidate Members Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.
OnProgress | Specifies the event handler allowing to handle the SQLite feedback.


Legend

Legend
TADSQLiteValidate Members
Legend
Method
Property
read only
Event


TADSQLiteValidate Members Methods

TADSQLiteValidate Members Methods
TADSQLiteValidate Members Legend
Methods
Method | Description
Analyze | Starts the statistics gathering task.
CheckOnly | Starts the read-only validate database task.
Sweep | Starts the sweep task.


TADSQLiteValidate Members Properties

TADSQLiteValidate Members Properties
TADSQLiteValidate Members Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.
Database | Specifies a database file to validate.
DriverLink | Specifies the DriverLink.
MaxErrors | Specifies the maximum number of errors.
Options | Specifies validate options.
Password | Specifies a password to database to validate.


TADLocalSQL Members Events

TADLocalSQL Members Events
TADLocalSQL Members Legend
Events
Event | Description
OnGetDataSet | The event firing when Local SQL engine looks for a dataset object.
OnReadDataSet | The event firing when Local SQL is going to read a dataset object.


Legend

Legend
TADLocalSQL Members
Legend
Property
Event


TADLocalSQL Members Properties

TADLocalSQL Members Properties
TADLocalSQL Members Legend
Properties
Property | Description
Active | Activates Local SQL engine.
Connection | Specifies the FireDAC connection component to use.
DataSets | Collection of the registered datasets.
DisableControls | Controls dataset DisableControls / EnableControls calls.
IncludeHiddenFields | Controls inclusion of invisible and hidden fields into Local SQL result sets.
MultipleCursors | Controls dataset cloning and copying.
SchemaName | Set schema name for datasets.


Legend

Legend
EADDBArrayExecuteError Members
Legend
Property
read only


EADDBArrayExecuteError Members Properties

EADDBArrayExecuteError Members Properties
EADDBArrayExecuteError Members Legend
Properties
Property | Description
Action | Specifies an error processor action.
ADCode | Returns an FireDAC specific error code.
ADObjName | Returns object name raised the exception.
Exception | Returns a reference to the original exception object.
Offset | Returns an offset of a failed array item from the array beginning.
RetryLevel | Returns a number of a retry operation.
Times | Returns a number of the array items remained to process in the array after the error has happened.


Legend

Legend
EADDBEngineException Members
Legend
Property
read only


EADDBEngineException Members Properties

EADDBEngineException Members Properties
EADDBEngineException Members Legend
Properties
Property | Description
ADCode | Returns an FireDAC specific error code.
ADObjName | Returns object name raised the exception.
ErrorCode | Returns a DBMS specific error code.
ErrorCount | Indicates the total number of errors contained in the Errors property.
Errors | Lists the entire FireDAC / DBMS error, warning or message collection.
Kind | Returns a DBMS-independent error kind.
Params | Return a failed SQL command parameter values.
SQL | Return a failed SQL command text.


Legend

Legend
EADException Members
Legend
Property


EADException Members Properties

EADException Members Properties
EADException Members Legend
Properties
Property | Description
ADCode | Returns an FireDAC specific error code.
ADObjName | Returns object name raised the exception.


Legend

Legend
TADDBError Members
Legend
Property


TADDBError Members Properties

TADDBError Members Properties
TADDBError Members Legend
Properties
Property | Description
CommandTextOffset | Returns offset from a SQL command text beginning.
ErrorCode | Returns a DBMS specific error code.
Kind | Returns a DBMS independent error kind.
Level | Number of a TADDBError item.
Message | Returns a error, warning or message text.
ObjName | Returns a DBMS object name, participating in an error or warning.
RowIndex | Returns a row index, where an error has happened.


Legend

Legend
TADBottomResourceOptions Members
Legend
Method
virtual
Property
read only


TADBottomResourceOptions Members Methods

TADBottomResourceOptions Members Methods
TADBottomResourceOptions Members Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
ResolveFileName | Returns actual persistent dataset file name.
RestoreDefaults | Restore option default values.


TADBottomResourceOptions Members Properties

TADBottomResourceOptions Members Properties
TADBottomResourceOptions Members Legend
Properties
Property | Description
ActualSilentMode | Returns actual silent mode a dataset will use.
ArrayDMLSize | Limits the maximum possible Array DML array size.
AssignedValues | Specifies the set of changed options.
Backup | Controls backup of data file for persistent datasets.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
CmdExecMode | Controls DBMS action execution mode.
CmdExecTimeout | Controls DBMS action execution timeout.
DefaultParamType | Specifies default parameter direction.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
DirectExecute | Controls preparation of SQL statements.
EscapeExpand | Controls processing of escape sequences.
MacroCreate | Controls automatic filling of Macros collection.
MacroExpand | Controls expansion of macros.
ParamCreate | Controls automatic filling of Params collection.
ParamExpand | Controls expansion of parameters.
Persistent | Controls dataset persistence.
PersistentFileName | Specifies persistent dataset file name.
PreprocessCmdText | Controls SQL command text preprocessor.
SilentMode | Controls dataset GUI feedback.
StoreItems | Specifies the data to write into the persistent dataset data files or streams.
StoreVersion | Specifies the format version for the persistent dataset data files or streams.
UnifyParams | Controls unification of a stored procedure parameters.
Version | The current version of options.


Legend

Legend
TADBottomUpdateOptions Members
Legend
Method
virtual
Property
read only


TADBottomUpdateOptions Members Methods

TADBottomUpdateOptions Members Methods
TADBottomUpdateOptions Members Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.


TADBottomUpdateOptions Members Properties

TADBottomUpdateOptions Members Properties
TADBottomUpdateOptions Members Legend
Properties
Property | Description
AssignedValues | Specifies the set of changed options.
AutoIncFields | Specifies dataset fields, which are auto-incrementing by DBMS.
CheckReadOnly | Controls checking of TField.ReadOnly property.
CheckRequired | Controls checking of TField.Required property.
CheckUpdatable | Controls ability to change a TField value.
CountUpdatedRecords | Controls checking of an updated record count.
EnableDelete | Allows to delete records from dataset.
EnableInsert | Allows to insert records into dataset.
EnableUpdate | Allows to edit records of dataset.
FastUpdates | Controls fast vs secure updates.
FetchGeneratorsPoint | Controls the moment, when next generator value will be fetched.
GeneratorName | Specifies the generator name from which to fetch next value for auto-increment fields.
KeyFields | Specifies dataset primary key fields.
LockMode | Controls how the FireDAC locks database record while editing it.
LockPoint | Controls the moment, when database record will be locked.
LockWait | Controls waiting for pessimistic lock to be acquired.
ReadOnly | Specifies whether the dataset is read-only.
RefreshDelete | Specifies should a dataset delete a record locally when a database record is not found at refreshing.
RefreshMode | Specifies how dataset should refresh record after posting update to it.
RequestLive | Provided for BDE compatibility.
UpdateChangedFields | Controls which fields to include into UPDATE or INSERT command.
UpdateMode | Controls how the FireDAC locates records when posting updates.
UpdateNonBaseFields | Controls should fields from the joined non-base table to be included into UPDATE or INSERT command.
UpdateTableName | Specifies table name to use in SQL commands posting updates.
Version | The current version of options.


Legend

Legend
TADCustomOptions Members
Legend
Property
read only
Method
virtual


TADCustomOptions Members Methods

TADCustomOptions Members Methods
TADCustomOptions Members Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restores option default values.


TADCustomOptions Members Properties

TADCustomOptions Members Properties
TADCustomOptions Members Legend
Properties
Property | Description
Version | The current version of options.


Legend

Legend
TADEventAlerterOptions Members
Legend
Property


TADEventAlerterOptions Members Properties

TADEventAlerterOptions Members Properties
TADEventAlerterOptions Members Legend
Properties
Property | Description
AutoRegister | Controls the automatic registration of the events at a DBMS.
Kind | Specifies the event alerter kind.
Synchronize | Controls the thread, where the alerter event handlers will be executed.
Timeout | Specifies the event alerter timeout.


Legend

Legend
TADFetchOptions Members
Legend
Property
read only
Method
virtual


TADFetchOptions Members Methods

TADFetchOptions Members Methods
TADFetchOptions Members Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.


TADFetchOptions Members Properties

TADFetchOptions Members Properties
TADFetchOptions Members Legend
Properties
Property | Description
ActualRowsetSize | Returns actual rowset size a command will use.
AssignedValues | Specifies the set of changed options.
AutoClose | Controls automatic closing of a dataset cursor after fetching the last record.
AutoFetchAll | Controls automatic fetching of all records from a dataset cursor before disconnecting a command.
Cache | Controls what kind of data to cache in memory.
CursorKind | Specifies type of cursor an FireDAC command or dataset uses.
DetailCascade | Controls propagation of a master dataset changes to a detail dataset in Centralized Cached Updates mode.
DetailDelay | Controls the delay between master dataset scroll and detail dataset refresh.
DetailOptimize | Specifies to refresh detail dataset only when master record is changed.
Items | Controls what kind of data to fetch.
LiveWindowFastFirst | Controls the TADTable live data window fetch optimization mode.
LiveWindowParanoic | Controls the TADTable live data window mode records search mode.
Mode | Controls how to fetch data.
RecordCountMode | Controls how to count records in a result set.
RecsMax | Controls the maximum number of records to be fetched.
RecsSkip | Controls the offset of the first record to be fetched.
RowsetSize | Controls the number of records per single fetch.
Unidirectional | Specifies possible directions of navigation by dataset records.
Version | The current version of options.


Legend

Legend
TADFormatOptions Members
Legend
Property
read only
Method
virtual


TADFormatOptions Members Methods

TADFormatOptions Members Methods
TADFormatOptions Members Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.


TADFormatOptions Members Properties

TADFormatOptions Members Properties
TADFormatOptions Members Legend
Properties
Property | Description
AssignedValues | Specifies the set of changed options.
DataSnapCompatibility | Controls the compatibility with the DataSnap / MIDAS.
DefaultParamDataType | Specifies default data type for parameters with ftUnknown data type.
FmtDisplayDate | Specifies display format for ftDate fields.
FmtDisplayDateTime | Specifies display format for ftDateDate, ftTimeStamp fields.
FmtDisplayNumeric | Specifies display format for numeric fields.
FmtDisplayTime | Specifies display format for ftTime fields.
FmtEditNumeric | Specifies edit format for numeric fields.
InlineDataSize | Controls how character or byte string values are stored in record buffer.
MapRules | Controls data type mapping.
MaxBcdPrecision | Controls recognition of numeric values as FmtBCD ones, depending on precision.
MaxBcdScale | Controls recognition of numeric values as FmtBCD ones, depending on scale.
MaxStringSize | Controls recognition of string values as BLOB ones.
OwnMapRules | Controls usage of MapRules property.
QuoteIdentifiers | Specifies whether or not to explicitly surround identifiers with quotes.
Round2Scale | Controls values rounding.
SortLocale | Specifies a locale ID for the local sorting operations.
SortOptions | Specifies the default sort options for the local sorting operations.
StrsDivLen2 | Allows to overcome bugs in early dbExpress driver versions.
StrsEmpty2Null | Controls conversion of zero-length string values to NULL value.
StrsTrim | Controls removing of trailing spaces from string values.
StrsTrim2Len | Controls trimming string values to the declared length.
Version | The current version of options.


Legend

Legend
TADMapRule Members
Legend
Property


TADMapRule Members Properties

TADMapRule Members Properties
TADMapRule Members Legend
Properties
Property | Description
NameMask | Specifies column name mask.
PrecMax | Specifies maximal numeric precision.
PrecMin | Specifies minimal numeric precision.
ScaleMax | Specifies maximal numeric scale.
ScaleMin | Specifies minimal numeric scale.
SizeMax | Specifies maximal string size.
SizeMin | Specifies minimal string size.
SourceDataType | Specifies a source data type.
TargetDataType | Specifies a target data type.


Legend

Legend
TADMapRules Members
Legend
Property
read only
Method


TADMapRules Members Methods

TADMapRules Members Methods
TADMapRules Members Legend
Methods
Method | Description
Add | Appends new TADMapRule object to a collection.


TADMapRules Members Properties

TADMapRules Members Properties
TADMapRules Members Legend
Properties
Property | Description
Items | Returns TADMapRule object by it index.


Legend

Legend
TADResourceOptions Members
Legend
Property
read only
Method
virtual


TADResourceOptions Members Methods

TADResourceOptions Members Methods
TADResourceOptions Members Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.


TADResourceOptions Members Properties

TADResourceOptions Members Properties
TADResourceOptions Members Legend
Properties
Property | Description
ActualSilentMode | Returns actual silent mode a dataset will use.
ArrayDMLSize | Limits the maximum possible Array DML array size.
AssignedValues | Specifies the set of changed options.
Backup | Controls backup of data file for persistent datasets.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
CmdExecMode | Controls DBMS action execution mode.
CmdExecTimeout | Controls DBMS action execution timeout.
DefaultParamType | Specifies default parameter direction.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
DirectExecute | Controls preparation of SQL statements.
EscapeExpand | Controls processing of escape sequences.
MacroCreate | Controls automatic filling of Macros collection.
MacroExpand | Controls expansion of macros.
ParamCreate | Controls automatic filling of Params collection.
ParamExpand | Controls expansion of parameters.
Persistent | Controls dataset persistence.
PreprocessCmdText | Controls SQL command text preprocessor.
SilentMode | Controls dataset GUI feedback.
StoreItems | Specifies the data to write into the persistent dataset data files or streams.
StoreVersion | Specifies the format version for the persistent dataset data files or streams.
UnifyParams | Controls unification of a stored procedure parameters.
Version | The current version of options.


Legend

Legend
TADTopResourceOptions Members
Legend
Method
virtual
Property
read only
write only


TADTopResourceOptions Members Methods

TADTopResourceOptions Members Methods
TADTopResourceOptions Members Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.


TADTopResourceOptions Members Properties

TADTopResourceOptions Members Properties
TADTopResourceOptions Members Legend
Properties
Property | Description
ActualSilentMode | Returns actual silent mode a dataset will use.
ArrayDMLSize | Limits the maximum possible Array DML array size.
AssignedValues | Specifies the set of changed options.
AutoConnect | Controls automatic management of connection Active state.
AutoReconnect | Controls automatic connection recovery.
Backup | Controls backup of data file for persistent datasets.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
CmdExecMode | Controls DBMS action execution mode.
CmdExecTimeout | Controls DBMS action execution timeout.
DefaultParamType | Specifies default parameter direction.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
DirectExecute | Controls preparation of SQL statements.
EscapeExpand | Controls processing of escape sequences.
KeepConnection | Specifies whether an application remains connected to a database even if no datasets are open.
MacroCreate | Controls automatic filling of Macros collection.
MacroExpand | Controls expansion of macros.
MaxCursors | Controls maximum allowed number of active commands.
ParamCreate | Controls automatic filling of Params collection.
ParamExpand | Controls expansion of parameters.
Persistent | Controls dataset persistence.
PreprocessCmdText | Controls SQL command text preprocessor.
ServerOutput | Controls accessibility of the server side messages.
ServerOutputSize | Controls the size of Oracle message output buffer.
SilentMode | Controls dataset GUI feedback.
StoreItems | Specifies the data to write into the persistent dataset data files or streams.
StoreVersion | Specifies the format version for the persistent dataset data files or streams.
UnifyParams | Controls unification of a stored procedure parameters.
Version | The current version of options.


Properties

Legend
Legend
Property
read only
write only


Legend

Legend
TADTxOptions Members
Legend
Property
Method


TADTxOptions Members Methods

TADTxOptions Members Methods
TADTxOptions Members Legend
Methods
Method | Description
ClearChanged | Clears Changed flags.


TADTxOptions Members Properties

TADTxOptions Members Properties
TADTxOptions Members Legend
Properties
Property | Description
AutoCommit | Controls the automatic completion of transaction.
AutoStart | Controls automatic start of a transaction.
AutoStop | Controls automatic finishing of a transaction.
Changed | Returns the set of changed transaction options.
DisconnectAction | Specifies an action FireDAC should take on closing connection.
EnableNested | Controls nested transactions.
Isolation | Specifies the transaction isolation level for the transactions managed by FireDAC.
Params | Specifies custom DBMS transaction parameters.
ReadOnly | Specifies whether the transaction is read-only.
StopOptions | Specifies automatic transaction stoping options.


Legend

Legend
TADUpdateOptions Members
Legend
Method
virtual
Property
read only


TADUpdateOptions Members Methods

TADUpdateOptions Members Methods
TADUpdateOptions Members Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.


TADUpdateOptions Members Properties

TADUpdateOptions Members Properties
TADUpdateOptions Members Legend
Properties
Property | Description
AssignedValues | Specifies the set of changed options.
CheckReadOnly | Controls checking of TField.ReadOnly property.
CheckRequired | Controls checking of TField.Required property.
CheckUpdatable | Controls ability to change a TField value.
CountUpdatedRecords | Controls checking of an updated record count.
EnableDelete | Allows to delete records from dataset.
EnableInsert | Allows to insert records into dataset.
EnableUpdate | Allows to edit records of dataset.
FastUpdates | Controls fast vs secure updates.
FetchGeneratorsPoint | Controls the moment, when next generator value will be fetched.
GeneratorName | Specifies the generator name from which to fetch next value for auto-increment fields.
LockMode | Controls how the FireDAC locks database record while editing it.
LockPoint | Controls the moment, when database record will be locked.
LockWait | Controls waiting for pessimistic lock to be acquired.
ReadOnly | Specifies whether the dataset is read-only.
RefreshDelete | Specifies should a dataset delete a record locally when a database record is not found at refreshing.
RefreshMode | Specifies how dataset should refresh record after posting update to it.
RequestLive | Provided for BDE compatibility.
UpdateChangedFields | Controls which fields to include into UPDATE or INSERT command.
UpdateMode | Controls how the FireDAC locates records when posting updates.
UpdateNonBaseFields | Controls should fields from the joined non-base table to be included into UPDATE or INSERT command.
Version | The current version of options.


Legend

Legend
protected
Legend
Property
protected


protected Properties

protected Properties
protected Legend
Properties
Property | Description
UpdateObject | Specifies the update object component used to post updates by dataset.


Properties

Legend
Legend
Property
protected


Legend

Legend
protected
Legend
Property
protected
read only


protected Properties

protected Properties
protected Legend
Properties
Property | Description
MacroCount | Returns the number of macro in Macros collection.
Macros | The collection of macro substitution variables.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
RowsAffected | Returns the number of rows operated upon by the latest query execution.


Properties

Legend
Legend
Property
protected
read only


Legend

Legend
protected
Legend
Method
protected
virtual


protected Methods

protected Methods
protected Legend
Methods
Method | Description
GetCustomWhere | Allows to submit a custom WHERE phrase or additional filtering condition.


Methods

Legend
Legend
Method
protected
virtual


protected Properties

protected Properties
protected Legend
Properties
Property | Description
FetchOptions | The set of options to control rows fetching.
FormatOptions | The set of options to control data representation.
ParamCount | Returns the current number of parameters in the command text.
Params | Contains the parameters for a SQL statement.
ResourceOptions | The set of options to control resources usage.
UpdateOptions | The set of options to control updates posting.
Updates | The dataset change log.


public Events

public Events
public Legend
Events
Event | Description
OnError | The event is triggered when an error happens, while dataset is talking to DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.


Legend

Legend
public
Legend
Property
read only
write only
Event
Method
virtual


public Methods

public Methods
public Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current dataset operation.
AttachTable | Use the AttachTable to attach the dataset to existing DatS table or view.
Disconnect | Disconnects the dataset from DBMS.
GetResults | Forces DBMS to return the output parameter values.
NextRecordSet | Go to the next cursor, returned by the SQL command.
ServerAppend | Used by TADDataMove to edit directly DBMS data.
ServerCancel | Used by TADDataMove to edit directly DBMS data.
ServerDelete | Used by TADDataMove to edit directly DBMS data.
ServerDeleteAll | Deletes all records from an associated database table.
ServerEdit | Used by TADDataMove to edit directly DBMS data.
ServerGotoKey | Used by TADDataMove to edit directly DBMS data.
ServerPerform | Used by TADDataMove to edit directly DBMS data.
ServerSetKey | Used by TADDataMove to edit directly DBMS data.


public Properties

public Properties
public Legend
Properties
Property | Description
Adapter | The reference to a data adapter.
Command | The reference to a command, used to execute / open queries.
DatSManager | The reference to the inmemory data storage manager.
LocalSQL | The reference to a Local SQL engine.
PointedConnection | The actual connection object.
ServerEditRequest | Used by TADDataMove to edit directly DBMS data.


public Events

public Events
public Legend
Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterFetch | The event fires after fetching from command cursor.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeFetch | The event fires before fetching from command cursor.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.


Legend

Legend
public
Legend
Property
read only
Event
Method


public Methods

public Methods
public Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort current command operation.
AcquireConnection | Acquires reference to the actual connection object.
Close | Closes command current cursor.
CloseAll | Closes all command cursors.
Define | Defines DatS manager for command multiple result sets.
Define | Define DatS table structure for command's current cursor.
Disconnect | Use Disconnect method to release DBMS resources, used by this command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Execute | Executes SQL command.
Fetch | Fetches rows from current command cursor.
FillParams | Fills the Params collection.
FindMacro | Returns macro by its name.
FindParam | Returns parameter by its name.
GetConnection | Returns the connection object.
MacroByName | Returns macro by its name.
NextRecordSet | Go to the next cursor, returned by the SQL command.
Open | Executes SQL command, returning cursor.
OpenOrExecute | Execute SQL command, optionally returning cursor.
ParamByName | Returns parameter by its name.
Prepare | Prepares SQL command for execution.
ReleaseConnection | Releases reference to the actual connection object.
Unprepare | Releases SQL command resources.


public Properties

public Properties
public Legend
Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Identifies base object name for some of command kinds.
BindedBy | Determines how command is connected to connection object.
CatalogName | Identifies catalog name for some command kinds.
CommandIntf | Returns IADPhysCommand interface.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
DataSet | Reference to dataset object owning this command.
FetchOptions | The set of options to control rows fetching.
FixedCommandKind | True, if the CommandKind property value is set explicitly.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
Overload | Oracle stored procedure overload index.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | The collection of parameters for a SQL command.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Identifies schema name for some of command kinds.
SQLText | The SQL command text as it will be sent to the DBMS.
State | Returns the current state of the command object.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.
Values | Provides access to the values for all parameters for the command.


public Events

public Events
public Legend
Events
Event | Description
AfterCommit | Fires after transaction is committed.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
OnError | Fires before FireDAC will raise exception.
OnLogin | Fires when an application connects to a DBMS.
OnLosted | Fires after FireDAC was not able to restore losted connection to DBMS.
OnRecover | Fires after FireDAC discovered that connection to DBMS is losted.
OnRestored | Fires after FireDAC successfully restored losted connection to DBMS.


Legend

Legend
public
Legend
Event
Property
read only
Method
virtual


public Methods

public Methods
public Legend
Methods
Method | Description
AbortJob | Use the AbortJob method to abort all running dataset operations on this connection.
ApplyUpdates | Applies change logs of specified datasets to the DBMS.
Assign | Assigns all properties of one connection to this connection.
CheckActive | Checks to see if the connection is active.
CheckConnectionDef | Checks that connection definition is filled correctly.
CheckInactive | Checks to see if the connection is inactive.
CheckOnline | Checks to see if the connection is in online mode.
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
DecodeObjectName | Splits DB object name into parts.
EncodeObjectName | Assembles DB object name from it parts.
ExecSQL | Executes a SQL command without parameters.
ExecSQL | Executes SQL command with parameters.
ExecSQL | Executes a SQL command with parameters.
ExecSQLScalar | Executes a SQL command without parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
ExecSQLScalar | Executes a SQL command with parameters and fetches a single value.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetInfoReport | Populates a string list with a detailed report about a connection state.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetLastAutoGenValue | Returns last auto generated value.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
Offline | Sets connection to offline mode.
Online | Sets connection to online mode.
Open | Open connection to the database, using specified connection string.
Open | Open connection to the database, using specified user name and password.
Open | Open connection to the database, using specified connection parameters, user name and password.
Ping | Pings the DBMS server.
RefreshMetadataCache | Invalidates meta data cache.
ReleaseClients | Performs resource releasing operation on all associated datasets and commands.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.


public Properties

public Properties
public Legend
Properties
Property | Description
Connected | Gets / sets connection active status.
CliHandle | CLI handle for connection sharing.
CliObj | Returns a CLI connection wrapping object.
CommandCount | The number of assocciated TADCustomCommand objects.
Commands | Returns assocciated TADCustomCommand objects.
ConnectedStoredUsage | Controls how to use Connected property value saved to DFM.
ConnectionDefName | The name of connection definition to use.
ConnectionIntf | Returns the IADPhysConnection interface.
ConnectionMetaDataIntf | Returns an IADPhysConnectionMetadata interface.
ConnectionName | Specifies the name of the connection to associate with this connection object.
DataSets | Returns assocciated TADDataSet objects.
DriverName | Specifies the ID of the FireDAC driver for the connection.
FetchOptions | The set of default options to control rows fetching.
FormatOptions | The set of default options to control data representation.
InTransaction | Indicates whether a connection transaction is in progress or not.
IsSQLBased | Property returns True, if a data source supports SQL language.
LastUsed | The date and time of last usage of the connection.
LoginDialog | Gets / sets the reference to login dialog interface.
LoginPrompt | Specifies whether a login dialog appears immediately before opening a new connection.
Messages | Returns a list of messages returned by DBMS after recent database operation.
Offlined | Gets / sets connection offline status.
OptionsIntf | The reference to IADStanOptions interface.
Params | Lists database connection parameters for the FireDAC connection definition associated with the connection object.
RDBMSKind | Returns the brand of DBMS currently connected.
RefCount | Returns the number of references to this connection object.
ResourceOptions | The set of default options to control resources usage.
ResultConnectionDef | The actual connection definition used to establish connection to a DBMS.
SharedCliHandle | CLI handle shared with other connection.
Temporary | Shows whether a connection object is created on fly (temporary one) and managed automatically or a persistent one explicitly created, managed, and freed by the application.
Transaction | The reference to TADCustomTransaction object.
TxOptions | The set of options to control transactions.
UpdateOptions | The set of default options to control data updating.
UpdateTransaction | The reference to TADCustomTransaction object, which will be used to post changes to DB.


public Events

public Events
public Legend
Events
Event | Description
OnAlert | The event fires, when a DBMS event is fired.
OnTimeout | The event fires, when a DBMS event is timed out.


public Methods

public Methods
public Legend
Methods
Method | Description
Register | Registers the events with a DBMS.
Signal | Fires a DBMS event.
Unregister | Unregisters the events with a DBMS.


public Properties

public Properties
public Legend
Properties
Property | Description
Active | Controls the event registration state of the event alerter.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
EventAlerterIntf | Returns IADPhysEventAlerter interface.
Names | Specifies the event names handled by this alerter.
Options | The set of even alerter options.


public Events

public Events
public Legend
Events
Event | Description
OnGetDataSet | The event firing when Local SQL engine looks for a dataset object.
OnReadDataSet | The event firing when Local SQL is going to read a dataset object.


Legend

Legend
public
Legend
Property
Event


public Properties

public Properties
public Legend
Properties
Property | Description
Active | Activates Local SQL engine.
Connection | Specifies the FireDAC connection component to use.
DataSets | Collection of the registered datasets.


public Events

public Events
public Legend
Events
Event | Description
AfterLoadConnectionDefFile | Fires after connection definitions file is loaded.
AfterShutdown | Fires after manager is finished.
AfterStartup | Fires after manager is started.
BeforeLoadConnectionDefFile | Fires before connection definitions file is loaded.
BeforeShutdown | Fires before manager will be finished.
BeforeStartup | Fires before manager will be started.


public Methods

public Methods
public Legend
Methods
Method | Description
AddConnectionDef | Adds private connection definition.
Close | Terminates FireDAC manager.
CloseConnectionDef | Closes all connections for a specified connection definition name.
DeleteConnectionDef | Deletes connection definition.
DropConnections | Closes all unused connections.
FindConnection | Find the TADCustomConnection instance with ConnectionName equal to AConnectionName.
GetBaseDriverID | Returns ID of a base driver for the specified driver ID.
GetCatalogNames | Populates a string list with the names of catalogs in a DB.
GetConnectionDefNames | Fills the list by existing connection definition names.
GetConnectionDefParams | Fills the list by connection definition parameters.
GetConnectionNames | Fills the list by connection names.
GetDriverNames | Fills the list by registered driver ID's.
GetFieldNames | Populates a string list with the names of fields in a table.
GetGeneratorNames | Populates a string list with the names of generators / sequences / <how else> in a database.
GetKeyFieldNames | Populates a string list with the names of key fields in a table.
GetPackageNames | Populates a string list with the names of the packages in a DB.
GetRDBMSKind | Returns a DBMS kind for the specified driver ID.
GetSchemaNames | Populates a string list with the names of schemas in a DB.
GetStoredProcNames | Populates a string list with the names of stored procedures in a DB.
GetTableNames | Populates a string list with the names of tables in a DB.
IsConnectionDef | Check if name is connection definition name.
LoadConnectionDefFile | Loads connection definitions file.
ModifyConnectionDef | Modifies parameters of an existing connection definition.
Open | Activates FireDAC manager.
RefreshConnectionDefFile | Refreshes connection definition list.
RefreshMetadataCache | Invalidates meta data cache for all connections.
SaveConnectionDefFile | Saves connection definitions into a file.


public Properties

public Properties
public Legend
Properties
Property | Description
Active | Gets or sets FireDAC manager active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
ActualConnectionDefFileName | Returns expanded connection definition file name.
ActualDriverDefFileName | Returns expanded driver definition file name.
AutoCreated | Is manager object auto created.
CanRefreshConnectionDefFile | Checks if connection definition list may be refreshed.
ConnectionCount | The number of connection objects.
ConnectionDefFileAutoLoad | Controls how connection definitions file must be loaded.
ConnectionDefFileLoaded | Checks is loaded the connection definitions file.
ConnectionDefFileName | Gets / sets the name of a connection definitions file.
ConnectionDefs | The list of connection definitions.
Connections | The application connection objects.
DriverDefFileAutoLoad | Controls how driver definitions file must be loaded.
DriverDefFileName | Gets / sets the name of a driver definitions file.
DriverDefs | The list of driver definitions.
FetchOptions | The "root" fetch options.
FormatOptions | The "root" data format options.
ResourceOptions | The "root" resources control options.
SilentMode | Gets or sets FireDAC global "silent" flag.
State | Returns the current state of FireDAC manager.
UpdateOptions | The "root" data updating options.
WaitCursor | Gets or sets FireDAC wait cursor shape.


Legend

Legend
public
Legend
Property
write only
read only
Method
virtual


public Methods

public Methods
public Legend
Methods
Method | Description
AppendData | Appends data to this dataset from other dataset.
ConstraintsDisabled | Shortcut for ConstraintsEnabled.
GetOptionalParam | Returns an optional custom parameter, associated with a dataset.
MergeChangeLog | Shortcut for CommitUpdates.
SetOptionalParam | Sets an optional custom parameter, associated with a dataset.


public Properties

public Properties
public Legend
Properties
Property | Description
Adapter | Add a short summary here...
CommandText | Shortcut for Adapter.SelectCommand.CommandText.Text.
DisableStringTrim | Shortcut for FormatOptions.StrsTrim.
FetchOnDemand | Shortcut for FormatOptions.Mode.
FileName | Shortcut for ResourceOptions.PersistentFileName.
IsClone | Returns True, if this dataset is a cloned dataset.
LogChanges | Shortcut for CachedUpdates.
PacketRecords | Shortcut for FetchOptions.RowsetSize.
ProviderEOF | Shortcut for SourceEOF.
ReadOnly | Shortcut for UpdateOptions.ReadOnly.
StatusFilter | Shortcut for FilterChanges.
XMLData | Represents dataset content as an XML.


Properties

Legend
Legend
Property
write only
read only


Legend

Legend
public
Legend
Property
read only
Method


public Methods

public Methods
public Legend
Methods
Method | Description
ExecSQL | Executes the SQL statement for the query.
ExecSQL | Executes the specified SQL statement for the query.
ExecSQL | Executes the specified SQL statement and parameter values for the query.
ExecSQL | Executes the specified SQL statement and assigns parameter values for the query.


public Properties

public Properties
public Legend
Properties
Property | Description
DataSource | Specifies the data source object from which associated dataset to get matching field values to the details dataset parameters.
ParamCount | Returns the current number of parameters in the query SQL text.
SQL | Contains the text of the SQL statement to execute for the query.
Text | Points to the actual text of the SQL query passed to the DBMS CLI.


public Methods

public Methods
public Legend
Methods
Method | Description
ApplyUpdates | Applies changes for all records in the centralized change journal to the database.
Reconcile | Clears successfully updated records from the centralized cache of changes.


public Properties

public Properties
public Legend
Properties
Property | Description
Count | Returns the number of associated table adapters.
TableAdapters | Returns references to the associated table adapters.


Legend

Legend
public
Legend
Property
Method


public Methods

public Methods
public Legend
Methods
Method | Description
DescriptionsAvailable | Determines if parameter information is available from the stored procedure on the server.
ExecFunc | Executes a stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function in the DBMS session and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter values for the stored function arguments and returns its value.
ExecFunc | Executes the specified stored function, assigns parameter data type and values for the stored proc arguments and returns its value.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure in the DBMS session.
ExecProc | Executes the specified stored procedure and assigns parameter values for the stored proc arguments.
ExecProc | Executes the specified stored procedure and assigns parameter data type and values for the stored proc arguments.


public Properties

public Properties
public Legend
Properties
Property | Description
CatalogName | Limits the stored procedure names to the specified catalog.
Overload | Specifies which Oracle overloaded packaged stored procedure to execute.
PackageName | Limits the stored procedure names to the specified package name.
ParamCount | Returns the number of parameters for the stored procedure.
RowsAffected | Returns the number of rows operated upon by the latest query execution.
SchemaName | Limits the stored procedure names to the specified schema.
StoredProcName | Identifies the name of the stored procedure on the server to call.


public Events

public Events
public Legend
Events
Event | Description
AfterCommit | Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.


public Methods

public Methods
public Legend
Methods
Method | Description
Commit | Permanently stores modifications to the data made in the current transaction, and optionally ends the current transactions.
CommitRetaining | Permanently stores modifications to the data made in the current transaction, without ending the current transaction.
Rollback | Cancels all modifications to the data made in the current transaction and optionally ends transaction.
RollbackRetaining | Cancels all modifications to the data made in the current transaction, without ending the current transaction.
StartTransaction | Starts new transaction at database.


public Properties

public Properties
public Legend
Properties
Property | Description
Active | Indicates whether a database transaction is in progress or not.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
DataSetCount | Returns the number of datasets associated with this transaction.
DataSets | Returns the dataset associated with this transaction by it index.
Options | The set of options controlling transactions behaviour.
TransactionIntf | Returns IADPhysTransaction interface.


Legend

Legend
public
Legend
Property
Method
abstract


public Methods

public Methods
public Legend
Methods
Method | Description
Apply | Applies record update request to DB for current record in DataSet.


public Properties

public Properties
public Legend
Properties
Property | Description
DataSet | Identifies the dataset on which change log update object will operate.


Legend

Legend
public
Legend
Property
read only


public Properties

public Properties
public Legend
Properties
Property | Description
ActualName | Returns actual dataset name.
Adapter | Specifies a dataset reference for the Local SQL engine.
IsValid | Returns True, if dataset may be registered.


public Methods

public Methods
public Legend
Methods
Method | Description
Add | Appends new TADLocalSQLDataSet object to a collection.
Add | Appends new TADLocalSQLDataSet object with specified arguments to a collection.
Remove | Removes dataset registration from the collection.


public Properties

public Properties
public Legend
Properties
Property | Description
Items | Returns TADLocalSQLDataSet object by it index.


Legend

Legend
public
Legend
Property


public Properties

public Properties
public Legend
Properties
Property | Description
MacroCount | Returns the number of macro in Macros collection.
RowsAffected | Returns the number of rows operated upon by the latest query execution.


public Events

public Events
public Legend
Events
Event | Description
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.


Legend

Legend
public
Legend
Property
Event
Method
virtual


public Methods

public Methods
public Legend
Methods
Method | Description
Disconnect | Disconnects the dataset from DBMS.
FindMacro | Returns macro by its name.
MacroByName | Returns macro by its name.
Open | Executes the specified SQL statement and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Open | Executes the specified SQL statement with specified parameter values and opens dataset.
Prepare | Prepares SQL command for execution.
Unprepare | Releases SQL command resources.


public Properties

public Properties
public Legend
Properties
Property | Description
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
FetchOptions | The set of options to control rows fetching.
FormatOptions | The set of options to control data representation.
Prepared | Gets or sets command prepare for execution status.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
Transaction | Gets / sets reference to transaction object.
UpdateOptions | The set of options to control updates posting.
UpdateTransaction | Gets / sets reference to transaction object.


Legend

Legend
public
Legend
Property
read only
Method
virtual


public Methods

public Methods
public Legend
Methods
Method | Description
Disconnect | Disconnects the dataset from DBMS.
Open | Executes the specified SQL statement and opens dataset.
RefireSQL | Allows to rebuild a SELECT statement and reopen the table.


public Properties

public Properties
public Legend
Properties
Property | Description
Exists | Returns True when the specified table exists.


public Properties

public Properties
public Legend
Properties
Property | Description
Commands | Returns reference to internal command object, that will handle update request.
SQL | Gets / sets a specified SQL statement used when applying updates to DB.


public Properties

public Properties
public Legend
Properties
Property | Description
ActualActive | Returns True, if aggregated value is really calculated.
DataSet | Returns the reference to containing dataset.
DataType | Returns the data type of aggregated value.
InUse | Indicates whether the aggregate value is currently available.
Value | Returns the calculated value of the aggregate expression.


public Methods

public Methods
public Legend
Methods
Method | Description
Add | Appends new TADAggregate object to a collection.
AggregateByName | Find TADAggregate object by its name and raises exception if it is not found.
FindAggregate | Find TADAggregate object by its name.


public Properties

public Properties
public Legend
Properties
Property | Description
Items | Returns TADAggregate object by it index.


Legend

Legend
public
Legend
Constructor


public Methods

public Methods
public Legend
Methods
Method | Description
Create | Creates new TADBlobStream object.
Truncate | Truncates BLOB value to zero length.


public Events

public Events
public Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


Legend

Legend
public
Legend
Property
read only
Event
Method
virtual


public Methods

public Methods
public Legend
Methods
Method | Description
AddIndex | Creates a new client index for the dataset.
ApplyMaster | Applies a master-detail relation to this detail dataset.
ApplyRange | Applies a range to the dataset.
ApplyUpdates | Applies changes for all records in the dataset change log to the database.
AttachTable | Attaches dataset to existing DatS table and optionaly view.
BeginBatch | Optimizes dataset functionality for batch updates.
CancelRange | Cancels range for the dataset.
CancelUpdates | Removes all records from the change log and restores the dataset rows to its prior editing state.
CloneCursor | Shares the data belonging to another dataset.
CommitUpdates | Clears the changes log and marks all records as not modified.
CopyDataSet | Copies records from source dataset to this dataset.
CopyRecord | Copies all record fields from source dataset to the Self dataset.
CreateDataSet | Creates new empty internal data storage for dataset.
CreateExpression | Creates expression evaluator for dataset.
DeleteIndex | Deletes an client index for the dataset.
DeleteIndexes | Deletes all client indexes for the dataset.
DisableConstraints | Disables the enforcement of the client constraints.
Disconnect | Use Disconnect method to release DBMS resources, used by this dataset.
EditKey | Enables modification of the search key buffer.
EditRangeEnd | Enables changing the ending value for an existing range.
EditRangeStart | Enables changing the starting value for an existing range.
EmptyDataSet | Removes all records from the dataset internal data storage.
EnableConstraints | Reenables enforcement of the client constraints when records are posted.
EndBatch | Restores normal dataset functionality after batch updates.
Execute | Executes an SQL command.
FetchAgain | Allows to fetch additional records.
FetchAll | Retrieves all records from the current resultset and stores them into internal DatS table.
FetchBlobs | Retrieves BLOB field values from database for current record.
FetchDetails | Retrieves nested datasets from database for current record.
FetchNext | A shortcut to the GetNextPacket method.
FindKey | Searches for a record containing specified index field values.
FindNearest | Searches for a record containing specified index field values.
FindParam | Finds the parameter in Params property by a given name.
GetColumnField | Returns field corresponding to DatS column.
GetDetailLinkFields | Lists the field objects that link this dataset as a detail of a master dataset.
GetFieldColumn | Returns DatS column corresponding to field.
GetGroupState | Indicates where the current record sits within a specified group of records.
GetIndexNames | Fills the list by client index names.
GetNextPacket | Fetches the next rowset from the DBMS.
GetParentRow | Returns parent row of this nested dataset.
GetRow | Returns DatS row.
GotoCurrent | Sets the current record in this dataset the same as the current record in another, cloned dataset.
GotoKey | Searches for a record, using values in the key buffer.
GotoNearest | Searches for a closest record, using values in the key buffer.
IsIndexed | Returns True, if dataset has current client index.
IsLinked | Returns True, if dataset is linked to another dataset.
IsRanged | Returns True, whether the dataset records are limited by a range.
LoadFromFile | Loads a dataset's data from a file.
LoadFromFileAtOpen | Returns True, if dataset content will be loaded from file at Open.
LoadFromStream | Loads a dataset's data from a stream.
Locate | Searches the dataset for a record with specified field values and makes it current.
LocateEx | Searches the dataset for a specified record by predicate expression and makes that record current or returns its index.
LocateEx | Searches the dataset for a specified record by its fields values and makes that record current or returns its index.
Lookup | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record with specified key field values and returns result field values.
LookupEx | Searches the dataset for a record by predicate expression and returns result field values.
Offline | Sets dataset to offline mode.
OpenOrExecute | Executes SQL command and optionally opens dataset.
ParamByName | Searches parameter by its name.
Reconcile | Clears successfully updated records from the dataset's cache of changes.
RefreshRecord | Rereads field values of the current record from a data source.
RefreshUnknownRecord | Registers new record and optionally rereads it field values from a data source.
Release | Releases all dataset cursors.
RevertRecord | Undoes changes to the current record.
SaveToFile | Saves a dataset's data to a file.
SaveToFileAtClose | Returns True, if dataset content will be saved to file at Close.
SaveToStream | Saves a dataset's data to a stream.
SetFieldAttributes | Setups fields ProviderFlags.
SetKey | Starts the enter key values mode.
SetRange | Sets the starting and ending values of a range, and applies it.
SetRangeEnd | Sets the ending values of a range.
SetRangeStart | Sets the starting values of a range.
UndoLastChange | Undoes the last modification to the dataset records.
UpdateAttributes | Actualize changes to the client default expressions and auto-incremental fields.
UpdateConstraints | Actualize changes to the client constraints.
UpdateStatus | Returns the modification status for current record.


public Properties

public Properties
public Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
ChangeCount | Gets the number of changes in the change log.
CloneSource | Gets the dataset (if any) with which this dataset shares data.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
Data | Represents the data of the dataset, allowing to copy full data of one dataset into another.
DatSManager | Returns the reference to the internal data storage manager.
Delta | Represents the changed records of the dataset.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FilteredData | Represents the currently "visible" data of the dataset.
GroupingLevel | Returns the depth of grouping support provided by the current index.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldCount | Returns the number of fields that make up the current index.
IndexFieldNames | Lists the field names to use as an index.
IndexFields | Returns the fields that make up the current index.
IndexName | Gets / sets the current index for the dataset by its name.
KeyExclusive | Controls the exclusion of upper and lower boundaries for a range.
KeyFieldCount | Controls the number of indexed field values to use for key search or range setup.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterLink | Returns data link object servicing connection with master dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ParentDataSet | Returns the reference to parent dataset, if this one is nested.
RowError | Returns an exception object associated with the current dataset record.
SavePoint | Gets / sets the change log version number.
SourceEOF | Specifies if no more records to fetch from current cursor.
SourceView | The reference to DatS view object, by which rows the dataset is navigating.
Table | The reference to DatS table object, actually representing the internal data storage.
UpdatesPending | Indicates whether the changes log is not empty.
View | The reference to base DatS view object.


public Properties

public Properties
public Legend
Properties
Property | Description
ActualActive | Returns True, if dataset view is really maintained.
DataSet | Returns the reference to containing dataset.


public Methods

public Methods
public Legend
Methods
Method | Description
Add | Appends new TADIndex object to a collection.
FindIndex | Find TADIndex object by its name.
FindIndexForFields | Find existing TADIndex object by sort fields and options.
IndexByName | Find TADIndex object by its name and raises exception if it is not found.


public Properties

public Properties
public Legend
Properties
Property | Description
Items | Returns TADIndex object by it index.


public Methods

public Methods
public Legend
Methods
Method | Description
CancelSync | Cancels delayed detail dataset refreshing.
DisableDelayedScroll | Disables delayed refresh of detail dataset.
DisableScroll | Disables refreshing of detail dataset.
EnableDelayedScroll | Reenables delayed refresh of detail dataset.
EnableScroll | Reenables refresh of detail dataset.
Synchronize | Synchronizes detail dataset with master dataset.


public Properties

public Properties
public Legend
Properties
Property | Description
ActualDelayedScrollEnabled | Returns True, if a scrolling will be really delayed.
DelayedScrollEnabled | Returns True, if a delayed scrolling is enabled.


public Properties

public Properties
public Legend
Properties
Property | Description
AsSQLTimeInterval | Value of the time interval field.
IntervalKind | Returns time interval kind.


public Properties

public Properties
public Legend
Properties
Property | Description
Value | Value of long text field.


public Properties

public Properties
public Legend
Properties
Property | Description
SchemaName | Returns optional XML schema name.


public Properties

public Properties
public Legend
Properties
Property | Description
AsyncDialog | Reference to dialog interface.


public Methods

public Methods
public Legend
Methods
Method | Description
Execute | Displays the error dialog.


public Properties

public Properties
public Legend
Properties
Property | Description
ErrorDialog | Reference to dialog interface.


public Methods

public Methods
public Legend
Methods
Method | Description
Execute | Executes the login dialog.
GetAllLoginParams | Fills the VisibleItems.


public Properties

public Properties
public Legend
Properties
Property | Description
ConnectionDef | Specifies the connection definition to modify.
LoginDialog | Reference to dialog interface.


public Properties

public Properties
public Legend
Properties
Property | Description
ScriptDialog | Reference to dialog interface.


public Properties

public Properties
public Legend
Properties
Property | Description
WaitCursor | Returns reference to wait cursor interface.


public Methods

public Methods
public Legend
Methods
Method | Description
AbortJob | Aborts the script validation of execution.
ExecuteAll | Executes a SQL script.
ExecuteFile | Executes the specified SQL script file.
ExecuteFile | Executes the specified SQL script file with the specified arguments.
ExecuteScript | Executes a SQL script contained in the string list.
ExecuteScript | Executes a SQL script contained in the string list with the specified arguments.
ExecuteStep | Extracts and executes a next command from the SQL script.
ValidateAll | Validates the SQL script.
ValidateStep | Validates a next command in the SQL script.


public Properties

public Properties
public Legend
Properties
Property | Description
AllSpools | A list of the all produced spool files.
CallStack | Returns the current script call stack.
CurrentCommand | A reference to the current SQL script command.
EOF | Returns True, if current position is beyond the last command in SQL script.
Finished | Controls the script execution.
LastSpoolFileName | Returns the name of the current active spool file.
Position | Controls the current SQL script position.
ProcessedAfterCommit | Returns the number of the SQL commands processed after last commiting of a transaction.
Status | Returns the script engine current status.
TotalErrors | The number of exceptions raised.
TotalJobDone | The already processed part of the script.
TotalJobSize | The total size of the script.
TotalPct10Done | The percents of the already processed part of the script.


public Methods

public Methods
public Legend
Methods
Method | Description
AbortJob | Implements SQL script command abortion.
Execute | Implements the script control command execution.
Help | Implements the command help output.
Keywords | Implements command keywords providing.
Parse | Implements script command parsing.
Validate | Implements the script control command validation.


public Properties

public Properties
public Legend
Properties
Property | Description
Engine | Returns a reference to SQL script engine.
EngineIntf | Returns reference to SQL script engine private API.
Parser | Returns reference to a SQL Script parser object.
Position | Returns the current script command position.


public Methods

public Methods
public Legend
Methods
Method | Description
AddCommand | Registers new command class.
LookupCommand | Finds a command class by the command name.


public Properties

public Properties
public Legend
Properties
Property | Description
Commands | Returns reference to a command class by the index.
Count | Returns the number of registered command classes.


public Methods

public Methods
public Legend
Methods
Method | Description
Add | Add new SQL script object to a collection.
FindScript | Returns a SQL script by its name.


public Properties

public Properties
public Legend
Properties
Property | Description
Items | Returns SQL script object by its index.


Legend

Legend
public
Legend
Method


public Methods

public Methods
public Legend
Methods
Method | Description
Backup | Performs the backup task.


public Properties

public Properties
public Legend
Properties
Property | Description
Results | The reference to the backup / restore errors list.


public Methods

public Methods
public Legend
Methods
Method | Description
Restore | Performs the restore task.


public Methods

public Methods
public Legend
Methods
Method | Description
Decrypt | Decrypts encrypted table and removes the password.
Encrypt | Encrypts a table and assigns a password.
Pack | Packs a table.
Recall | Recalls all deleted records in a table.
Reindex | Rebuilds all open indexes associated with the given table.
Zap | Removes all records from the table and re-indexes it.


public Methods

public Methods
public Legend
Methods
Method | Description
Backup | Starts the backup task.


public Properties

public Properties
public Legend
Properties
Property | Description
ToolLib | Reference to the tool library.


public Methods

public Methods
public Legend
Methods
Method | Description
Validate | Starts the validation task.


public Methods

public Methods
public Legend
Methods
Method | Description
Restore | Starts the restore task.


public Methods

public Methods
public Legend
Methods
Method | Description
AddUser | Adds a new user to FB/IB security database.
DeleteUser | Deletes an existing user from FB/IB security database.
DisplayUser | Fetches an existing user properties from FB/IB security database.
DisplayUsers | Fetches all user list from FB/IB security database.
ModifyUser | Modifies an existing user in FB/IB security database.


public Properties

public Properties
public Legend
Properties
Property | Description
Users | The reference to the all users list.


public Methods

public Methods
public Legend
Methods
Method | Description
List | Produces a list of trace sessions.
Resume | Resumes a trace session.
Start | Starts new trace session.
Stop | Stops a trace session.
Suspend | Suspends a trace session.


public Methods

public Methods
public Legend
Methods
Method | Description
Analyze | Starts the statistics gathering task.
CheckOnly | Starts the read-only validate database task.
Repair | Starts the repair task.
Sweep | Starts the sweep task.


public Methods

public Methods
public Legend
Methods
Method | Description
Release | Releases the driver resources, allowing to initialize the driver with different parameters.


public Properties

public Properties
public Legend
Properties
Property | Description
ActualDriverID | The driver link actual driver ID.
DriverIntf | The driver Phys interface reference.
DriverState | The driver state.
Services | The services attached to this driver link.
ServicesCount | The number of services attached to this driver link.


public Properties

public Properties
public Legend
Properties
Property | Description
CliObj | Returns a reference to the driver CLI object.


public Methods

public Methods
public Legend
Methods
Method | Description
Compact | Compacts an Access database.
CreateDB | Creates a new Access database.
Drop | Drops an existing Access database.
Repair | Repairs an existing Access database.


public Properties

public Properties
public Legend
Properties
Property | Description
Errors | Returns an error item.


public Methods

public Methods
public Legend
Methods
Method | Description
GetDrivers | Returns the list of ODBC driver names.
GetDSNs | Returns the list of ODBC data source names.


public Methods

public Methods
public Legend
Methods
Method | Description
GetOracleHomes | Returns the list of installed Oracle homes.
GetTNSServices | Returns the list of TNS aliases.


public Methods

public Methods
public Legend
Methods
Method | Description
Backup | Executes the backup or copy operation.


public Properties

public Properties
public Legend
Properties
Property | Description
DatabaseObj | A source database object.
DestDatabaseObj | A destination database object.
PageCount | The total number of pages to copy.
Remaining | The remaining number of pages to copy.


public Methods

public Methods
public Legend
Methods
Method | Description
ChangePassword | Changes the password for encrypted database.
CheckEncryption | Returns the database encryption status.
RemovePassword | Removes the password and decrypts the database.
SetPassword | Adds the password and encrypts the database.


public Methods

public Methods
public Legend
Methods
Method | Description
Analyze | Starts the statistics gathering task.
CheckOnly | Starts the read-only validate database task.
Sweep | Starts the sweep task.


public Properties

public Properties
public Legend
Properties
Property | Description
Action | Specifies an error processor action.
Exception | Returns a reference to the original exception object.
Offset | Returns an offset of a failed array item from the array beginning.
RetryLevel | Returns a number of a retry operation.
Times | Returns a number of the array items remained to process in the array after the error has happened.


public Properties

public Properties
public Legend
Properties
Property | Description
ErrorCode | Returns a DBMS specific error code.
ErrorCount | Indicates the total number of errors contained in the Errors property.
Errors | Lists the entire FireDAC / DBMS error, warning or message collection.
Kind | Returns a DBMS-independent error kind.
Params | Return a failed SQL command parameter values.
SQL | Return a failed SQL command text.


public Properties

public Properties
public Legend
Properties
Property | Description
ADCode | Returns an FireDAC specific error code.
ADObjName | Returns object name raised the exception.


public Properties

public Properties
public Legend
Properties
Property | Description
CommandTextOffset | Returns offset from a SQL command text beginning.
ErrorCode | Returns a DBMS specific error code.
Kind | Returns a DBMS independent error kind.
Level | Number of a TADDBError item.
Message | Returns a error, warning or message text.
ObjName | Returns a DBMS object name, participating in an error or warning.
RowIndex | Returns a row index, where an error has happened.


Legend

Legend
public
Legend
Method
virtual


public Methods

public Methods
public Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
ResolveFileName | Returns actual persistent dataset file name.
RestoreDefaults | Restore option default values.


public Methods

public Methods
public Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restore option default values.


public Methods

public Methods
public Legend
Methods
Method | Description
Assign | Assigns all options of one option object to another.
RestoreDefaults | Restores option default values.


public Properties

public Properties
public Legend
Properties
Property | Description
Version | The current version of options.


public Properties

public Properties
public Legend
Properties
Property | Description
ActualRowsetSize | Returns actual rowset size a command will use.


Legend

Legend
public
Legend
Property
Method
virtual


public Properties

public Properties
public Legend
Properties
Property | Description
StrsDivLen2 | Allows to overcome bugs in early dbExpress driver versions.


public Methods

public Methods
public Legend
Methods
Method | Description
Add | Appends new TADMapRule object to a collection.


public Properties

public Properties
public Legend
Properties
Property | Description
Items | Returns TADMapRule object by it index.


public Properties

public Properties
public Legend
Properties
Property | Description
ActualSilentMode | Returns actual silent mode a dataset will use.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
PreprocessCmdText | Controls SQL command text preprocessor.


public Methods

public Methods
public Legend
Methods
Method | Description
ClearChanged | Clears Changed flags.


public Properties

public Properties
public Legend
Properties
Property | Description
Changed | Returns the set of changed transaction options.


published Events

published Events
published Legend
Events
Event | Description
AfterClose | The event fires after command is closed.
AfterExecute | The event fires after command is executed.
AfterOpen | The event fires after command is opened.
AfterPrepare | The event fires after command is prepared.
AfterUnprepare | The event fires after command is unprepared.
BeforeClose | The event fires before command will be closed.
BeforeExecute | The event fires before command will be executed.
BeforeOpen | The event fires before command will be opened.
BeforePrepare | The event fires before command will be prepared.
BeforeUnprepare | The event fires before command will be unprepared.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.


Legend

Legend
published
Legend
Property
Event


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Gets or sets command active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
BaseObjectName | Identifies base object name for some of command kinds.
CatalogName | Identifies catalog name for some command kinds.
CommandKind | Identifies the command kind.
CommandText | The SQL command text to execute.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
FetchOptions | The set of options to control rows fetching.
FormatOptions | The set of options to control data representation.
Macros | The collection of macro substitution variables.
Overload | Oracle stored procedure overload index.
Params | The collection of parameters for a SQL command.
ResourceOptions | The set of options to control resources usage.
SchemaName | Identifies schema name for some of command kinds.
Transaction | Specifies a transaction object.
UpdateOptions | The set of options to control updates posting.


published Events

published Events
published Legend
Events
Event | Description
AfterCommit | Fires after transaction is committed.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.
OnError | Fires before FireDAC will raise exception.
OnLogin | Fires when an application connects to a DBMS.
OnLosted | Fires after FireDAC was not able to restore losted connection to DBMS.
OnRecover | Fires after FireDAC discovered that connection to DBMS is losted.
OnRestored | Fires after FireDAC successfully restored losted connection to DBMS.


Legend

Legend
published
Legend
Event
Property


published Properties

published Properties
published Legend
Properties
Property | Description
Connected | Gets / sets connection active status.
ConnectedStoredUsage | Controls how to use Connected property value saved to DFM.
ConnectionDefName | The name of connection definition to use.
ConnectionName | Specifies the name of the connection to associate with this connection object.
DriverName | Specifies the ID of the FireDAC driver for the connection.
FetchOptions | The set of default options to control rows fetching.
FormatOptions | The set of default options to control data representation.
LoginDialog | Gets / sets the reference to login dialog interface.
LoginPrompt | Specifies whether a login dialog appears immediately before opening a new connection.
Params | Lists database connection parameters for the FireDAC connection definition associated with the connection object.
ResourceOptions | The set of default options to control resources usage.
Transaction | The reference to TADCustomTransaction object.
TxOptions | The set of options to control transactions.
UpdateOptions | The set of default options to control data updating.
UpdateTransaction | The reference to TADCustomTransaction object, which will be used to post changes to DB.


published Events

published Events
published Legend
Events
Event | Description
OnAlert | The event fires, when a DBMS event is fired.
OnTimeout | The event fires, when a DBMS event is timed out.


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Controls the event registration state of the event alerter.
Connection | Specifies the connection component that actually forms the connection to the DBMS.
Names | Specifies the event names handled by this alerter.
Options | The set of even alerter options.


Legend

Legend
published
Legend
Property


published Properties

published Properties
published Legend
Properties
Property | Description
DataSet | Specifies a dataset reference for the Local SQL engine.
Name | Specifies alternative dataset name.
Temporary | Designates implicitly registered datasets.


published Events

published Events
published Legend
Events
Event | Description
AfterLoadConnectionDefFile | Fires after connection definitions file is loaded.
AfterShutdown | Fires after manager is finished.
AfterStartup | Fires after manager is started.
BeforeLoadConnectionDefFile | Fires before connection definitions file is loaded.
BeforeShutdown | Fires before manager will be finished.
BeforeStartup | Fires before manager will be started.


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Gets or sets FireDAC manager active status.
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
ConnectionDefFileAutoLoad | Controls how connection definitions file must be loaded.
ConnectionDefFileName | Gets / sets the name of a connection definitions file.
DriverDefFileAutoLoad | Controls how driver definitions file must be loaded.
DriverDefFileName | Gets / sets the name of a driver definitions file.
FetchOptions | The "root" fetch options.
FormatOptions | The "root" data format options.
ResourceOptions | The "root" resources control options.
SilentMode | Gets or sets FireDAC global "silent" flag.
UpdateOptions | The "root" data updating options.
WaitCursor | Gets or sets FireDAC wait cursor shape.


published Events

published Events
published Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


published Properties

published Properties
published Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Adapter | Add a short summary here...
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FormatOptions | The set of options to control data representation.
IndexDefs | Returns indexes definition for the dataset.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ResourceOptions | The set of options to control resources usage.
UpdateOptions | The set of options to control updates posting.


published Events

published Events
published Legend
Events
Event | Description
AfterClose | The event fires after command is closed.
AfterOpen | The event fires after command is opened.
BeforeClose | The event fires before command will be closed.
BeforeOpen | The event fires before command will be opened.
OnCommandChanged | The event fires after CommandText is changed.
OnError | The event fires when an error happens, while command is communicating with DBMS.


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Gets or sets command active status.
BaseObjectName | Gets / sets the name of base object.
CatalogName | Identifies catalog name for some command kinds.
Connection | Specifies the connection object.
ConnectionName | Specifies connection name.
FormatOptions | The set of options to control data representation.
MetaInfoKind | Gets / sets the kind of metadata to retrieve.
ObjectName | Gets / sets the name of object to get detailed information about it.
ObjectScopes | Gets / sets object scopes filter.
Overload | Oracle stored procedure overload index.
SchemaName | Identifies schema name for some of command kinds.
TableKinds | Gets / sets table kind filter.
Wildcard | Gets / sets objects filter by their name.


published Events

published Events
published Legend
Events
Event | Description
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.


published Properties

published Properties
published Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
BaseObjectName | Gets / sets the name of base object.
CatalogName | Specified the DBMS catalog name
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
FetchOptions | The set of options to control rows fetching.
FormatOptions | The set of options to control data representation.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
MetaInfoKind | Gets / sets the kind of metadata to retrieve.
ObjectName | Gets / sets the name of object to get detailed information about it.
ObjectScopes | Gets / sets object scopes filter.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Specified the DBMS schema name.
TableKinds | Gets / sets tables filter by their kinds.
Transaction | Gets / sets reference to transaction object.
UpdateTransaction | Gets / sets reference to transaction object.
Wildcard | Gets / sets objects filter by their name.


published Events

published Events
published Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnMasterSetValues | Fires after a detailed dataset has set detailed query parameters.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


published Properties

published Properties
published Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FormatOptions | The set of options to control data representation.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
Macros | The collection of macro substitution variables.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
Params | Contains the parameters for a SQL statement.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SQL | Contains the text of the SQL statement to execute for the query.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateTransaction | Gets / sets reference to transaction object.


published Events

published Events
published Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterExecute | Fires after SQL command execution is finished.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeExecute | Fires before SQL command execution is started.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


published Properties

published Properties
published Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the stored procedure names to the specified catalog.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FormatOptions | The set of options to control data representation.
Indexes | Lists all client indexes that apply to the dataset.
IndexesActive | Controls automatic maintenance of Index'es.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
Overload | Specifies which Oracle overloaded packaged stored procedure to execute.
PackageName | Limits the stored procedure names to the specified package name.
ParamBindMode | Determines the order in which a component’s parameters are assigned to the parameter list for SQL command on the DBMS.
Params | Contains the parameters for a SQL statement.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the stored procedure names to the specified schema.
StoredProcName | Identifies the name of the stored procedure on the server to call.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateTransaction | Gets / sets reference to transaction object.


published Events

published Events
published Legend
Events
Event | Description
AfterApplyUpdates | Fires after cached updates are applied to DB.
AfterGetRecord | Fires after fetching next rowset one time for each fetched record.
AfterGetRecords | Fires after fetching next rowset.
AfterRowRequest | Fires after fetching record.
BeforeApplyUpdates | Fires before cached updates are applied to DB.
BeforeGetRecords | Fires before fetching next rowset.
BeforeRowRequest | Fires before fetching record.
OnCommandChanged | Fires after the SQL property value is changed.
OnError | The event fires when an error happens, while dataset is communicating with DBMS.
OnExecuteError | The event is triggered when an error happens, while executing a Array DML query.
OnReconcileError | Fires when a dataset needs to reconcile an update to a record that cannot not be applied.
OnUpdateError | Fires if an exception is generated when updates are applied to a database.
OnUpdateRecord | Occurs when record update is applying to a database.


published Properties

published Properties
published Legend
Properties
Property | Description
ActiveStoredUsage | Controls how to use Active property value saved to DFM.
Aggregates | The collection of client side aggregates, defined for dataset.
AggregatesActive | Controls automatic calculation of aggregate values.
CachedUpdates | Specifies whether dataset will log changes to the data without immediate applying of them to the database.
CatalogName | Limits the table names to the catalog.
Connection | Specifies the FireDAC connection component to use.
ConnectionName | Specifies the FireDAC connection to use by its name.
Constraints | Specifies record-level client constraints that must be met when editing the data.
ConstraintsEnabled | Specifies whether the dataset perform constraint checking.
DetailFields | Gets / sets fields in detail dataset, used to establish a master-detail relationship with this dataset.
FetchOptions | The set of options to control rows fetching.
FilterChanges | Specifies what kinds of changed records must be "visible" in the dataset.
FormatOptions | The set of options to control data representation.
IndexFieldNames | Lists the field names to use as an index.
IndexName | Gets / sets the current index for the dataset by its name.
LocalSQL | The reference to a Local SQL engine.
MasterFields | Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.
MasterSource | Gets / sets a master data source, used to establish a master-detail relationship with this dataset.
ResourceOptions | The set of options to control resources usage.
SchemaAdapter | Gets or sets a reference to a schema adapter, as a Centralized Cached Updates log.
SchemaName | Limits the table names to the schema.
TableName | Gets / sets table name to open.
Transaction | Gets / sets reference to transaction object.
UpdateObject | Specifies the update object component used to post updates by dataset.
UpdateOptions | The set of options to control updates posting.
UpdateTransaction | Gets / sets reference to transaction object.


published Events

published Events
published Legend
Events
Event | Description
AfterCommit | Fires after transaction is committed. The AfterCommit event fires after the Commit method is executed and the transaction is committed. In case of a nested transaction in AfterCommit event handler the transaction is not yet finished, but nesting level is decremented.
AfterRollback | Fires after transaction is rolled back.
AfterStartTransaction | Fires after transaction is started.
BeforeCommit | Fires before transaction will be committed.
BeforeRollback | Fires before transaction will be rolled back.
BeforeStartTransaction | Fires before transaction will be started.


published Properties

published Properties
published Legend
Properties
Property | Description
Connection | Specifies the connection component that actually forms the connection to the DBMS.
Options | The set of options controlling transactions behaviour.


published Properties

published Properties
published Legend
Properties
Property | Description
Connection | Gets / sets the connection object.
ConnectionName | Gets / sets the connection name.
DeleteSQL | Specifies a SQL statement to use when applying a deletion of a record.
FetchRowSQL | Specifies a SQL statement to use to refetch a single record.
InsertSQL | Specifies a SQL statement to use when applying an insertion of a record.
LockSQL | Specifies the SQL statement to use when locking a record.
ModifySQL | Specifies the SQL statement to use when applying an update of a record.
UnlockSQL | Specifies the SQL statement to use when unlocking a record.


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Controls when aggregated value must be calculated.
Expression | Specifies the expression to be calculated.
GroupingLevel | Specifies the set of records in the group.
IndexName | Specifies the index name, for which aggregated value applies.
Name | Specifies the name of an aggregated value.


published Properties

published Properties
published Legend
Properties
Property | Description
AutoIncrementSeed | Specifies initial value for client side auto incrementing value.
AutoIncrementStep | Specifies incrementing step for client side auto incrementing value.
ClientAutoIncrement | Specifies when dataset need to generate auto incremental value for new record column.
GeneratorName | Specifies name of a sequence / generator to the field.
IdentityInsert | Enables to explicitly assign values to the auto incremental column.
ServerAutoIncrement | Specifies when DBMS generates auto incremental value for new record column.


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Controls when dataset view must be maintained.
CaseInsFields | Specifies fields for which sorting must be case-insensitive.
DescFields | Specifies fields for which sorting must be done in descending order.
Distinct | Controls returning of distinct view value.
Expression | Specifies expression which must be used to sort records.
Fields | Identifies the fields that comprise the index.
Filter | Specifies the text of a view filter.
FilterOptions | Specifies filtering options.
Name | Specifies the name of dataset view.
Options | Specifies sorting options.
Selected | Specifies, if a dataset view is the current dataset view.


published Events

published Events
published Legend
Events
Event | Description
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.


published Properties

published Properties
published Legend
Properties
Property | Description
Caption | The dialog caption.
HideDelay | Specifies a delay before dialog hiding.
Prompt | Specifies the dialog prompt.
ShowDelay | Specifies a delay before dialog showing.


published Properties

published Properties
published Legend
Properties
Property | Description
Provider | Specifies implementation kind.


published Properties

published Properties
published Legend
Properties
Property | Description
Caption | The dialog caption.
Enabled | Controls the dialog usage.
OnHide | Fires after the dialog will be hidden.
OnShow | Fires before the dialog will be displayed.
StayOnTop | Controls the position of dialog.


published Properties

published Properties
published Legend
Properties
Property | Description
Caption | The dialog caption.
ChangeExpiredPassword | Controls the user ability to change an expired password.
HistoryEnabled | Controls the login history storage.
HistoryKey | Specifies where to store login history.
HistoryStorage | Specifies what storage kind to use for the login history.
HistoryWithPassword | Controls should the login history contain the passwords or not.
LoginRetries | Specifies the number of unsuccessful login retries.
OnChangePassword | Fires when user password is expired.
OnLogin | Fires when user should provide database credentials.
VisibleItems | Specifies the visible login dialog fields.


published Properties

published Properties
published Legend
Properties
Property | Description
Caption | The dialog caption.
OnInput | Fires when a script executes ACCEPT command.
OnOutput | Fires when a script provides some feedback to a user.
OnPause | Fires when a script executes PAUSE command.
OnProgress | Fires when a script updates the job progress.
Options | Specifies the dialog options.


published Events

published Events
published Legend
Events
Event | Description
OnHide | Fires before the wait cursor will be hidden.
OnShow | Fires after the wait cursor will be shown.


published Properties

published Properties
published Legend
Properties
Property | Description
ScreenCursor | Specifies the cursor to use when FireDAC is busy.


published Events

published Events
published Legend
Events
Event | Description
AfterExecute | The event is fired after the execution is finished.
AfterScript | The event is fired after the script processing is finished.
BeforeExecute | The event is fired before the execution is started.
BeforeScript | The event is fired vefore the script processing is started.
OnConsoleGet | The event allows to an end-user to enter a value.
OnConsoleLockUpdate | The event allows to temporary lock an end-user interface.
OnConsolePut | The event allows to produce an end-user output.
OnError | The event fires, when an error happens, while script engine is communicating with DBMS.
OnGetText | The event fires, when a script engine needs a reference to a stream.
OnHostCommand | The event fires, when a script engine needs to execute external host OS command.
OnPause | The event fires, when a script engine needs to make a pause in script execution.
OnProgress | The event is firing, while a script engine is processing a script.
OnReleaseText | The event fires, when a script engine needs to release a reference to a stream.
OnSpoolPut | The event allows to produce a script execution trace output.


published Properties

published Properties
published Legend
Properties
Property | Description
Arguments | The script arguments.
Connection | Specifies a connection object.
FetchOptions | Fetch options for the SQL commands.
FormatOptions | Format options for the SQL commands.
Macros | The script macros.
Params | The parameters for the script SQL commands.
ResourceOptions | Resource options for the SQL commands.
ScriptDialog | A reference to a script feedback dialog.
ScriptOptions | The script control options.
SQLScriptFileName | The SQL script file name.
SQLScripts | The collection of the SQL scripts.
Transaction | Specifies a transaction object.


Legend

Legend
published
Legend
Property
Method
virtual


published Methods

published Methods
published Legend
Methods
Method | Description
Assign | Assigns a TADScriptOptions object to this object.
Reset | Reset this object property values to their default state.


published Properties

published Properties
published Legend
Properties
Property | Description
AutoPrintParams | Controls the output of the parameter values after a SQL command execution.
BreakOnError | Controls an action the script engine should take if an error has happened.
CharacterSet | Specifies the default connection character set.
ClientLib | Specifies the default connection client library.
ColumnHeadings | Controls output of the result set column headers.
CommandSeparator | Specifies the SQL command separator.
CommitEachNCommands | Specifies the number of SQL commands, after which a COMMIT must be performed.
ConsoleOutput | Controls the script engine output to a console.
DefaultDataPath | Specifies default path to the data files for the COPY command.
DefaultScriptPath | Specifies default path to the script files.
DriverID | Specifies the default connection driver ID.
DropNonexistObj | Controls the dropping of the nonexistent database objects.
EchoCommands | Specifies what parts of a SQL script must be echoed to console.
EchoCommandTrim | Controls the command echo output trimming.
FeedbackCommands | Controls the feedback output after each SQL command execution.
FeedbackScript | Controls the feedback output after each SQL script execution.
FileEncoding | Specifies the SQL script file encoding.
FileEndOfLine | Specifies the SQL script file end-of-line character sequence.
IgnoreError | Controls the script engine action on the errors.
LineSize | Specifies the maximum line width.
MacroExpand | Controls macro substitution for script engine.
MaxStringWidth | Specifies the maximum string field value size.
PageSize | Specifies the rowset page size.
ParamArraySize | Specifies the Array DML size.
RaisePLSQLErrors | Controls raising of exceptions after the PL/SQL compilation errors.
SpoolFileName | Specifies the spool file name.
SpoolOutput | Controls the spooling output mode.
SQLDialect | Specifies the SQL dialect for new Firebird or Interbase connections.
Timing | Controls the command performance feedback.
TrimConsole | Controls the right spaces trimming from the console output.
TrimSpool | Controls the right spaces trimming from the spool output.
Verify | Enables to show a complete SQL command text before execution.


published Properties

published Properties
published Legend
Properties
Property | Description
Name | The name of a script.
SQL | The SQL script.


published Properties

published Properties
published Legend
Properties
Property | Description
Host | The IP host address, where ADMonitor is running.
Port | The IP port, where ADMonitor is listening.
Timeout | ADMonitor connection timeout.
Tracing | Add a short summary here...


published Properties

published Properties
published Legend
Properties
Property | Description
BackupPath | Specifies the path to place the backup image in.
Options | Specifies the backup options.


published Properties

published Properties
published Legend
Properties
Property | Description
Exclude | Specifies the tables to exclude from backup or restore.
Include | Specifies the tables to include into backup or restore.
TableTypeMap | Specifies the table type to file extension mapping.


published Properties

published Properties
published Legend
Properties
Property | Description
DDPassword | Specify the data dictionary password.
DestinationPath | Path to restore the database to.
Options | Specifies the restore options.
SourcePassword | Source dictionary password.
SourcePath | Path to the existing backup image.


published Properties

published Properties
published Legend
Properties
Property | Description
Database | Specifies the connection path to the Advantage database.
DriverLink | Specifies the DriverLink.
Password | Specifies the SQL user password to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.


published Events

published Events
published Legend
Events
Event | Description
OnProgress | Fires after a table is processed.


published Properties

published Properties
published Legend
Properties
Property | Description
TablePassword | Specifies encryption password for free tables.
Tables | The list of tables to process.
TableType | Specifies a table type.


published Properties

published Properties
published Legend
Properties
Property | Description
DateFormat | Specifies the default driver date format.
Decimals | Specifies the default number of digits after decimal point.
DefaultPath | Specifies the default path for the free tables.
Epoch | Specifies the default epoch for dates with two year digits.
Exact | Specifies the default string comparison mode.
SearchPath | Specifies the search path for the free tables.
ShowDeleted | Specifies the deleted records visibility mode.


published Properties

published Properties
published Legend
Properties
Property | Description
CheckpointLogType | Control copying of checkpoint log.
ConnectParams | Specify connection parameters.
Flags | Specifies additional backup flags.
HotlogFilename | Specifies the file name for the live backup file.
OutputDir | Specifies the directory the backup files are copied to.
PageBlocksize | Specifies the maximum block size to be used to transfer pages from the database server to dbbackup.
StartLine | Specifies the start line.


published Properties

published Properties
published Legend
Properties
Property | Description
DriverLink | Specifies the DriverLink.
OnProgress | Specifies the event handler allowing to communicate with the DB server.


published Properties

published Properties
published Legend
Properties
Property | Description
ConnectParams | Specify connection parameters.
Flags | Specifies additional validate flags.
StartLine | Specifies the start line.
Tables | Specifies the table or materialized view list to validate.
ValidateType | Specifies the database validation mode.


published Properties

published Properties
published Legend
Properties
Property | Description
ToolLib | Specifies the path to the DBTOOLn.DLL.


published Properties

published Properties
published Legend
Properties
Property | Description
BackupFiles | Specifies the backup files.
Database | Specifies a database file to backup.
Options | Specifies backup options.
Verbose | Controls the DB Service Manager feedback.


published Properties

published Properties
published Legend
Properties
Property | Description
BackupFile | Specifies a backup file.
Database | Specifies a database file to backup.
Level | Specifies the backup level.
Options | Specifies backup options.


published Properties

published Properties
published Legend
Properties
Property | Description
BackupFiles | Specifies the backup files.
Database | Specifies a database file to restore.
Options | Specifies restore options.


published Properties

published Properties
published Legend
Properties
Property | Description
BackupFiles | Specifies the backup files.
Database | Specifies a database file to restore.
Options | Specifies restore options.
PageSize | Specifies the page size for a restored database.
Verbose | Controls the DB Service Manager feedback.


published Properties

published Properties
published Legend
Properties
Property | Description
AFirstName | A person first name.
AGroupID | A person group ID.
AGroupName | A person group name.
ALastName | A person last name.
AMiddleName | A person middle name.
APassword | A person password.
ARoleName | A person role name.
AUserID | A person ID.
AUserName | A person SQL user name.
Modified | A list of modified user attributes.


published Events

published Events
published Legend
Events
Event | Description
OnProgress | Specifies the event handler allowing to handle the DB server feedback.


published Properties

published Properties
published Legend
Properties
Property | Description
DriverLink | Specifies the DriverLink.
Host | Specifies the host name with the DB server.
Password | Specifies the SQL user password to connect to the DB server.
Protocol | Specifies the protocol used to connect to the DB server.
QueryTimeout | Add a short summary here...
SqlRoleName | Specifies the SQL role name to connect to the DB server.
UserName | Specifies the SQL user name to connect to the DB server.


published Properties

published Properties
published Legend
Properties
Property | Description
Config | Specifies the trace session configuration.
SessionID | The trace session ID.
SessionName | The trace session name.


published Properties

published Properties
published Legend
Properties
Property | Description
Database | Specifies a database file to validate / repair.
Options | Specifies validate / repair options.


published Events

published Events
published Legend
Events
Event | Description
OnDriverCreated | The event firing after the driver has been created and the CLI library was loaded.
OnDriverDestroying | The event firing before the driver will be destroyed and the CLI library will be unloaded.


Legend

Legend
published
Legend
Property
read only
Event


published Properties

published Properties
published Legend
Properties
Property | Description
BaseDriverID | The base driver ID.
DriverID | Specifies the virtual driver ID.
VendorHome | The CLI library installation folder.
VendorLib | The CLI library path and name.


published Events

published Events
published Legend
Events
Event | Description
AfterExecute | The event firing after the service action will be executed.
BeforeExecute | The event firing before the service action will be executed.
OnError | The event firing in case an exception will be raised by a service.


Legend

Legend
published
Legend
Event


published Properties

published Properties
published Legend
Properties
Property | Description
Database | A database file name.
DBVersion | The database format version.
DestDatabase | A destination database file name.
DriverLink | Specifies the DriverLink.
Encrypted | The database encryption mode.
Password | The database password.
ResetPassword | Whether or not to reset the database password.
SortOrder | The database sort order.


published Properties

published Properties
published Legend
Properties
Property | Description
EmbeddedArgs | Specifies the MySQL Embedded server arguments.
EmbeddedGroups | Specifies the MySQL Embedded server argument groups.


published Properties

published Properties
published Legend
Properties
Property | Description
ODBCAdvanced | The ODBC driver common parameters.
ODBCDriver | The ODBC driver name.


published Properties

published Properties
published Legend
Properties
Property | Description
NLSLang | Allows to specify the NLS_LANG environment variable value.
Threaded | Allows to specify OCI multi-threaded initialization mode.
TNSAdmin | Allows to specify the TNS_ADMIN environment variable value.


published Events

published Events
published Legend
Events
Event | Description
OnProgress | The event firing after each copying step.


published Properties

published Properties
published Legend
Properties
Property | Description
BusyTimeout | Controls the timeout of waiting for a locks to be released.
Catalog | The name of source attached database.
Database | A source database file name.
DestCatalog | The name of destination attached database.
DestDatabase | A destination database file name.
DestMode | The destination database open mode.
DestPassword | The password for destination database.
PagesPerStep | Number of pages per single copy step.
Password | The password for source database.
WaitForLocks | Controls the waiting for a locks to be released.


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Activates and registers a collation.
CollationKind | The collation implementation kind.
CollationName | The unique collation name.
Flags | The scCompareString collation kind collation flags.
Locale | The scCompareString collation kind collation.
OnCompare | The scCustomXxx compare strings event.


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Activates and registers a function.
Aggregated | Controls the function mode.
ArgumentsCount | The number of formal arguments the function is awaiting.
FunctionName | The unique function name.
OnCalculate | The calculate function event.


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Activates and registers a RTree.
OnCalculate | The RTree match event.
RTreeName | The unique RTree module name.


published Properties

published Properties
published Legend
Properties
Property | Description
Database | A database file name.
Options | The encryption options.
Password | The database password.
ToPassword | The database password change to.


published Properties

published Properties
published Legend
Properties
Property | Description
DriverLink | Specifies the DriverLink.


published Events

published Events
published Legend
Events
Event | Description
OnProgress | Specifies the event handler allowing to handle the SQLite feedback.


published Properties

published Properties
published Legend
Properties
Property | Description
Database | Specifies a database file to validate.
MaxErrors | Specifies the maximum number of errors.
Options | Specifies validate options.
Password | Specifies a password to database to validate.


published Events

published Events
published Legend
Events
Event | Description
OnGetDataSet | The event firing when Local SQL engine looks for a dataset object.
OnReadDataSet | The event firing when Local SQL is going to read a dataset object.


published Properties

published Properties
published Legend
Properties
Property | Description
Active | Activates Local SQL engine.
Connection | Specifies the FireDAC connection component to use.
DataSets | Collection of the registered datasets.
DisableControls | Controls dataset DisableControls / EnableControls calls.
IncludeHiddenFields | Controls inclusion of invisible and hidden fields into Local SQL result sets.
MultipleCursors | Controls dataset cloning and copying.
SchemaName | Set schema name for datasets.


published Properties

published Properties
published Legend
Properties
Property | Description
PersistentFileName | Specifies persistent dataset file name.


published Properties

published Properties
published Legend
Properties
Property | Description
AutoIncFields | Specifies dataset fields, which are auto-incrementing by DBMS.
KeyFields | Specifies dataset primary key fields.
UpdateTableName | Specifies table name to use in SQL commands posting updates.


published Properties

published Properties
published Legend
Properties
Property | Description
AutoRegister | Controls the automatic registration of the events at a DBMS.
Kind | Specifies the event alerter kind.
Synchronize | Controls the thread, where the alerter event handlers will be executed.
Timeout | Specifies the event alerter timeout.


published Properties

published Properties
published Legend
Properties
Property | Description
AssignedValues | Specifies the set of changed options.
AutoClose | Controls automatic closing of a dataset cursor after fetching the last record.
AutoFetchAll | Controls automatic fetching of all records from a dataset cursor before disconnecting a command.
Cache | Controls what kind of data to cache in memory.
CursorKind | Specifies type of cursor an FireDAC command or dataset uses.
DetailCascade | Controls propagation of a master dataset changes to a detail dataset in Centralized Cached Updates mode.
DetailDelay | Controls the delay between master dataset scroll and detail dataset refresh.
DetailOptimize | Specifies to refresh detail dataset only when master record is changed.
Items | Controls what kind of data to fetch.
LiveWindowFastFirst | Controls the TADTable live data window fetch optimization mode.
LiveWindowParanoic | Controls the TADTable live data window mode records search mode.
Mode | Controls how to fetch data.
RecordCountMode | Controls how to count records in a result set.
RecsMax | Controls the maximum number of records to be fetched.
RecsSkip | Controls the offset of the first record to be fetched.
RowsetSize | Controls the number of records per single fetch.
Unidirectional | Specifies possible directions of navigation by dataset records.


published Properties

published Properties
published Legend
Properties
Property | Description
AssignedValues | Specifies the set of changed options.
DataSnapCompatibility | Controls the compatibility with the DataSnap / MIDAS.
DefaultParamDataType | Specifies default data type for parameters with ftUnknown data type.
FmtDisplayDate | Specifies display format for ftDate fields.
FmtDisplayDateTime | Specifies display format for ftDateDate, ftTimeStamp fields.
FmtDisplayNumeric | Specifies display format for numeric fields.
FmtDisplayTime | Specifies display format for ftTime fields.
FmtEditNumeric | Specifies edit format for numeric fields.
InlineDataSize | Controls how character or byte string values are stored in record buffer.
MapRules | Controls data type mapping.
MaxBcdPrecision | Controls recognition of numeric values as FmtBCD ones, depending on precision.
MaxBcdScale | Controls recognition of numeric values as FmtBCD ones, depending on scale.
MaxStringSize | Controls recognition of string values as BLOB ones.
OwnMapRules | Controls usage of MapRules property.
QuoteIdentifiers | Specifies whether or not to explicitly surround identifiers with quotes.
Round2Scale | Controls values rounding.
SortLocale | Specifies a locale ID for the local sorting operations.
SortOptions | Specifies the default sort options for the local sorting operations.
StrsEmpty2Null | Controls conversion of zero-length string values to NULL value.
StrsTrim | Controls removing of trailing spaces from string values.
StrsTrim2Len | Controls trimming string values to the declared length.


published Properties

published Properties
published Legend
Properties
Property | Description
NameMask | Specifies column name mask.
PrecMax | Specifies maximal numeric precision.
PrecMin | Specifies minimal numeric precision.
ScaleMax | Specifies maximal numeric scale.
ScaleMin | Specifies minimal numeric scale.
SizeMax | Specifies maximal string size.
SizeMin | Specifies minimal string size.
SourceDataType | Specifies a source data type.
TargetDataType | Specifies a target data type.


published Properties

published Properties
published Legend
Properties
Property | Description
ArrayDMLSize | Limits the maximum possible Array DML array size.
AssignedValues | Specifies the set of changed options.
Backup | Controls backup of data file for persistent datasets.
CmdExecMode | Controls DBMS action execution mode.
CmdExecTimeout | Controls DBMS action execution timeout.
DefaultParamType | Specifies default parameter direction.
DirectExecute | Controls preparation of SQL statements.
EscapeExpand | Controls processing of escape sequences.
MacroCreate | Controls automatic filling of Macros collection.
MacroExpand | Controls expansion of macros.
ParamCreate | Controls automatic filling of Params collection.
ParamExpand | Controls expansion of parameters.
Persistent | Controls dataset persistence.
SilentMode | Controls dataset GUI feedback.
StoreItems | Specifies the data to write into the persistent dataset data files or streams.
StoreVersion | Specifies the format version for the persistent dataset data files or streams.
UnifyParams | Controls unification of a stored procedure parameters.


Legend

Legend
published
Legend
Property
write only


published Properties

published Properties
published Legend
Properties
Property | Description
AutoConnect | Controls automatic management of connection Active state.
AutoReconnect | Controls automatic connection recovery.
BackupExt | Specifies persistent dataset backup copy extension.
BackupFolder | Specifies persistent dataset backup copy folder.
DefaultStoreExt | Specifies default extension for persistent dataset data files.
DefaultStoreFolder | Specifies the default folder for the persistent dataset data files.
DefaultStoreFormat | Specifies the default format for the persistent dataset data files.
KeepConnection | Specifies whether an application remains connected to a database even if no datasets are open.
MaxCursors | Controls maximum allowed number of active commands.
ServerOutput | Controls accessibility of the server side messages.
ServerOutputSize | Controls the size of Oracle message output buffer.


Properties

Legend
Legend
Property
write only


published Properties

published Properties
published Legend
Properties
Property | Description
AutoCommit | Controls the automatic completion of transaction.
AutoStart | Controls automatic start of a transaction.
AutoStop | Controls automatic finishing of a transaction.
DisconnectAction | Specifies an action FireDAC should take on closing connection.
EnableNested | Controls nested transactions.
Isolation | Specifies the transaction isolation level for the transactions managed by FireDAC.
Params | Specifies custom DBMS transaction parameters.
ReadOnly | Specifies whether the transaction is read-only.
StopOptions | Specifies automatic transaction stoping options.


published Properties

published Properties
published Legend
Properties
Property | Description
AssignedValues | Specifies the set of changed options.
CheckReadOnly | Controls checking of TField.ReadOnly property.
CheckRequired | Controls checking of TField.Required property.
CheckUpdatable | Controls ability to change a TField value.
CountUpdatedRecords | Controls checking of an updated record count.
EnableDelete | Allows to delete records from dataset.
EnableInsert | Allows to insert records into dataset.
EnableUpdate | Allows to edit records of dataset.
FastUpdates | Controls fast vs secure updates.
FetchGeneratorsPoint | Controls the moment, when next generator value will be fetched.
GeneratorName | Specifies the generator name from which to fetch next value for auto-increment fields.
LockMode | Controls how the FireDAC locks database record while editing it.
LockPoint | Controls the moment, when database record will be locked.
LockWait | Controls waiting for pessimistic lock to be acquired.
ReadOnly | Specifies whether the dataset is read-only.
RefreshDelete | Specifies should a dataset delete a record locally when a database record is not found at refreshing.
RefreshMode | Specifies how dataset should refresh record after posting update to it.
RequestLive | Provided for BDE compatibility.
UpdateChangedFields | Controls which fields to include into UPDATE or INSERT command.
UpdateMode | Controls how the FireDAC locates records when posting updates.
UpdateNonBaseFields | Controls should fields from the joined non-base table to be included into UPDATE or INSERT command.


Structs, Records, Enums Enumerations

Structs, Records, Enums Enumerations
Structs, Records, Enums Legend
Enumerations
Enumeration | Description
TADActionRequest | The enumerated type lists all possible FireDAC requests to a database.
TADAutoFetchAll | Add a short summary here...


Enumerations

Legend
Legend
Enumeration


Legend

Legend
Structs, Records, Enums
Legend
Enumeration


See Also

See Also
ADAdministrator
See Also

ADExecutor, ADExplorer, Database Connectivity


See Also

See Also
ADDFMChanger
See Also

Migrating BDE applications


See Also

See Also
ADExecutor
See Also

ADExplorer, Database Connectivity, Demo Databases, Executing SQL Scripts, SQL Script Control Commands


See Also

See Also
ADExplorer
See Also

ADExecutor, ADAdministrator, Database Connectivity, Defining Connection


See Also

See Also
ADMonitor
See Also

Tracing and Monitoring


Topics

Topics
Architecture
Topics
Topic | Description
General | FireDAC has flexible, powerful and extendable architecture.
Components | FireDAC includes 50+ Delphi non-visual components.
Databases | FireDAC supports wide range of DBMS.
Programming Tools | FireDAC supports wide range of programming tools.
Class Hierarchy | FireDAC has well designed and structured class hierarchy.


Example 1

Example 1
Array DML

Array DML with IADPhysCommand:

var
  oCmd: IADPhysCommand;
……
  with oCmd do begin
    CommandText := 'insert into Customers (ID, Name) values (:ID, :Name)';
    // Set up parameter types
    Params[0].DataType := ftInteger;
    Params[1].DataType := ftString;
    Params[1].Size := 40;
    // Set up parameters' array size
    Params.ArraySize := 10000;
    // Set parameter values
    for i := 0 to 10000 - 1 do begin
      Params[0].AsIntegers[i] := i;
      Params[1].AsStrings[i] := 'Somebody ' + IntToStr(i);
    end;
    // Execute batch
    Execute(10000, 0);
  end;


Example 2

Example 2
Array DML

Array DML with TADQuery and error handling:

procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AException: EADDBEngineException; var AAction: TADErrorAction);
begin
  case AException.Errors[0].Kind of
  ekPKViolated:
    begin
      // fix ID to be unique
      ADQuery.Params[0].AsIntegers[AException.Errors[0].RowIndex] := AException.Errors[0].RowIndex;
      AAction := eaRetry;
    end;
  ekFKViolated:
    // if Region with RegionID is not found, then just skip row
    AAction := eaSkip;
  else
    AAction := eaFail;
  end;
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  with ADQuery1 do begin
    SQL.Text := 'insert into Customers (ID, RegionID, Name, Note) values (:ID, :RegionID, :Name, :Note)';
    // Set up parameter types
    Params[0].DataType := ftInteger;
    Params[1].DataType := ftInteger;
    Params[2].DataType := ftString;
    Params[2].Size := 40;
    Params[3].DataSize := ftMemo;
    // Set up parameters' array size
    Params.ArraySize := 10000;
    // Set parameter values
    for i := 0 to 10000 - 1 do begin
      if i mod 100 = 0 then
        // force PK violation
        Params[0].AsIntegers[i] := i - 1
      else
        Params[0].AsIntegers[i] := i;
      Params[1].AsIntegers[i] := GetRegionIdForCustomer(i);
      Params[2].AsStrings[i] := 'Somebody ' + IntToStr(i);
      Params[3].Clear(i);
    end;
    // Execute batch
    Execute(10000, 0);
  end;
end;


See Also

See Also
Array DML
See Also

Command Batches


See Also

See Also
Auto-Incremental Fields
See Also

Unique Identifying Fields, Update Command Generation, Caching Updates, FetchGeneratorsPoint, GeneratorName, AutoIncFields, TADAutoIncField


See Also

See Also
Browsing Table
See Also

Object Names, Executing Command, TADTable, TADFetchOptions


Example

Example
Caching Updates

See the demos for more details:

- FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates

- FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord

- FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\Centralized


See Also

See Also
Caching Updates
See Also

Update Command Generation, Overriding Posting Updates


See Also

See Also
Calculated and Aggregated Fields
See Also

Sorting Records, Filtering Records, Writing Expressions


See Also

See Also
Changing DataSet Data
See Also

Unique Identifying Fields, Update Command Generation, Overriding Posting Updates


See Also

See Also
Command Batches
See Also

Array DML


See Also

See Also
Common connection parameters
See Also

Working with Metadata, Defining Connection, Multi Threading, Tracing and Monitoring


See Also

See Also
Compile (tool name).bat
See Also

Programming Tools


See Also

See Also
Components
See Also

Class Hierarchy


See Also

See Also
Configuring Drivers
See Also

FireDAC Database Connectivity, FireDAC FAQ


See Also

See Also
Connect to Advantage Database Server
See Also

Common connection parameters, uADPhysADS Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to Blackfish SQL Server
See Also

Common connection parameters, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to DataSnap server
See Also

Common connection parameters, uADPhysDataSnap Namespace, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to dbExpress data source
See Also

Common connection parameters, uADPhysTDBX Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions, [image] Programming with dbExpress 4


See Also

See Also
Connect to IBM DB2 Server
See Also

Common connection parameters, uADPhysDB2 Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to Interbase or Firebird
See Also

Common connection parameters, uADPhysIB Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to Microsoft Access database
See Also

Common connection parameters, uADPhysMSAcc Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to Microsoft SQL Server Compact Edition
See Also

Common connection parameters, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to Microsoft SQL Server
See Also

Common connection parameters, uADPhysMSSQL Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to MySQL Server
See Also

Common connection parameters, uADPhysMySQL Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to ODBC data source
See Also

Common connection parameters, uADPhysODBC Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to Oracle Server
See Also

Using Oracle with FireDAC, Common connection parameters, uADPhysOracle Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to PostgreSQL
See Also

Common connection parameters, uADPhysPG Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to SQLite database
See Also

Using SQLite with FireDAC, Common connection parameters, uADPhysSQLite Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Connect to Sybase SQL Anywhere
See Also

Common connection parameters, uADPhysASA Namespace, FAQs, How to configure FireDAC Drivers, How to manage FireDAC Connection Definitions


See Also

See Also
Create (DB name).bat
See Also

ADExecutor, ADExplorer, Demo Databases, Database Connectivity


Example

Example
Creating Reports with FastReport

AddOn\FastReportX\Example folder contains a pre-configured sample that can be used to get started with FastReport and FireDAC.


Example

Example
Data Type Mapping

To define mapping rules for sample above, use code:

with ADConnection1.FormatOptions do begin
  OwnMapRules := True;
  with MapRules.Add do begin
    ScaleMin := 0;
    ScaleMax := 0;
    PrecMin := 0;
    PrecMax := 2;
    SourceDataType := dtBcd;
    TargetDataType := dtSByte;
  end;
  with MapRules.Add do begin
    ScaleMin := 0;
    ScaleMax := 0;
    PrecMin := 3;
    PrecMax := 4;
    SourceDataType := dtBcd;
    TargetDataType := dtInt16;
  end;
  with MapRules.Add do begin
    ScaleMin := 0;
    ScaleMax := 0;
    PrecMin := 5;
    PrecMax := 8;
    SourceDataType := dtBcd;
    TargetDataType := dtInt32;
  end;
  with MapRules.Add do begin
    ScaleMin := 4;
    ScaleMax := 4;
    PrecMin := 18;
    PrecMax := 18;
    SourceDataType := dtBcd;
    TargetDataType := dtCurrency;
  end;
end;


Example

Example
Database Alerts

See FireDAC demo FireDAC\Samples\Comp Layer\TADEventAlerter\Main.


See Also

See Also
Database Alerts
See Also

TADEventAlerter, TADEventAlerterOptions, Multi Threading


Topics

Topics
Database Connectivity
Topics
Topic | Description
Common connection parameters | Describes the connection definition parameters common for all FireDAC drivers.
Connect to Advantage Database Server | Describes how to connect to Advantage Database Server.
Connect to Blackfish SQL Server | Describes how to connect to Embarcadero Blackfish SQL Server.
Connect to DataSnap server | Describes how to connect to Multi-Tier DataSnap servers.
Connect to dbExpress data source | Describes how to connect to dbExpress data source.
Connect to IBM DB2 Server | Describes how to connect to IBM DB2 Server.
Connect to Interbase or Firebird | Describes how to connect to Firebird or Embarcadero Interbase Server's.
Connect to Microsoft SQL Server | Describes how to connect to Microsoft SQL Server.
Connect to Microsoft SQL Server Compact Edition | Describes how to connect to Microsoft SQL Server Compact Edition .
Connect to Microsoft Access database | Describes how to connect to Microsoft Access database files.
Connect to MySQL Server | Describes how to connect to MySQL Server.
Connect to ODBC data source | Describes how to connect to ODBC data source.
Connect to Oracle Server | Describes how to connect to Oracle Server.
Connect to PostgreSQL | Describes how to connect to PostgreSQL.
Connect to SQLite database | Describes how to connect to SQLite database files.
Connect to Sybase SQL Anywhere | Describes how to connect to Sybase SQL Anywhere.


See Also

See Also
Databases
See Also

FireDAC Architecture, Configuring Drivers, Defining Connection, Demo Databases, Working with DBMS


Example

Example
DBMS Environment Reports

<FireDAC>\Samples\Comp Layer\TADConnection\InfoReport


See Also

See Also
DBMS Environment Reports
See Also

Tracing and Monitoring, TADConnection, ADExplorer


Topics

Topics
Debugging
Topics
Topic | Description
DBMS Environment Reports | This article guides you through different FireDAC options of DBMS environment checking and reporting. Such report kind is a must for your customer support and the developer team.
Tracing and Monitoring | This article shows how to use FireDAC tracing and monitoring capabilities, which allows to see how an application is communicating with a database and is main FireDAC application debugging tool.


See Also

See Also
Defining Connection
See Also

ADAdministrator utility, ADExplorer utility, FireDAC Database Connectivity , Multi Threading


See Also

See Also
Delpoying on Mac OS X or Linux
See Also

Defining Connection, Configuring Drivers, Database Connectivity


See Also

See Also
Delpoying on Windows
See Also

Defining Connection, Configuring Drivers, Database Connectivity, ADAdministrator


See Also

See Also
Demo Applications
See Also

ADExecutor, ADExplorer, Demo Databases


See Also

See Also
Demo Databases
See Also

Database Connectivity, Defining Connection, ADExplorer, Create (DB name).bat


Topics

Topics
Deploying
Topics
Topic | Description
Delpoying on Windows | FireDAC application deployment on a x86 or x64 Windows machine includes several optional steps.
Delpoying on Mac OS X or Linux | FireDAC application deployment on a Mac OS X or a Linux machine includes several optional steps.


See Also

See Also
Developing Custom Commands
See Also

Executing SQL Scripts, TADScript, TADScriptCommand


Example

Example
DLL Development

For example see the FireDAC\Samples\Comp Layer\TADConnection\DLL_Sharing demo.


See Also

See Also
DLL Development
See Also

TADCustomConnection.CliHandle, TADCustomConnection.SharedCliHandle


Topics

Topics
Editing the Data
Topics
Topic | Description
Changing DataSet Data | FireDAC supports dataset records editing, including automatic updates posting to a database.
Caching Updates | FireDAC supports deferred updates posting, so called Cached Updates.
Unique Identifying Fields | FireDAC uses unique identifying columns for generating the efficient update and refresh SQL commands.
Auto-Incremental Fields | FireDAC supports correct appending of the new records with auto-incrementing fields and automatic refreshing of the database assigned values.
Update Command Generation | FireDAC will automatically generate SQL commands to post changes from a dataset to a database, using the obtained meta information for the columns and update table.
Overriding Posting Updates | FireDAC allows to selectively override the automatically generated update SQL commands by using TADUpdateSQL or completely override the posting algorithm by using OnUpdateRecord event handler.
Specifying Default Values | FireDAC allows to specify default field values for new records.


See Also

See Also
Establishing Connection
See Also

Handling Errors, Defining Connection, Offlining Connection, TADCustomConnection Class, TADGUIxLoginDialog Class


See Also

See Also
Executing Command
See Also

Executing Stored Procedure, Browsing Table, Command Batches, Asynchronous Execution, Local SQL, TADQuery Class


See Also

See Also
Executing SQL Scripts
See Also

TADScript, ADExecutor, SQL Script Control Commands, Developing Custom Commands


Topics

Topics
Executing SQL Scripts
Topics
Topic | Description
SQL Script Control Commands | TADScript and ADExecutor utility support extended list of the SQL script execution control commands.
Developing Custom Commands | TADScript allows to extend the set of SQL script control execution commands.


See Also

See Also
Executing Stored Procedure
See Also

Executing Command, Command Batches, Asynchronous Execution, TADStoredProc Class


See Also

See Also
Extended Metadata
See Also

Overriding Posting Updates, Auto-Incremental Fields, Database Connectivity


Topics

Topics
FAQ
Topics
Topic | Description
Installation | The list of questions and answers related to FireDAC installation.
General Questions | The list of general questions and answers.
TADManager and TADConnection Questions | The list of questions and answers related to TADManager and TADConnection.
TADQuery, TADStoredProc and TADUpdateSQL Questions | The list of questions and answers related to TADQuery, TADStoredProc and TADUpdateSQL.
TADTable Questions | The list of questions and answers related to TADTable.
TADMemTable Questions | The list of questions and answers related to TADMemTable.
Fetching and Populating Questions | The list of questions and answers related to fetching records and populating datasets.
Sorting, Searching, Locating, Filtering Questions | The list of questions and answers related to sorting, searching, locating, filtering datasets.
Editing Questions | The list of questions and answers related to data editing.
GUI Questions | The list of questions and answers related to the FireDAC GUI.
SQL Scripts Questions | The list of questions and answers related to the SQL Script execution.
Metadata Questions | The list of questions and answers related to the metadata retrieval.
Debugging and Reporting Environment Questions | The list of questions and answers related to the debugging and reporting environment.
Integration with 3d Party Products Questions | The list of questions and answers related to integration with 3d party products.
Firebird and Interbase Servers Questions | The list of questions and answers related to Firebird and Interbase Servers.
MS SQL Server Questions | The list of questions and answers related to MS SQL Server.
Oracle Server Questions | The list of questions and answers related to Oracle Server.
SQLite Database Questions | The list of questions and answers related to SQLite Database.
MySQL Server Questions | The list of questions and answers related to MySQL Server.
MS Access Questions | The list of questions and answers related to MS Access.


See Also

See Also
Fetching Rows
See Also

Executing Command, Executing Stored Procedure, Command Batches, Update Command Generation


Example

Example
Filtering Records

See the following demos for additional details:

  • FireDAC\Samples\Comp Layer\TADQuery\Filter
  • FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail


See Also

See Also
Filtering Records
See Also

Writing Expressions, Sorting Records, Finding a Record, Calculated and Aggregated Fields, Master-Detail Relationship, Browsing Table


See Also

See Also
Finding a Record
See Also

Writing Expressions, Sorting Records, Filtering Records, Calculated and Aggregated Fields, Master-Detail Relationship, Browsing Table


Topics

Topics
Getting Started
Topics
Topic | Description
First Steps to use FireDAC | This article guides you through the creation of your first application built using the Delphi edition of FireDAC.
Setting up Connections | This article guides you through the process of defining an FireDAC database connection definition. In this article we will create the connection definition for the Microsoft SQL Server Northwind demo database.
Very High Performance using the Array DML | This article describes the power of the Array DML feature supported by FireDAC. This first article will lead you through an easy example that shows how to insert thousands of records per second by writing just a few lines of code.
Creating Reports with FastReport | This article guides you through the creation of your first report built with FastReport and FireDAC.
Demo Databases | Describes how to install FireDAC demo databases.
Demo Applications | Describes how to use FireDAC demo applications.


See Also

See Also
Handling Errors
See Also

Recovering Connection , Executing Command , uADStanError Namespace , TADCustomConnection.OnError , TADAdaptedDataSet.OnError Event


See Also

See Also
Installing FireDAC
See Also

Lazarus / FPC


See Also

See Also
Installing on Linux
See Also

Configuring Drivers, Defining Connection, Database Connectivity


See Also

See Also
Installing on Windows
See Also

Configuring Drivers, Defining Connection, Database Connectivity


See Also

See Also
Known Limitations
See Also

Installing FireDAC, Using FireDAC


Topics

Topics
Lazarus / FPC
Topics
Topic | Description
Installing on Windows | Describes the steps to install Lazarus, FPC and FireDAC on Windows.
Installing on Linux | Describes the steps to install Lazarus, FPC and FireDAC on Linux.


Example 1

Example 1
Local SQL

Heterogeneous query using SQL Anywhere and Oracle tables and FireDAC TADQuery's:

// setup connection and query to "Orders" table in SQL Anywhere DB
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;
ADQuery1.Connection := ADConnection1;
ADQuery1.SQL.Text := 'select * from Orders';
// link dataset to Local SQL engine
ADQuery1.LocalSQL := ADLocalSQL1;

// setup connection and query to "Order Details" table in Oracle DB
ADConnection2.ConnectionDefName := 'Oracle_Demo';
ADConnection2.Connected := True;
ADQuery2.Connection := ADConnection2;
ADQuery2.SQL.Text := 'select * from "Order Details"';
// link dataset to Local SQL engine
ADQuery2.LocalSQL := ADLocalSQL1;

// setup SQLite in-memory connection
ADConnection3.DriverName := 'SQLite';
ADConnection3.Connected := True;
// link Local SQL to SQLite connection
ADLocalSQL1.Connection := ADConnection3;
ADLocalSQL1.Active := True;

// execute SELECT query on above datasets
ADQuery3.Connection := ADConnection3;
ADQuery3.SQL.Text := 'SELECT * FROM ADQuery1 LEFT JOIN ADQuery2 ON ADQuery1.OrderID = ADQuery2.OrderID';
ADQuery3.Active := True;


Example 2

Example 2
Local SQL

Heterogeneous query using ADO TADOQuery's and FireDAC TADQuery's:

// setup connection and query to "Orders" table
ADOQuery1.SQL.Text := 'select * from Orders';
// link dataset to Local SQL engine
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADOQuery1;
  Name := 'Orders';
end;

// setup connection and query to "Order Details" table
ADOQuery2.SQL.Text := 'select * from "Order Details"';
// link dataset to Local SQL engine
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADOQuery2;
  Name := 'Order Details';
end;

// setup SQLite in-memory connection
ADConnection1.DriverName := 'SQLite';
ADConnection1.Connected := True;
// link Local SQL to SQLite connection
ADLocalSQL1.Connection := ADConnection1;
ADLocalSQL1.Active := True;

// execute SELECT query on above datasets
ADQuery1.Connection := ADConnection1;
ADQuery1.SQL.Text := 'SELECT * FROM Orders o LEFT JOIN "Order Details" od ON o.OrderID = od.OrderID';
ADQuery1.Active := True;


Example 3

Example 3
Local SQL

See demos:

- Cross DBMS query - FireDAC\Samples\Comp Layer\TADLocalSQL\xDBMS

- In-memory database - FireDAC\Samples\Comp Layer\TADLocalSQL\InMemDB


See Also

See Also
Local SQL
See Also

Using SQLite with FireDAC, Executing Command, TADLocalSQL


See Also

See Also
Managing Transactions
See Also

TADCustomConnection, TADCustomTransaction, Executing Command


Example

Example
Master-Detail Relationship

See the following demos for additional details:

  • FireDAC\Samples\Comp Layer\TADQuery\MasterDetail;
  • FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail.


See Also

See Also
Master-Detail Relationship
See Also

Sorting Records, Filtering Records, Browsing Table, Caching Updates


See Also

See Also
Metadata Structure
See Also

Querying Metadata


Topics

Topics
Migrating BDE applications
Topics
Topic | Description
BDE name counterparts | Most of BDE high-level types and components have counterparts in FireDAC.
BDE aliases migration | FireDAC has the BDE aliases migration function.
BDE application migration | An step-by-step example showing how to migrate BDE application to FireDAC.
Additional migration hints | Few additional BDE application migration considerations.


Example

Example
Multi Threading

For example see the FireDAC\Samples\Comp Layer\TADConnection\Pooling demo.


See Also

See Also
Multi Threading
See Also

Configuring Drivers, Defining Connection, Establishing Connection


See Also

See Also
Object Names
See Also

Executing Stored Procedure, Browsing Table, Common connection parameters


See Also

See Also
Offlining Connection
See Also

TADCustomConnection Class, Establishing Connection, Recovering Connection


See Also

See Also
Overriding Posting Updates
See Also

Update Command Generation, TADUpdateSQL, OnUpdateRecord


See Also

See Also
Preprocessing Command Text
See Also

Object Names


Topics

Topics
Preprocessing Command Text
Topics
Topic | Description
Character macro functions | List of the functions working with character strings.
Numeric macro functions | List of the functions working with numbers.
Date and time macro functions | List of the functions working with date and time.
System macro functions | List of the special functions.
Convert macro function | Describes the CONVERT function.
RETURNING unified support | FireDAC supports the Firebird, Oracle and PostgreSQL RETURNING phrase.


See Also

See Also
Querying Metadata
See Also

Metadata Structure, Unique Identifying Fields, TADConnection, TADMetaInfoQuery


See Also

See Also
Recovering Connection
See Also

TADCustomConnection Class, Establishing Connection, Offlining Connection


Example 1

Example 1
Setting Options

The mapping of data types from the DBMS types to the client types defined in FormatOptions is inherited by all Commands from their Connection.

with oConnection.Options.FormatOptions do begin
  OwnMapRules := True;
  MapRules.Clear;
  with MapRules.Add do begin
    PrecMax := 19;
    PrecMin := 4;
    SourceDataType := dtFmtBCD;
    TargetDataType := dtCurrency;
  end;
end;


Example 2

Example 2
Setting Options

A Data Warehouse application may setup high-speed fetching mode, using FetchOptions of the Manager level. So, all connection and all their commands will inherit these options.

with ADManager.FetchOptions do begin
  Items := [];
  Cache := [];
  RowsetSize := 1000;
end;


See Also

See Also
Setting Options
See Also

Data Type Mapping, uADStanOptions


Topics

Topics
Setting Options
Topics
Topic | Description
Data Type Mapping | FireDAC offers flexible adjustable data type mapping system, allowing to simplify migration to FireDAC or optimize data representation.


Example

Example
Sorting Records

For additional details see demos:

  • FireDAC\Samples\Comp Layer\TADQuery\Indices
  • FireDAC\Samples\Comp Layer\TADMemTable\Main


See Also

See Also
Sorting Records
See Also

Writing Expressions, Filtering Records, Finding a Record, Calculated and Aggregated Fields, Master-Detail Relationship, Browsing Table


See Also

See Also
Specifying Default Values
See Also

Writing Expressions, Calculated and Aggregated Fields


See Also

See Also
SQL Script Control Commands
See Also

Executing SQL Scripts, ADExecutor, TADScript, TADScriptOptions,


See Also

See Also
Programming Tools
See Also

How to recompile FireDAC packages


Symbol Reference

Symbol Reference
Symbol Reference
Symbol Reference | Description
uADCompClient | Contains core data access components, including TADConnection, TADQuery, TADStoredProc, TADMemTable, etc.
uADCompDataSet | Contains TADDataSet base dataset class and additional utility methods and classes.
uADCompGUIx | Contains most of the UI components, including TADGUIxAsyncExecuteDialog, TADGUIxErrorDialog, TADGUIxLoginDialog, TADGUIxScriptDialog and TADGUIxWaitCursor classes.
uADCompScript | Contains TADScript scripting engine class and additional utility methods and classes.
uADMoniRemoteClient | Contains TADMoniRemoteClientLink class.
uADPhysADS | Contains Advantage Database Server driver and service components.
uADPhysASA | Contains Sybase SQL Anywhere driver and services components.
uADPhysDataSnap | Contains Multi-Tier DataSnap driver for RAD Studio XE2 Enterprise and higher.
uADPhysDB2 | Contains IBM DB2 driver and services components.
uADPhysDBExp | Contains dbExpress v 1-3 bridge driver.
uADPhysIB | Contains Firebird and Interbase driver and services components.
uADPhysManager | Contains FireDAC driver and services base classes.
uADPhysMSAcc | Contains Microsoft Access driver and services components.
uADPhysMSSQL | Contains Microsoft SQL Server driver and services components.
uADPhysMySQL | Contains MySQL Server driver and services components.
uADPhysODBC | Contains ODBC bridge driver.
uADPhysODBCBase | Contains FireDAC driver and services base classes for all ODBC based drivers.
uADPhysOracle | Contains Oracle Database driver and services components.
uADPhysPG | Contains PostgreSQL driver and services components.
uADPhysSQLite | Contains SQLite driver and services components.
uADPhysSQLiteVDataSet | Contains SQLite based Local SQL engine.
uADPhysTDBX | Contains dbExpress v 4 bridge driver.
uADPhysTDBXBase | Contains FireDAC driver base classes for all TDBX based drivers.
uADStanError | Contains error classes - EADException, EADDBEngineException, etc
uADStanOption | Contains option classes - TADFetchOptions, TADUpdateOptions, etc.


Topics

Topics
Topics
Topic | Description
Overview | FireDAC is an unique set of Universal Data Access Components for developing database applications on Delphi, C++Builder and FreePascal. With its powerful common architecture FireDAC enables native high-speed direct access from Delphi to Interbase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, IBM DB2, SQL Anywhere, Access, Firebird, Informix and more.
Getting Started | A set of articles introducing FireDAC to you.
Architecture | A set of articles describing FireDAC architecture, including the components set, supported DBMS, supported tools.
Working with Connections | A set of articles describing how to setup DB drivers and manage database connections with FireDAC.
Working with Commands | A set of articles describing how to execute SQL commands with FireDAC, exchange data and metadata.
Working with DataSets | A set of articles describing how to work with FireDAC dataset classes, including how to edit the dataset content.
Editing the Data | A set of articles describing how to use FireDAC to edit the dataset data, post changes to a database and setup the updates posting.
Working with Metadata | The set of articles describing how to work with database meta data in FireDAC. The metadata contains information about database structure.
Working with DBMS | A set of articles describing how to work with a specific database from an FireDAC application.
x Platform Development | The set of articles describing how to use FireDAC for cross-platform development for Linux, Mac OS X and other environments.
Migrating BDE applications | This article guides you through a series of the steps to migrate the BDE application to the FireDAC.
Debugging | A set of articles explaining how to debug FireDAC application.
Deploying | A set of articles explaining how to deploy a FireDAC application.
Utilities | The list of the FireDAC utilities, their usage details and command line parameters. FireDAC utilities are located in FireDAC\Bin folder.
Database Connectivity | The list of the DBMS's supported by FireDAC and corresponding connection definition parameters.
FAQ | The list of FireDAC related frequently asked questions.


See Also

See Also
Tracing and Monitoring
See Also

DBMS Environment Reports


Example

Example
uADCompClient.ADManager Function
var
  oList: TStringList;
......
  oList := TStringList.Create;
  oList.Add('Server=127.0.0.1');
  oList.Add('Database=addemo');
  ADManager.AddConnectionDef('myconn', 'MySQL', oList);


See Also

See Also
uADCompClient.ADManager Function
See Also

Multi Threading, TADCustomManager


Example

Example
uADCompClient.ADSetConnectionClass Function
ADSetConnectionClass(TMyConnection);


See Also

See Also
uADCompClient.ADSetConnectionClass Function
See Also

TADCustomConnection, TADCustomConnection.ConnectionName


Example

Example
uADCompClient.ADSetManagerClass Function
ADSetManagerClass(TMyManager);


See Also

See Also
uADCompClient.ADSetManagerClass Function
See Also

TADCustomManager, ADManager


See Also

See Also
uADCompClient Namespace
See Also

uADCompDataSet, uADCompScript


uADCompClient Namespace Classes

uADCompClient Namespace Classes
uADCompClient Namespace Legend
Classes
Class | Description
TADAdaptedDataSet | The TADAdaptedDataSet class uses data adapter to execute DBMS queries, open DBMS cursors, fetch rows and post changes back to DBMS.
TADCommand | The class is responsible for execution of SQL commands.
TADConnection | The class is responsible to connection establishment with a DBMS.
TADCustomCommand | The base class is responsible for execution of SQL commands.
TADCustomConnection | The class is responsible to connection establishment with a DBMS.
TADCustomEventAlerter | The class is responsible for handling the database event notifications.
TADCustomLocalSQL | The base class for the Local SQL engine.
TADCustomManager | The class is responsible to connection definitions and connections management.
TADCustomMemTable | The class implementing in-memory dataset.
TADCustomQuery | The class implementing dataset, capable to execute SQL queries.
TADCustomSchemaAdapter | The class implementing Centralized Cached Updates support.
TADCustomStoredProc | The class implementing dataset, capable to execute server side stored procedures.
TADCustomTransaction | The class is responsible for connection transaction management.
TADCustomUpdateObject | The base class for update objects used to override updates posting.
TADEventAlerter | The class is responsible for handling the database event notifications.
TADLocalSQLDataSet | TADLocalSQLDataSet represents a dataset registered with Local SQL engine.
TADLocalSQLDataSets | TADLocalSQLDataSets is a collection of TADLocalSQLDataSet objects.
TADManager | The class is responsible to connection definitions and connections management.
TADMemTable | The class implementing in-memory dataset.
TADMetaInfoCommand | The class is responsible for execution of meta-data commands.
TADMetaInfoQuery | The class implementing dataset, capable to execute meta-info queries.
TADQuery | The class implementing dataset, capable to execute SQL queries.
TADRdbmsDataSet | The TADRdbmsDataSet class includes everything, required by descendants to execute SQL commands.
TADSchemaAdapter | The class implementing Centralized Cached Updates support.
TADStoredProc | The class implementing dataset, capable to execute server side stored procedures.
TADTable | The class implementing dataset, working with single database table.
TADTransaction | The class is responsible for connection transaction management.
TADUpdateSQL | TADUpdateSQL applies updates on behalf of queries or stored procedures that can't post updates directly.


Classes (AutoDoc Folder)

Legend
Legend
Class


uADCompClient Namespace Functions

uADCompClient Namespace Functions
uADCompClient Namespace Legend
Functions
Function | Description
ADManager | Function returns reference to global TADCustomManager object.
ADSetConnectionClass | Sets the TADCustomConnection descendant class.
ADSetManagerClass | Set the TADCustomManager descendant class.


Functions (AutoDoc Folder)

Legend
Legend
Method


Legend

Legend
uADCompClient Namespace
Legend
Class
Method


Topics

Topics
uADCompClient Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Functions | The following table lists functions in this documentation.


Example

Example
TADAdaptedDataSet.AbortJob Method
ADQuery1.ResourceOptions.CmdExecMode := amAsync;
ADQuery1.Open('select OrderID, count(*) from "Order Details" group by OrderID');
ADQuery1.AbortJob(True);


See Also

See Also
TADAdaptedDataSet.AbortJob Method
See Also

Asynchronous Execution, TADResourceOptions.CmdExecMode, TADResourceOptions.CmdExecTimeout, Disconnect, TADCustomConnection.AbortJob


Example

Example
TADAdaptedDataSet.Adapter Property

See FireDAC\Samples\Comp Layer\TADMemTable\IncFetching_MSSQL sample for details of how to use TADMemTable with table adapter.

See FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail sample for details of how to work with master-detail relation.


See Also

See Also
TADAdaptedDataSet.Adapter Property
See Also

TADCustomTableAdapter


Example

Example
TADAdaptedDataSet.AttachTable Method
ADMemTable1.AttachTable(oTab, nil) ;
ADMemTable1.Open;


See Also

See Also
TADAdaptedDataSet.AttachTable Method
See Also

TADMemTable


See Also

See Also
TADAdaptedDataSet.Command Property
See Also

TADCustomCommand


See Also

See Also
TADAdaptedDataSet.DatSManager Property
See Also

TADDatSManager, TADDatSTable


Example

Example
TADAdaptedDataSet.Disconnect Method
ADQuery1.Disconnect(True);
// is equivalent to:
// ADQuery1.AbortJob(True);
// ADQuery1.Close;
// ADQuery1.Unprepare;


See Also

See Also
TADAdaptedDataSet.Disconnect Method
See Also

AbortJob


See Also

See Also
TADAdaptedDataSet.GetResults Method
See Also

Executing Command, Executing Stored Procedure


See Also

See Also
TADAdaptedDataSet.LocalSQL Property
See Also

Local SQL, TADLocalSQL, TADMemTable


Example 1

Example 1
TADAdaptedDataSet.NextRecordSet Method
ADQuery1.FetchOptions.AutoClose := False;
ADQuery1.SQL.Text := 'select 1 as i; select ''qwe'' as s';
ADQuery1.Open;
ShowMessage(ADQuery1.Fields[0].FieldName + ' ' + ADQuery1.Fields[0].AsString); // output "i 1"
ADQuery1.NextRecordSet;
ShowMessage(ADQuery1.Fields[0].FieldName + ' ' + ADQuery1.Fields[0].AsString); // output "s qwe"
ADQuery1.Close;


Example 2

Example 2
TADAdaptedDataSet.NextRecordSet Method

See FireDAC\Samples\Comp Layer\TADStoredProc\Oracl_NextRecordSet demo for details of how to work with Oracle stored procedure, returning multiple REF CURSOR's.


See Also

See Also
TADAdaptedDataSet.NextRecordSet Method
See Also

Executing Command, Command Batches, TADFetchOptions.AutoClose, TDataSet.Open, TDataSet.Close


Example

Example
TADAdaptedDataSet.OnError Event

See FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\BatchErrorHandling demo for details.


See Also

See Also
TADAdaptedDataSet.OnError Event
See Also

TADDataSet.Execute, TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, OnExecuteError, OnUpdateError


Example

Example
TADAdaptedDataSet.OnExecuteError Event
procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AError: EADDBEngineException; var AAction: TADErrorAction);
begin
  if AException.Errors[0].Kind = ekUKViolated then
    AAction := eaSkip
  else
    AAction := eaFail;
end;


See Also

See Also
TADAdaptedDataSet.OnExecuteError Event
See Also

Array DML, EADDBEngineException, TADErrorAction, TADDataSet.Execute


See Also

See Also
TADAdaptedDataSet.PointedConnection Property
See Also

TADRdbmsDataSet.Connection, TADRdbmsDataSet.ConnectionName, TADCustomConnection


Example

Example
TADAdaptedDataSet.ServerDeleteAll Method
ADQuery1.SQL.Text := 'select * from {id MyTab}';
ADQuery1.ServerDeleteAll(True);


See Also

See Also
TADAdaptedDataSet.ServerDeleteAll Method
See Also

ExecSQL


See Also

See Also
TADAdaptedDataSet Class
See Also

TADDataSet, uADStanOption


Example 1

Example 1
TADAdaptedDataSet.UpdateObject Property
ADUpdateSQL1.InsertSQL.Text := 'insert into mytab values (:new_id, :new_name)';
ADQuery1.UpdateObject := ADUpdateSQL1;
ADQuery1.Append;
ADQuery1['id'] := 100;
ADQuery1['name'] := 'qwe';
ADQuery1.Post;


Example 2

Example 2
TADAdaptedDataSet.UpdateObject Property

Demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.


See Also

See Also
TADAdaptedDataSet.UpdateObject Property
See Also

OnUpdateRecord, TADUpdateSQL


Example

Example
TADCommand.Active Property
ADCommand1.CommandText.Text := 'select * from "Orders"';
ADCommand1.Active := True;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ....
finally
  oTab.Free;
end;


See Also

See Also
TADCommand.Active Property
See Also

Fetch, Define, Open, Close, CloseAll, State


See Also

See Also
TADCommand.ActiveStoredUsage Property
See Also

Active


See Also

See Also
TADCommand.AfterClose Event
See Also

BeforeClose, Close, Active


Example

Example
TADCommand.AfterExecute Event
procedure TForm1.ADCommand1AfterExecute(ASender: TObject);
begin
  if ADCommand1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADCommand1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADCommand1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADCommand1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADCommand1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADCommand1.RowsAffected]);
    end;
end;


See Also

See Also
TADCommand.AfterExecute Event
See Also

BeforeExecute, Execute


See Also

See Also
TADCommand.AfterOpen Event
See Also

BeforeOpen, Open, Active


See Also

See Also
TADCommand.AfterPrepare Event
See Also

BeforePrepare, Prepare


See Also

See Also
TADCommand.AfterUnprepare Event
See Also

BeforeUnprepare, Unprepare


Example

Example
TADCommand.BaseObjectName Property
ADCommand1.BaseObjectName := 'MY_PACK';
ADCommand1.CommandText.Text := 'PROC1';
// or just ADCommand1.CommandText.Text := 'MY_PACK.PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Codegear Delphi';
ADCommand1.Execute;


See Also

See Also
TADCommand.BaseObjectName Property
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind


See Also

See Also
TADCommand.BeforeClose Event
See Also

AfterClose, Close, Active


See Also

See Also
TADCommand.BeforeExecute Event
See Also

AfterExecute, Execute


See Also

See Also
TADCommand.BeforeOpen Event
See Also

AfterOpen, Open, Active


See Also

See Also
TADCommand.BeforePrepare Event
See Also

AfterPrepare, Prepare


See Also

See Also
TADCommand.BeforeUnprepare Event
See Also

BeforePrepare, Unprepare


Example 1

Example 1
TADCommand.CatalogName Property
ADCommand1.CatalogName := 'MY_APP';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;


Example 2

Example 2
TADCommand.CatalogName Property
ADMetaInfoCommand1.CatalogName := 'MY_APP';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on SQL Server just ADMetaInfoCommand1.ObjectName := 'MY_APP..MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;


See Also

See Also
TADCommand.CatalogName Property
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName


Example 1

Example 1
TADCommand.CommandKind Property
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'MY_PROC';
ADCommand1.Prepare;


Example 2

Example 2
TADCommand.CommandKind Property
ADCommand1.CommandText.Text := 'ALTER PROCEDURE MY_PROC COMPILE';
case ADCommand1.CommandKind of
skAlter: ShowMessage('Alter command');
..........
else     ShowMessage('Other command');
end;


See Also

See Also
TADCommand.CommandKind Property
See Also

CommandText


Example 1

Example 1
TADCommand.CommandText Property

Stored procedure:

ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'MY_PROC';
ADCommand1.Prepare;
ADCommand1.Params[0].AsString := 'qwe';
ADCommand1.Execute;


Example 2

Example 2
TADCommand.CommandText Property

General SQL command:

ADCommand1.CommandText.Text := 'insert into MyTab values (:p1)';
ADCommand1.Params[0].AsString := 'qwe';
ADCommand1.Execute;


Example 3

Example 3
TADCommand.CommandText Property

Adding long command:

with ADCommand1.CommandText do begin
  BeginUpdate;
  Add('............');
  ......
  Add('............');
  EndUpdate;
end;


See Also

See Also
TADCommand.CommandText Property
See Also

Preprocessing Command Text, Executing Command, TADResourceOptions.ParamCreate, TADResourceOptions.MacroCreate,TADResourceOptions.PreprocessCmdText, CommandKind, Params, Macros, ResourceOptions


See Also

See Also
TADCommand.Connection Property
See Also

ConnectionName, Prepare


See Also

See Also
TADCommand.ConnectionName Property
See Also

Connection, Prepare


See Also

See Also
TADCommand.FetchOptions Property
See Also

Setting Options, TADFetchOptions, Fetch


See Also

See Also
TADCommand.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Fetch, Params


Example 1

Example 1
TADCommand.Macros Property

Substitute table name:

ADCommand1.CommandText.Text := 'select * from &Tab';
ADCommand1.Macros[0].AsIdentifier := 'Order Details';
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from "Order Details"


Example 2

Example 2
TADCommand.Macros Property

Substitute WHERE condition:

ADCommand1.CommandText.Text := 'select * from MyTab {if !cond} where !cond {fi}';
ADCommand1.Macros[0].AsString := 'ID > 100';
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from MyTab where ID > 100
ADCommand1.Macros[0].Clear;
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from MyTab


Example 3

Example 3
TADCommand.Macros Property

See FireDAC\Samples\Comp Layer\TADQuery\Macros demo for details.


See Also

See Also
TADCommand.Macros Property
See Also

Executing Command, Preprocessing Command Text, CommandText, Params, Prepare, TADMacros, TADResourceOptions.MacroCreate, TADResourceOptions.MacroExpand


Example

Example
TADCommand.OnCommandChanged Event
procedure TForm1.ADCommand1CommandChanged(ASender: TObject);
begin
  if ADCommand1.FindParam('ID') <> nil then
    ADCommand1.FindParams('ID').AsInteger := 100;
end;


See Also

See Also
TADCommand.OnCommandChanged Event
See Also

CommandText


Example 1

Example 1
TADCommand.OnError Event

Handling Array DML errors:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;


Example 2

Example 2
TADCommand.OnError Event

Error substitution:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;


See Also

See Also
TADCommand.OnError Event
See Also

Handling Errors, Array DML, Open, Execute, Prepare, Fetch, EADDBArrayExecuteError class, EADDBEngineException class


Example

Example
TADCommand.Overload Property
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'DBMS_SQL.PARSE';
ADCommand1.Overload := 1;


See Also

See Also
TADCommand.Overload Property
See Also

CommandText, CommandKind


See Also

See Also
TADCommand.Params Property
See Also

Executing Command, CommandText, Macros, Prepare, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items


See Also

See Also
TADCommand.ResourceOptions Property
See Also

Setting Options, TADBottomResourceOptions


Example 1

Example 1
TADCommand.SchemaName Property
ADCommand1.SchemaName := 'SCOTT';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;


Example 2

Example 2
TADCommand.SchemaName Property
ADMetaInfoCommand1.SchemaName := 'ADDEMO';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on Oracle just ADMetaInfoCommand1.ObjectName := 'ADDEMO.MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;


See Also

See Also
TADCommand.SchemaName Property
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName


See Also

See Also
TADCommand Class
See Also

Executing Command, Executing Stored Procedure, TADCustomCommand, TADCustomQuery, TADCustomStoredProc


See Also

See Also
TADCommand.Transaction Property
See Also

Managing Transactions, TADTransaction, TADCustomConnection.Transaction


See Also

See Also
TADCommand.UpdateOptions Property
See Also

Setting Options, TADBottomUpdateOptions


See Also

See Also
TADConnection.AfterCommit Event
See Also

BeforeCommit


See Also

See Also
TADConnection.AfterRollback Event
See Also

BeforeRollback


See Also

See Also
TADConnection.AfterStartTransaction Event
See Also

BeforeStartTransaction


See Also

See Also
TADConnection.BeforeCommit Event
See Also

AfterCommit


See Also

See Also
TADConnection.BeforeRollback Event
See Also

AfterRollback


See Also

See Also
TADConnection.BeforeStartTransaction Event
See Also

AfterStartTransaction


Example 1

Example 1
TADConnection.Connected Property
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;


Example 2

Example 2
TADConnection.Connected Property

See FireDAC\Samples\Comp Layer\TADConnection\Pooling sample for details of how to work with pooled connections.


See Also

See Also
TADConnection.Connected Property
See Also

TCustomConnection.BeforeConnect, TCustomConnection.AfterConnect, TCustomConnection.BeforeDisconnect, TCustomConnection.AfterDisconnect, ConnectionDefName, DriverName, Params, Offlined, OnRecover


See Also

See Also
TADConnection.ConnectedStoredUsage Property
See Also

Connected


Example 1

Example 1
TADConnection.ConnectionDefName Property
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;


Example 2

Example 2
TADConnection.ConnectionDefName Property

See demo FireDAC\Samples\Comp Layer\TADConnection\ConnectionDefs for details how to create and use connection definitions.


Example 3

Example 3
TADConnection.ConnectionDefName Property

Specifying pooled connection:

var
  oList: TStringList;
  ......
  oList := TStringList.Create;
  oList.Add('Server=MyServer');
  oList.Add('Database=Northwind');
  oList.Add('User_Name=sa');
  oList.Add('Password=');
  oList.Add('Pooled=True');
  ADManager.AddConnectionDef('myconn', 'MSSQL', oList);
  ......
  ADConnection1.ConnectionDefName := 'myconn';
  ADConnection1.Connected := True;


See Also

See Also
TADConnection.ConnectionDefName Property
See Also

Defining Connection, TADCustomManager


Example

Example
TADConnection.ConnectionName Property
ADConnection1.ConnectionName := 'TestConn';
ADConnection1.DriverName := 'Oracl';'
ADConnection1.Params.Add('Database=testdb');
....
ADQuery1.ConnectionName := 'TestConn';
ADQuery1.Open('select * from test_tab');


See Also

See Also
TADConnection.ConnectionName Property
See Also

ConnectionDefName, DriverName, Params, TADCustomCommand.ConnectionName, TADRDBMSDataSet.ConnectionName


Example

Example
TADConnection.DriverName Property
ADConnection1.DriverName := 'Oracl';'
ADConnection1.Params.Add('Database=testdb');
....
ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select * from test_tab');


See Also

See Also
TADConnection.DriverName Property
See Also

Params, ConnectionDefName


See Also

See Also
TADConnection.FetchOptions Property
See Also

Setting Options, TADFetchOptions, ADManager


See Also

See Also
TADConnection.FormatOptions Property
See Also

Setting Options, TADFormatOptions, ADManager


Example

Example
TADConnection.LoginDialog Property

Using private login dialog:

ADGUIxLoginDialog1.Caption := 'Welcome to the Northwind DB';
ADGUIxLoginDialog1.VisibleItems.Add('User_name');
ADGUIxLoginDialog1.VisibleItems.Add('Password');
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.LoginPrompt := True;
ADConnection1.Connected := True;


See Also

See Also
TADConnection.LoginDialog Property
See Also

Establishing Connection, TADGUIxLoginDialog, LoginPrompt, SharedCliHandle, ADGUIxSilent


Example 1

Example 1
TADConnection.LoginPrompt Property

Using login dialog:

ADGUIxLoginDialog1.Caption := 'Welcome to the Northwind DB';
ADGUIxLoginDialog1.VisibleItems.Add('User_name');
ADGUIxLoginDialog1.VisibleItems.Add('Password');
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.LoginPrompt := True;
ADConnection1.Connected := True;


Example 2

Example 2
TADConnection.LoginPrompt Property

Connecting without login dialog:

procedure TForm1.ADConnection1Login(AConnection: TADCustomConnection; const AConnectionDef: IADStanConnectionDef);
begin
  AConnectionDef.UserName := 'dba';
  AConnectionDef.Password := 'sql';
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  ADConnection1.OnLogin := ADConnection1Login;
  ADConnection1.LoginPrompt := True;
  ADConnection1.Connected := True;
end;


See Also

See Also
TADConnection.LoginPrompt Property
See Also

Establishing Connection, OnLogin, LoginDialog, Params, SharedCliHandle, ADGUIxSilent, AfterConnect


Example

Example
TADConnection.OnError Event
procedure TForm1.ADConnection1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if (AException is EADDBEngineException) and (EADDBEngineException(AException).Kind = ekUKViolated) then begin
    AException.Free;
    AException := Exception.Create('You must enter unique document number !');
  end;
end;


See Also

See Also
TADConnection.OnError Event
See Also

Handling Errors, EADDBEngineException


Example

Example
TADConnection.OnLogin Event

Connecting without login dialog:

procedure TForm1.ADConnection1Login(AConnection: TADCustomConnection; const AConnectionDef: IADStanConnectionDef);
begin
  AConnectionDef.UserName := 'dba';
  AConnectionDef.Password := InputBox('Login', 'Please enter DBA password', 'sql');
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  ADConnection1.OnLogin := ADConnection1Login;
  ADConnection1.LoginPrompt := True;
  ADConnection1.Connected := True;
end;


See Also

See Also
TADConnection.OnLogin Event
See Also

Establishing Connection, LoginPrompt, Connected, IADStanConnectionDef


See Also

See Also
TADConnection.OnLosted Event
See Also

Recovering Connection, OnRecover, OnRestored


See Also

See Also
TADConnection.OnRecover Event
See Also

Recovering Connection, OnLosted, OnRestored, TADTopResourceOptions.AutoReconnect, Connected, Offlined


See Also

See Also
TADConnection.OnRestored Event
See Also

Recovering Connection, OnLosted, OnRecover


Example

Example
TADConnection.Params Property
with ADConnection1.Params do begin
  Clear;
  Add('DriverID=Ora');
  Add('Database=ORA_920_APP');
  Add('User_Name=ADDemo');
  Add('Password=a');
end;
ADConnection1.Connected := True;


See Also

See Also
TADConnection.Params Property
See Also

Defining Connection, ConnectionDefName, DriverName, OnLogin


See Also

See Also
TADConnection.ResourceOptions Property
See Also

Setting Options, TADTopResourceOptions, ADManager


See Also

See Also
TADConnection Class
See Also

Working with Connections, Managing Transactions, TADCustomConnection


See Also

See Also
TADConnection.Transaction Property
See Also

UpdateTransaction, TADCustomTransaction


Example

Example
TADConnection.TxOptions Property

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.


See Also

See Also
TADConnection.TxOptions Property
See Also

Transaction, TADTxOptions


See Also

See Also
TADConnection.UpdateOptions Property
See Also

Setting Options, TADUpdateOptions, ADManager


See Also

See Also
TADConnection.UpdateTransaction Property
See Also

Transaction, TADCustomTransaction


Example

Example
TADCustomCommand.AbortJob Method
ADCommand1.ResourceOptions.CmdExecMode := amAsync;
ADCommand1.Prepare('select OrderID, count(*) from "Order Details" group by OrderID');
ADCommand1.Open;
ADCommand1.AbortJob(True);


See Also

See Also
TADCustomCommand.AbortJob Method
See Also

Asynchronous Execution


See Also

See Also
TADCustomCommand.AcquireConnection Method
See Also

ReleaseConnection, Connection, ConnectionName


Example

Example
TADCustomCommand.Active Property
ADCommand1.CommandText.Text := 'select * from "Orders"';
ADCommand1.Active := True;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ....
finally
  oTab.Free;
end;


See Also

See Also
TADCustomCommand.Active Property
See Also

Fetch, Define, Open, Close, CloseAll, State


See Also

See Also
TADCustomCommand.ActiveStoredUsage Property
See Also

Active


See Also

See Also
TADCustomCommand.AfterClose Event
See Also

BeforeClose, Close, Active


Example

Example
TADCustomCommand.AfterExecute Event
procedure TForm1.ADCommand1AfterExecute(ASender: TObject);
begin
  if ADCommand1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADCommand1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADCommand1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADCommand1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADCommand1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADCommand1.RowsAffected]);
    end;
end;


See Also

See Also
TADCustomCommand.AfterExecute Event
See Also

BeforeExecute, Execute


Example

Example
TADCustomCommand.AfterFetch Event
procedure TForm1.ADCommand1AfterFetch(ASender: TObject);
begin
  StatusBar1.SimpleText := Format('%d rows fetched', [ADCommand1.RowsAffected]);
end;


See Also

See Also
TADCustomCommand.AfterFetch Event
See Also

BeforeFetch, Fetch


See Also

See Also
TADCustomCommand.AfterOpen Event
See Also

BeforeOpen, Open, Active


See Also

See Also
TADCustomCommand.AfterPrepare Event
See Also

BeforePrepare, Prepare


See Also

See Also
TADCustomCommand.AfterUnprepare Event
See Also

BeforeUnprepare, Unprepare


Example

Example
TADCustomCommand.BaseObjectName Property
ADCommand1.BaseObjectName := 'MY_PACK';
ADCommand1.CommandText.Text := 'PROC1';
// or just ADCommand1.CommandText.Text := 'MY_PACK.PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Codegear Delphi';
ADCommand1.Execute;


See Also

See Also
TADCustomCommand.BaseObjectName Property
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind


See Also

See Also
TADCustomCommand.BeforeClose Event
See Also

AfterClose, Close, Active


See Also

See Also
TADCustomCommand.BeforeExecute Event
See Also

AfterExecute, Execute


See Also

See Also
TADCustomCommand.BeforeFetch Event
See Also

AfterFetch, Fetch


See Also

See Also
TADCustomCommand.BeforeOpen Event
See Also

AfterOpen, Open, Active


See Also

See Also
TADCustomCommand.BeforePrepare Event
See Also

AfterPrepare, Prepare


See Also

See Also
TADCustomCommand.BeforeUnprepare Event
See Also

BeforePrepare, Unprepare


See Also

See Also
TADCustomCommand.BindedBy Property
See Also

Connection, ConnectionName


Example 1

Example 1
TADCustomCommand.CatalogName Property
ADCommand1.CatalogName := 'MY_APP';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;


Example 2

Example 2
TADCustomCommand.CatalogName Property
ADMetaInfoCommand1.CatalogName := 'MY_APP';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on SQL Server just ADMetaInfoCommand1.ObjectName := 'MY_APP..MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;


See Also

See Also
TADCustomCommand.CatalogName Property
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName


Example

Example
TADCustomCommand.Close Method
var
  oTab: TADDatSTable;
....
  ADCommand1.Prepare('select * from "Orders"');
  oTab := ADCommand1.Define;
  try
    ADCommand1.Fetch(oTab);
  finally
    ADCommand1.Close;
    oTab.Free;
  end;


See Also

See Also
TADCustomCommand.Close Method
See Also

Open, Active, CloseAll, NextRecordSet, BeforeClose, AfterClose


See Also

See Also
TADCustomCommand.CloseAll Method
See Also

Open, Active, Close, NextRecordSet, BeforeClose, AfterClose


See Also

See Also
TADCustomCommand.CommandIntf Property
See Also

IADPhysCommand


Example 1

Example 1
TADCustomCommand.CommandKind Property
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'MY_PROC';
ADCommand1.Prepare;


Example 2

Example 2
TADCustomCommand.CommandKind Property
ADCommand1.CommandText.Text := 'ALTER PROCEDURE MY_PROC COMPILE';
case ADCommand1.CommandKind of
skAlter: ShowMessage('Alter command');
..........
else     ShowMessage('Other command');
end;


See Also

See Also
TADCustomCommand.CommandKind Property
See Also

CommandText


Example 1

Example 1
TADCustomCommand.CommandText Property

Stored procedure:

ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'MY_PROC';
ADCommand1.Prepare;
ADCommand1.Params[0].AsString := 'qwe';
ADCommand1.Execute;


Example 2

Example 2
TADCustomCommand.CommandText Property

General SQL command:

ADCommand1.CommandText.Text := 'insert into MyTab values (:p1)';
ADCommand1.Params[0].AsString := 'qwe';
ADCommand1.Execute;


Example 3

Example 3
TADCustomCommand.CommandText Property

Adding long command:

with ADCommand1.CommandText do begin
  BeginUpdate;
  Add('............');
  ......
  Add('............');
  EndUpdate;
end;


See Also

See Also
TADCustomCommand.CommandText Property
See Also

Preprocessing Command Text, Executing Command, TADResourceOptions.ParamCreate, TADResourceOptions.MacroCreate,TADResourceOptions.PreprocessCmdText, CommandKind, Params, Macros, ResourceOptions


See Also

See Also
TADCustomCommand.Connection Property
See Also

ConnectionName, Prepare


See Also

See Also
TADCustomCommand.ConnectionName Property
See Also

Connection, Prepare


See Also

See Also
TADCustomCommand.DataSet Property
See Also

TADAdaptedDataSet Class


Example

Example
TADCustomCommand.Define Method (TADDatSManager, TADDatSTable, TADPhysMetaInfoMergeMode)

..


See Also

See Also
TADCustomCommand.Define Method (TADDatSManager, TADDatSTable, TADPhysMetaInfoMergeMode)
See Also

..


Example

Example
TADCustomCommand.Define Method (TADDatSTable, TADPhysMetaInfoMergeMode)
var
  oTab: TADDatSTable;
....
  ADCommand1.Prepare('select * from MyTab');
  oTab := ADCommand1.Define;
  ADCommand1.Open;
  ADCommand1.Fetch(oTab);
  ADCommand1.Close;

  // Some time later, after the structure of DB table MyTab have changed.
  // For example, field was removed.

  ADCommand1.Prepare('select * from MyTab');
  oTab := ADCommand1.Define(oTab, mmOverride);
  ADCommand1.Open;
  ADCommand1.Fetch(oTab);
  ADCommand1.Close;


See Also

See Also
TADCustomCommand.Define Method (TADDatSTable, TADPhysMetaInfoMergeMode)
See Also

TADDatSTable, TADDatSTable.Columns


Example

Example
TADCustomCommand.Disconnect Method
ADCommand1.CommandText.Text := 'select * from [Order Details]';
ADCommand1.Prepare := True;
ADCommand1.Active := True;
ADCommand1.Disconnect;
// Active = False and Prepare = False


Example

Example
TADCustomCommand.Execute Method (Integer, Integer, Boolean)
ADCommand1.CommandText.Text := 'create table MyTab (f1 number, f2 varchar2(10))';
ADCommand1.Execute;


See Also

See Also
TADCustomCommand.Execute Method (Integer, Integer, Boolean)
See Also

Executing Command, RowsAffected, CommandText, Params


Example

Example
TADCustomCommand.Execute Method (String, array of Variant, array of TFieldType)
ADCommand1.Execute('insert into MyTab (id, bval) values (:id, :bval)', [100, StringOfChar('x', 100000)], [ftInteger, ftBLOB]);


See Also

See Also
TADCustomCommand.Execute Method (String, array of Variant, array of TFieldType)
See Also

Executing Command, RowsAffected, CommandText, Params


Example

Example
TADCustomCommand.Execute Method (String, array of Variant)
ADCommand1.Execute('delete from MyTab where id = : id', [100]);


See Also

See Also
TADCustomCommand.Execute Method (String, array of Variant)
See Also

Executing Command, RowsAffected, CommandText, Params


Example

Example
TADCustomCommand.Execute Method (String)
ADCommand1.Execute('DROP TABLE MyTab');


See Also

See Also
TADCustomCommand.Execute Method (String)
See Also

Executing Command, RowsAffected, CommandText, Params


Example

Example
TADCustomCommand.Fetch Method
var
  oTab: TADDatSTable;
...
  ADCommand1.CommandKind := skStoredProc;
  ADCommand1.CommandText.Text := 'SEL_CUST_PROC';
  oTab := ADCommand1.Define;
  try
    ADCommand1.Open;
    repeat
      oTab.Clear;
      ADCommand1.Fetch(oTab, False);
      // process next rowset
    until ADCommand1.RowsAffected = 0;
  finally
    oTab.Free;
  end;


See Also

See Also
TADCustomCommand.Fetch Method
See Also

TADFetchOptions, Close, CloseAll, Open, Active


See Also

See Also
TADCustomCommand.FetchOptions Property
See Also

Setting Options, TADFetchOptions, Fetch


See Also

See Also
TADCustomCommand.FillParams Method
See Also

CommandText, CommandKind, Params, TADFetchOptions.Items, TADResourceOptions.ParamCreate


See Also

See Also
TADCustomCommand.FindMacro Method
See Also

Macros, MacroByName


See Also

See Also
TADCustomCommand.FindParam Method
See Also

Params, ParamByName, Values


See Also

See Also
TADCustomCommand.FixedCommandKind Property
See Also

CommandKind


See Also

See Also
TADCustomCommand.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Fetch, Params


See Also

See Also
TADCustomCommand.GetConnection Method
See Also

Connection, ConnectionName, AcquireConnection, ReleaseConnection


See Also

See Also
TADCustomCommand.MacroByName Method
See Also

Macros, FindMacro


Example 1

Example 1
TADCustomCommand.Macros Property

Substitute table name:

ADCommand1.CommandText.Text := 'select * from &Tab';
ADCommand1.Macros[0].AsIdentifier := 'Order Details';
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from "Order Details"


Example 2

Example 2
TADCustomCommand.Macros Property

Substitute WHERE condition:

ADCommand1.CommandText.Text := 'select * from MyTab {if !cond} where !cond {fi}';
ADCommand1.Macros[0].AsString := 'ID > 100';
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from MyTab where ID > 100
ADCommand1.Macros[0].Clear;
ADCommand1.Prepare;
ShowMessage(ADCommand1.SQLText); // select * from MyTab


Example 3

Example 3
TADCustomCommand.Macros Property

See FireDAC\Samples\Comp Layer\TADQuery\Macros demo for details.


See Also

See Also
TADCustomCommand.Macros Property
See Also

Executing Command, Preprocessing Command Text, CommandText, Params, Prepare, TADMacros, TADResourceOptions.MacroCreate, TADResourceOptions.MacroExpand


Example

Example
TADCustomCommand.NextRecordSet Method
ADCommand1.FetchOptions.AutoClose := False;
ADCommand1.CommandText.Text := 'select 1 as i; select ''qwe'' as s';
ADCommand1.Open;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ShowMessage(oTab.Rows[0].DumpRow(True)); // output "i: 1"
finally
  oTab.Free;
end;
ADCommand1.NextRecordSet;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ShowMessage(oTab.Rows[0].DumpRow(True)); // output "s: qwe"
finally
  oTab.Free;
end;
ADQuery1.CloseAll;


See Also

See Also
TADCustomCommand.NextRecordSet Method
See Also

TADFetchOptions.AutoClose, Open, Close, CloseAll, Fetch


Example

Example
TADCustomCommand.OnCommandChanged Event
procedure TForm1.ADCommand1CommandChanged(ASender: TObject);
begin
  if ADCommand1.FindParam('ID') <> nil then
    ADCommand1.FindParams('ID').AsInteger := 100;
end;


See Also

See Also
TADCustomCommand.OnCommandChanged Event
See Also

CommandText


Example 1

Example 1
TADCustomCommand.OnError Event

Handling Array DML errors:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;


Example 2

Example 2
TADCustomCommand.OnError Event

Error substitution:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;


See Also

See Also
TADCustomCommand.OnError Event
See Also

Handling Errors, Array DML, Open, Execute, Prepare, Fetch, EADDBArrayExecuteError class, EADDBEngineException class


See Also

See Also
TADCustomCommand.Open Method
See Also

Active, Close, CloseAll, State


Example

Example
TADCustomCommand.OpenOrExecute Method
if ADCommand1.OpenOrExecute then begin
  oTab := ADCommand1.Define;
  try
    ADCommand1.Fetch(oTab);
  finally
    ADCommand1.CloseAll;
    oTab.Free;
  end;
end;


See Also

See Also
TADCustomCommand.OpenOrExecute Method
See Also

Execute, Open, Active, Close, CloseAll


Example

Example
TADCustomCommand.Overload Property
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'DBMS_SQL.PARSE';
ADCommand1.Overload := 1;


See Also

See Also
TADCustomCommand.Overload Property
See Also

CommandText, CommandKind


See Also

See Also
TADCustomCommand.ParamBindMode Property
See Also

Params


See Also

See Also
TADCustomCommand.ParamByName Method
See Also

Params, FindParam, Values


See Also

See Also
TADCustomCommand.Params Property
See Also

Executing Command, CommandText, Macros, Prepare, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items


Example

Example
TADCustomCommand.Prepare Method
ADCommand1.Prepare('select * from MyTab');


See Also

See Also
TADCustomCommand.Prepare Method
See Also

Prepared, Unprepare, State, Params


See Also

See Also
TADCustomCommand.Prepared Property
See Also

Prepare, Unprepare, State, Params


See Also

See Also
TADCustomCommand.ReleaseConnection Method
See Also

AcquireConnection, Connection, ConnectionName


See Also

See Also
TADCustomCommand.ResourceOptions Property
See Also

Setting Options, TADBottomResourceOptions


Example

Example
TADCustomCommand.RowsAffected Property
procedure TForm1.ADCommand1AfterExecute(ASender: TObject);
begin
  if ADCommand1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADCommand1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADCommand1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADCommand1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADCommand1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADCommand1.RowsAffected]);
    end;
end;


See Also

See Also
TADCustomCommand.RowsAffected Property
See Also

Execute, Fetch


Example 1

Example 1
TADCustomCommand.SchemaName Property
ADCommand1.SchemaName := 'SCOTT';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;


Example 2

Example 2
TADCustomCommand.SchemaName Property
ADMetaInfoCommand1.SchemaName := 'ADDEMO';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on Oracle just ADMetaInfoCommand1.ObjectName := 'ADDEMO.MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;


See Also

See Also
TADCustomCommand.SchemaName Property
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName


See Also

See Also
TADCustomCommand.SQLText Property
See Also

CommandText, Prepare


See Also

See Also
TADCustomCommand Class
See Also

Executing Command, Executing Stored Procedure, TADCommand, TADCustomQuery, IADPhysCommand


See Also

See Also
TADCustomCommand.State Property
See Also

Prepare, Execute, Open, AbortJob, Fetch, Close, Unprepare


See Also

See Also
TADCustomCommand.Transaction Property
See Also

Managing Transactions, TADTransaction, TADCustomConnection.Transaction


See Also

See Also
TADCustomCommand.Unprepare Method
See Also

Prepare, Prepared


See Also

See Also
TADCustomCommand.UpdateOptions Property
See Also

Setting Options, TADBottomUpdateOptions


Example 1

Example 1
TADCustomCommand.Values Property

The following statements are semantically identical and write the value from an edit box into an integer parameter:

ADCommand1.Values['CustNo'] := Edit1.Text;
ADCommand1['CustNo'] := Edit1.Text;


Example 2

Example 2
TADCustomCommand.Values Property

The next statement reads a string value from a parameter into an edit box:

Edit1.Text := ADCommand1['Company'];


See Also

See Also
TADCustomCommand.Values Property
See Also

Params, ParamByName, FindParam, TADParam.Value


Example

Example
TADCustomConnection.AbortJob Method
ADConnection1.AbortJob(True);
ADConnection1.Connected := False;


See Also

See Also
TADCustomConnection.AbortJob Method
See Also

TADAdaptedDataSet.AbortJob


See Also

See Also
TADCustomConnection.AfterCommit Event
See Also

BeforeCommit


See Also

See Also
TADCustomConnection.AfterRollback Event
See Also

BeforeRollback


See Also

See Also
TADCustomConnection.AfterStartTransaction Event
See Also

BeforeStartTransaction


See Also

See Also
TADCustomConnection.ApplyUpdates Method
See Also

Caching Updates, ApplyUpdates, CommitUpdates


Example

Example
TADCustomConnection.Assign Method
oConn := TADConnection.Create(nil);
oConn.Assign(ADConnection1);


See Also

See Also
TADCustomConnection.Assign Method
See Also

Multi Threading


See Also

See Also
TADCustomConnection.BeforeCommit Event
See Also

AfterCommit


See Also

See Also
TADCustomConnection.BeforeRollback Event
See Also

AfterRollback


See Also

See Also
TADCustomConnection.BeforeStartTransaction Event
See Also

AfterStartTransaction


See Also

See Also
TADCustomConnection.CheckActive Method
See Also

TADTopResourceOptions.AutoConnect, Connected


See Also

See Also
TADCustomConnection.CheckInactive Method
See Also

TADTopResourceOptions.AutoConnect, Connected


See Also

See Also
TADCustomConnection.CheckOnline Method
See Also

TADTopResourceOptions.AutoConnect, Offlined


Example 1

Example 1
TADCustomConnection.CliHandle Property

See demo application FireDAC\Samples\Comp Layer\TADConnection\DLL_Sharing.


Example 2

Example 2
TADCustomConnection.CliHandle Property

Application code (without checks):

  FhDll := LoadLibrary(PChar('Project2.dll'));
  @FpShowData := GetProcAddress(FhDll, PChar('ShowData'));
  FpShowData(ADConnection1.CliHandle);

DLL code:

procedure ShowData(ACliHandle: LongWord);
begin
  ADConnection1.SharedCliHandle := ACliHandle;
  ADConnection1.Connected := True;
  ADQuery1.Active := True;
end;


See Also

See Also
TADCustomConnection.CliHandle Property
See Also

DLL Development, SharedCliHandle, Connected


Example

Example
TADCustomConnection.CliObj Property
uses
  uADPhysODBCWrapper;
....
  // returns ODBC driver DLL name for an ODBC based connection
  ShowMessage(TODBCConnection(ADConnection1.CliObj).DRIVER_NAME);


Example

Example
TADCustomConnection.CommandCount Property
var
  i: Integer;
...
  for i := ADConnection1.CommandCount - 1 downto 0 do
    ADConnection1.Commands[i].Disconnect(True);


See Also

See Also
TADCustomConnection.CommandCount Property
See Also

Commands, TADCustomCommand


Example

Example
TADCustomConnection.Commands Property
var
  i: Integer;
...
  for i := ADConnection1.CommandCount - 1 downto 0 do
    ADConnection1.Commands[i].Disconnect(True);


See Also

See Also
TADCustomConnection.Commands Property
See Also

CommandCount, TADCustomCommand


Example 1

Example 1
TADCustomConnection.Commit Method
procedure TForm1.DoThatButtonClick(Sender: TObject);
begin
  ADConnection1.StartTransaction;
  try
    if CustomerQuery.Locate('ID', [100]) then begin
      CustomerQuery.Edit;
      CustomerQuery.FieldByName('status').AsString := 'top';
      CustomerQuery.Post;
      ADConnection1.ExecSQL('delete from debt where CustID = 100');
      ADConnection1.Commit;
    end;
  except
    ADConnection1.Rollback;
    raise;
  end;
end;


Example 2

Example 2
TADCustomConnection.Commit Method

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.


See Also

See Also
TADCustomConnection.Commit Method
See Also

Managing Transactions, StartTransaction, InTransaction, Rollback, CommitRetaining, ReleaseClients


Example

Example
TADCustomConnection.CommitRetaining Method
procedure TForm1.DoThatButtonClick(Sender: TObject);
begin
  ADConnection1.StartTransaction;
  try
    if CustomerQuery.Locate('ID', [100]) then begin
      CustomerQuery.Edit;
      CustomerQuery.FieldByName('status').AsString := 'top';
      CustomerQuery.Post;
      ADConnection1.ExecSQL('delete from debt where CustID = 100');
      ADConnection1.CommitRetaining;
    end;
  except
    ADConnection1.RollbackRetaining;
    raise;
  end;
end;


See Also

See Also
TADCustomConnection.CommitRetaining Method
See Also

Managing Transactions, StartTransaction, InTransaction, Rollback, Commit


Example 1

Example 1
TADCustomConnection.Connected Property
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;


Example 2

Example 2
TADCustomConnection.Connected Property

See FireDAC\Samples\Comp Layer\TADConnection\Pooling sample for details of how to work with pooled connections.


See Also

See Also
TADCustomConnection.Connected Property
See Also

TCustomConnection.BeforeConnect, TCustomConnection.AfterConnect, TCustomConnection.BeforeDisconnect, TCustomConnection.AfterDisconnect, ConnectionDefName, DriverName, Params, Offlined, OnRecover


See Also

See Also
TADCustomConnection.ConnectedStoredUsage Property
See Also

Connected


Example 1

Example 1
TADCustomConnection.ConnectionDefName Property
ADConnection1.ConnectionDefName := 'ASA_Demo';
ADConnection1.Connected := True;


Example 2

Example 2
TADCustomConnection.ConnectionDefName Property

See demo FireDAC\Samples\Comp Layer\TADConnection\ConnectionDefs for details how to create and use connection definitions.


Example 3

Example 3
TADCustomConnection.ConnectionDefName Property

Specifying pooled connection:

var
  oList: TStringList;
  ......
  oList := TStringList.Create;
  oList.Add('Server=MyServer');
  oList.Add('Database=Northwind');
  oList.Add('User_Name=sa');
  oList.Add('Password=');
  oList.Add('Pooled=True');
  ADManager.AddConnectionDef('myconn', 'MSSQL', oList);
  ......
  ADConnection1.ConnectionDefName := 'myconn';
  ADConnection1.Connected := True;


See Also

See Also
TADCustomConnection.ConnectionDefName Property
See Also

Defining Connection, TADCustomManager


See Also

See Also
TADCustomConnection.ConnectionIntf Property
See Also

IADPhysConnection


Example

Example
TADCustomConnection.ConnectionMetaDataIntf Property
procedure TMainForm.Button2Click(Sender: TObject);
var
  oMetaIntf: IADPhysConnectionMetadata;
begin
  // Get client and server versions
  oMetaIntf := ADConnection1.ConnectionMetaDataIntf;
  try
    ShowMessage(Format('Client version: %.10d; Server version: %.10d',
      [oMetaIntf.ClientVersion, oMetaIntf.ServerVersion]));
  finally
    oMetaIntf:= nil; // always release the Interface before you close the connection
  end;
end;


See Also

See Also
TADCustomConnection.ConnectionMetaDataIntf Property
See Also

Connected, ConnectionIntf, IADPhysConnectionMetadata


Example

Example
TADCustomConnection.ConnectionName Property
ADConnection1.ConnectionName := 'TestConn';
ADConnection1.DriverName := 'Oracl';'
ADConnection1.Params.Add('Database=testdb');
....
ADQuery1.ConnectionName := 'TestConn';
ADQuery1.Open('select * from test_tab');


See Also

See Also
TADCustomConnection.ConnectionName Property
See Also

ConnectionDefName, DriverName, Params, TADCustomCommand.ConnectionName, TADRDBMSDataSet.ConnectionName


Example

Example
TADCustomConnection.DataSets Property
var
  i: Integer;
...
  for i := ADConnection1.DataSetCount - 1 downto 0 do
    ADConnection1.DataSets[i].Disconnect(True);


See Also

See Also
TADCustomConnection.DataSets Property
See Also

DataSetCount, TADRdbmsDataSet


Example

Example
TADCustomConnection.DecodeObjectName Method

On Oracle:

var
  sCatalog, sSchema, sBaseObj, sObj: String;
...
  ADConnection1.DecodeObjectName('ADDemo."MyPack".Proc1', sCatalog, sSchema, sBaseObj, sObj);
  // sCatalog -> ''
  // sSchema -> ADDEMO
  // sBaseObj -> MyPack
  // sObj -> PROC1


See Also

See Also
TADCustomConnection.DecodeObjectName Method
See Also

EncodeObjectName


Example

Example
TADCustomConnection.DriverName Property
ADConnection1.DriverName := 'Oracl';'
ADConnection1.Params.Add('Database=testdb');
....
ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select * from test_tab');


See Also

See Also
TADCustomConnection.DriverName Property
See Also

Params, ConnectionDefName


Example

Example
TADCustomConnection.EncodeObjectName Method

On Oracle:

ShowMessage(ADConnection1.EncodeObjectName('', 'ADDEMO', 'MyPack', 'PROC1')); // -> ADDEMO."MyPack".PROC1


See Also

See Also
TADCustomConnection.EncodeObjectName Method
See Also

DecodeObjectName


Example

Example
TADCustomConnection.ExecSQL Method (String, array of Variant, array of TFieldType)
ADConnection1.ExecSQL('update mytab where id = :p1 set blobfld = :blb',
  [1000, StringOfChar('x', 100000)], [ftInteger, ftBLOB]);


See Also

See Also
TADCustomConnection.ExecSQL Method (String, array of Variant, array of TFieldType)
See Also

Executing Command, TADQuery


Example

Example
TADCustomConnection.ExecSQL Method (String, array of Variant)
ADConnection1.ExecSQL('delete from mytab where id > :p1', [1000]);


See Also

See Also
TADCustomConnection.ExecSQL Method (String, array of Variant)
See Also

Executing Command, TADQuery


Example

Example
TADCustomConnection.ExecSQL Method (String)
ADConnection1.ExecSQL('truncate table tab1');


See Also

See Also
TADCustomConnection.ExecSQL Method (String)
See Also

Executing Command, TADQuery


Example

Example
TADCustomConnection.ExecSQLScalar Method (String, array of Variant, array of TFieldType)
var
  sName: String;
...
  sName := ADConnection1.ExecSQLScalar('select name from {id Employees} where id = :id', [100], [ftLargeInt]);


See Also

See Also
TADCustomConnection.ExecSQLScalar Method (String, array of Variant, array of TFieldType)
See Also

Executing Command, TADQuery


Example

Example
TADCustomConnection.ExecSQLScalar Method (String, array of Variant)
var
  sName: String;
...
  sName := ADConnection1.ExecSQLScalar('select name from {id Employees} where id = :id', [100]);


See Also

See Also
TADCustomConnection.ExecSQLScalar Method (String, array of Variant)
See Also

Executing Command, TADQuery


Example

Example
TADCustomConnection.ExecSQLScalar Method (String)
var
  sVersion: String;
...
  sVersion := ADConnection1.ExecSQLScalar('select @@version');


See Also

See Also
TADCustomConnection.ExecSQLScalar Method (String)
See Also

Executing Command, TADQuery


See Also

See Also
TADCustomConnection.FetchOptions Property
See Also

Setting Options, TADFetchOptions, ADManager


See Also

See Also
TADCustomConnection.FormatOptions Property
See Also

Setting Options, TADFormatOptions, ADManager


Example

Example
TADCustomConnection.GetCatalogNames Method
ADConnection1.GetCatalogNames('', ListBox1.Items);


See Also

See Also
TADCustomConnection.GetCatalogNames Method
See Also

Querying Metadata, TADMetaInfoQuery


Example 1

Example 1
TADCustomConnection.GetFieldNames Method
ADConnection1.GetFieldNames('', '', 'MYTAB', '', ListBox1.Items);


Example 2

Example 2
TADCustomConnection.GetFieldNames Method

See FireDAC\Samples\Comp Layer\TADConnection\GetFieldNames sample.


See Also

See Also
TADCustomConnection.GetFieldNames Method
See Also

TADMetaInfoQuery, Querying Metadata


Example

Example
TADCustomConnection.GetGeneratorNames Method
ADConnection1.GetGeneratorNames('', '', 'MY%', ListBox1.Items, [osMy, osSystem]);


See Also

See Also
TADCustomConnection.GetGeneratorNames Method
See Also

TADMetaInfoQuery, Querying Metadata


Example

Example
TADCustomConnection.GetInfoReport Method
ADConnection1.GetInfoReport(mmInfo.Lines);


See Also

See Also
TADCustomConnection.GetInfoReport Method
See Also

DBMS Environment Reports, Connected


Example 1

Example 1
TADCustomConnection.GetKeyFieldNames Method
ADConnection1.GetKeyFieldNames('NORTHWIND', 'DBO', 'MYTAB', '', ListBox1.Items);


Example 2

Example 2
TADCustomConnection.GetKeyFieldNames Method

See FireDAC\Samples\Comp Layer\TADConnection\GetFieldNames sample.


See Also

See Also
TADCustomConnection.GetKeyFieldNames Method
See Also

TADMetaInfoQuery, Querying Metadata


Example

Example
TADCustomConnection.GetLastAutoGenValue Method
ShowMessage(VarToStr(ADConnection1.GetLastAutoGenValue('MyGen')));


See Also

See Also
TADCustomConnection.GetLastAutoGenValue Method
See Also

RDBMSKind


Example

Example
TADCustomConnection.GetPackageNames Method
ADConnection1.GetPackageNames('', 'SYS', 'DBMS%', ListBox1.Items, [osMy, osSystem]);


See Also

See Also
TADCustomConnection.GetPackageNames Method
See Also

TADMetaInfoQuery, Querying Metadata


Example

Example
TADCustomConnection.GetSchemaNames Method
ADConnection1.GetSchemaNames('', '', ListBox1.Items);


See Also

See Also
TADCustomConnection.GetSchemaNames Method
See Also

TADMetaInfoQuery, Querying Metadata


Example

Example
TADCustomConnection.GetStoredProcNames Method
ADConnection1.GetStoredProcNames('', '', '', '', ListBox1.Items, [osMy, osSystem]);


See Also

See Also
TADCustomConnection.GetStoredProcNames Method
See Also

TADMetaInfoQuery, Querying Metadata


Example 1

Example 1
TADCustomConnection.GetTableNames Method
ADConnection1.GetTableNames('NORTHWIND', 'DBO', 'ADQA%', '', ListBox1.Items,
  [osMy, osSystem, osOther], [tkTable, tkView]);


Example 2

Example 2
TADCustomConnection.GetTableNames Method

See FireDAC\Samples\Comp Layer\TADConnection\GetFieldNames sample.


See Also

See Also
TADCustomConnection.GetTableNames Method
See Also

TADMetaInfoQuery, Querying Metadata


Example

Example
TADCustomConnection.InTransaction Property

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.


See Also

See Also
TADCustomConnection.InTransaction Property
See Also

StartTransaction, Commit, Rollback, TADTransaction


Example

Example
TADCustomConnection.LoginDialog Property

Using private login dialog:

ADGUIxLoginDialog1.Caption := 'Welcome to the Northwind DB';
ADGUIxLoginDialog1.VisibleItems.Add('User_name');
ADGUIxLoginDialog1.VisibleItems.Add('Password');
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.LoginPrompt := True;
ADConnection1.Connected := True;


See Also

See Also
TADCustomConnection.LoginDialog Property
See Also

Establishing Connection, TADGUIxLoginDialog, LoginPrompt, SharedCliHandle, ADGUIxSilent


Example 1

Example 1
TADCustomConnection.LoginPrompt Property

Using login dialog:

ADGUIxLoginDialog1.Caption := 'Welcome to the Northwind DB';
ADGUIxLoginDialog1.VisibleItems.Add('User_name');
ADGUIxLoginDialog1.VisibleItems.Add('Password');
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.LoginPrompt := True;
ADConnection1.Connected := True;


Example 2

Example 2
TADCustomConnection.LoginPrompt Property

Connecting without login dialog:

procedure TForm1.ADConnection1Login(AConnection: TADCustomConnection; const AConnectionDef: IADStanConnectionDef);
begin
  AConnectionDef.UserName := 'dba';
  AConnectionDef.Password := 'sql';
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  ADConnection1.OnLogin := ADConnection1Login;
  ADConnection1.LoginPrompt := True;
  ADConnection1.Connected := True;
end;


See Also

See Also
TADCustomConnection.LoginPrompt Property
See Also

Establishing Connection, OnLogin, LoginDialog, Params, SharedCliHandle, ADGUIxSilent, AfterConnect


Example

Example
TADCustomConnection.Messages Property
var
  i: Integer;
begin
  ADConnection1.ResourceOptions.ServerOutput := True;
  ADQuery1.ExecSQL;
  for i := 0 to ADConnection1.ConnectionIntf.Messages.ErrorCount - 1 do
    Memo1.Lines.Add(ADConnection1.ConnectionIntf.Messages[i].Message);
end;


See Also

See Also
TADCustomConnection.Messages Property
See Also

Executing Command, EADDBEngineException


Example

Example
TADCustomConnection.Offline Method
ADConnection1.Offline;
lblState.Caption := '<not connected>';


See Also

See Also
TADCustomConnection.Offline Method
See Also

Offlining Connection, Online, Offlined, Connected, TADDataSet.Offline


See Also

See Also
TADCustomConnection.Offlined Property
See Also

Offlining Connection, TADFetchOptions.AutoFetchAll, TADTopResourceOptions.AutoConnect, Connected, Offline, Online


Example

Example
TADCustomConnection.OnError Event
procedure TForm1.ADConnection1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if (AException is EADDBEngineException) and (EADDBEngineException(AException).Kind = ekUKViolated) then begin
    AException.Free;
    AException := Exception.Create('You must enter unique document number !');
  end;
end;


See Also

See Also
TADCustomConnection.OnError Event
See Also

Handling Errors, EADDBEngineException


Example

Example
TADCustomConnection.Online Method
ADConnection1.Online;
lblState.Caption := '<connected>';


See Also

See Also
TADCustomConnection.Online Method
See Also

Offlining Connection, Offline, Offlined, Connected


Example

Example
TADCustomConnection.OnLogin Event

Connecting without login dialog:

procedure TForm1.ADConnection1Login(AConnection: TADCustomConnection; const AConnectionDef: IADStanConnectionDef);
begin
  AConnectionDef.UserName := 'dba';
  AConnectionDef.Password := InputBox('Login', 'Please enter DBA password', 'sql');
end;

procedure TForm1.Button1Click(ASender: TObject);
begin
  ADConnection1.OnLogin := ADConnection1Login;
  ADConnection1.LoginPrompt := True;
  ADConnection1.Connected := True;
end;


See Also

See Also
TADCustomConnection.OnLogin Event
See Also

Establishing Connection, LoginPrompt, Connected, IADStanConnectionDef


See Also

See Also
TADCustomConnection.OnLosted Event
See Also

Recovering Connection, OnRecover, OnRestored


See Also

See Also
TADCustomConnection.OnRecover Event
See Also

Recovering Connection, OnLosted, OnRestored, TADTopResourceOptions.AutoReconnect, Connected, Offlined


See Also

See Also
TADCustomConnection.OnRestored Event
See Also

Recovering Connection, OnLosted, OnRecover


Example

Example
TADCustomConnection.Open Method (String, String, String)
 ADConnection1.Open('DriverID=Ora;Database=ORA_920_APP', 'addemo', 'a');


See Also

See Also
TADCustomConnection.Open Method (String, String, String)
See Also

Params, ConnectionDefName, DriverName, Connected, Open(String), Open(String, String)


Example

Example
TADCustomConnection.Open Method (String, String)
ADConnection1.Open('addemo', 'a');


See Also

See Also
TADCustomConnection.Open Method (String, String)
See Also

Params, ConnectionDefName, DriverName, Connected, Open(String), Open(String, String, String)


Example

Example
TADCustomConnection.Open Method (String)
ADConnection1.Open('DriverID=Ora;Database=ORA_920_APP;User_Name=addemo;Password=a');


See Also

See Also
TADCustomConnection.Open Method (String)
See Also

Params, ConnectionDefName, DriverName, Connected, Open(String, String), Open(String, String, String)


See Also

See Also
TADCustomConnection.OptionsIntf Property
See Also

IADStanOptions


Example

Example
TADCustomConnection.Params Property
with ADConnection1.Params do begin
  Clear;
  Add('DriverID=Ora');
  Add('Database=ORA_920_APP');
  Add('User_Name=ADDemo');
  Add('Password=a');
end;
ADConnection1.Connected := True;


See Also

See Also
TADCustomConnection.Params Property
See Also

Defining Connection, ConnectionDefName, DriverName, OnLogin


Example

Example
TADCustomConnection.Ping Method
procedure TMyDataModule.DoPing(ASender: TObject);
begin
  if not ADConnection1.Ping then
    ShowMessage('Connection is losted !');
end;
.......
FTimer := TTimer.Create;
FTimer.OnTimer := DoPing;
FTimer.Interval := 30000; // each 30 secs
FTimer.Enabled := True;


See Also

See Also
TADCustomConnection.Ping Method
See Also

TADTopResourceOptions.AutoReconnect, Offline, Online, Connected


Example

Example
TADCustomConnection.RDBMSKind Property
case ADConnection1.RDBMSKind of
mkOracle:    s := 'select mySeq.NextVal from dual';
mkInterbase: s := 'select gen_id(myGen, 1) from rdb$database';
else         Exit;
end;
ADQuery1.Open(s);


See Also

See Also
TADCustomConnection.RDBMSKind Property
See Also

TADRDBMSKind, Connected


Example

Example
TADCustomConnection.RefCount Property
if ADConnection1.RefCount = 0 then
  ADConnection1.Close;


See Also

See Also
TADCustomConnection.RefCount Property
See Also

Temporary, DataSets, DataSetCount, Commands, CommandCount


Example

Example
TADCustomConnection.RefreshMetadataCache Method
ADConnection1.ExecSQL('alter table mytab drop primary key');
ADConnection1.RefreshMetadataCache;


See Also

See Also
TADCustomConnection.RefreshMetadataCache Method
See Also

TADFetchOptions.Cache, Working with Metadata


Example

Example
TADCustomConnection.ReleaseClients Method
// Fetch all records from active cursors, then commit current transaction.
// On MS SQL Server, for example, active cursors are invalidated after finishing of a transaction.
ADConnection1.ReleaseClients(rmFetchAll);
ADConnection1.Commit;


See Also

See Also
TADCustomConnection.ReleaseClients Method
See Also

Offline, Online, Close, Open


See Also

See Also
TADCustomConnection.ResourceOptions Property
See Also

Setting Options, TADTopResourceOptions, ADManager


See Also

See Also
TADCustomConnection.ResultConnectionDef Property
See Also

ConnectionDefName, Params, DriverName, IADStanConnectionDef


Example 1

Example 1
TADCustomConnection.Rollback Method
procedure TForm1.DoThatButtonClick(Sender: TObject);
begin
  ADConnection1.StartTransaction;
  try
    if CustomerQuery.Locate('ID', [100]) then begin
      CustomerQuery.Edit;
      CustomerQuery.FieldByName('status').AsString := 'top';
      CustomerQuery.Post;
      ADConnection1.ExecSQL('delete from debt where CustID = 100');
      ADConnection1.Commit;
    end;
  except
    ADConnection1.Rollback;
    raise;
  end;
end;


Example 2

Example 2
TADCustomConnection.Rollback Method

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.


See Also

See Also
TADCustomConnection.Rollback Method
See Also

Managing Transactions, StartTransaction, InTransaction, Commit, RollbackRetaining, ReleaseClients


Example

Example
TADCustomConnection.RollbackRetaining Method
procedure TForm1.DoThatButtonClick(Sender: TObject);
begin
  ADConnection1.StartTransaction;
  try
    if CustomerQuery.Locate('ID', [100]) then begin
      CustomerQuery.Edit;
      CustomerQuery.FieldByName('status').AsString := 'top';
      CustomerQuery.Post;
      ADConnection1.ExecSQL('delete from debt where CustID = 100');
      ADConnection1.CommitRetaining;
    end;
  except
    ADConnection1.RollbackRetaining;
    raise;
  end;
end;


See Also

See Also
TADCustomConnection.RollbackRetaining Method
See Also

Managing Transactions, StartTransaction, InTransaction, Commit, Rollback


Example 1

Example 1
TADCustomConnection.SharedCliHandle Property

See demo application FireDAC\Samples\Comp Layer\TADConnection\DLL_Sharing.


Example 2

Example 2
TADCustomConnection.SharedCliHandle Property

Application code (without checks):

  FhDll := LoadLibrary(PChar('Project2.dll'));
  @FpShowData := GetProcAddress(FhDll, PChar('ShowData'));
  FpShowData(ADConnection1.CliHandle);

DLL code:

procedure ShowData(ACliHandle: LongWord);
begin
  ADConnection1.SharedCliHandle := ACliHandle;
  ADConnection1.Connected := True;
  ADQuery1.Active := True;
end;


See Also

See Also
TADCustomConnection.SharedCliHandle Property
See Also

DLL Development, CliHandle, Connected


See Also

See Also
TADCustomConnection Class
See Also

Working with Connections, Managing Transactions, TADConnection, IADPhysConnection


Example

Example
TADCustomConnection.StartTransaction Method

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.


See Also

See Also
TADCustomConnection.StartTransaction Method
See Also

Managing Transactions, InTransaction, Commit, Rollback, TxOptions


Example

Example
TADCustomConnection.Temporary Property
var
  oConn: TADconnection;
...
ADQuery1.ConnectionName := 'Access_Demo';
ADQuery1.Open;
...
oConn := ADManager.FindConnection('Access_Demo');
// here oConn.Temporary = True. The oConn will bedestroyed after disconnecting of ADQuery1
oConn.Temporary := False;
...
ADQuery1.Disconnect;
// here oConn is alive due to setting of oConn.Temporary to False


See Also

See Also
TADCustomConnection.Temporary Property
See Also

RefCount


See Also

See Also
TADCustomConnection.Transaction Property
See Also

UpdateTransaction, TADCustomTransaction


Example

Example
TADCustomConnection.TxOptions Property

See FireDAC\Samples\Comp Layer\TADConnection\Transactions sample for details.


See Also

See Also
TADCustomConnection.TxOptions Property
See Also

Transaction, TADTxOptions


See Also

See Also
TADCustomConnection.UpdateOptions Property
See Also

Setting Options, TADUpdateOptions, ADManager


See Also

See Also
TADCustomConnection.UpdateTransaction Property
See Also

Transaction, TADCustomTransaction


See Also

See Also
TADCustomEventAlerter.Active Property
See Also

Database Alerts, Names, Register, Unregister


See Also

See Also
TADCustomEventAlerter.Connection Property
See Also

Names, Register


See Also

See Also
TADCustomEventAlerter.EventAlerterIntf Property
See Also

IADPhysEventAlerter


Example

Example
TADCustomEventAlerter.Names Property
with ADEventAlerter1 do begin
  Unregister;
  Names.Clear;
  Names.Add('Customers');
  Names.Add('Orders');
  Register;
end;


See Also

See Also
TADCustomEventAlerter.Names Property
See Also

Database Alerts, Register, Active


Example

Example
TADCustomEventAlerter.OnAlert Event
procedure TForm1.ADEventAlerter1Alert(ASender: TADCustomEventAlerter;
    const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh
  else if CompareText(AEventName, 'Orders') = 0 then
    qryOrders.Refresh;
end;


See Also

See Also
TADCustomEventAlerter.OnAlert Event
See Also

Database Alerts, OnTimeout, Names


See Also

See Also
TADCustomEventAlerter.OnTimeout Event
See Also

Database Alerts, OnAlert, Options


See Also

See Also
TADCustomEventAlerter.Options Property
See Also

Database Alerts, TADEventAlerterOptions


See Also

See Also
TADCustomEventAlerter.Register Method
See Also

Database Alerts, Active, Name, Unregister


Example

Example
TADCustomEventAlerter.Signal Method
ADEventAlerter1.Names.Text := 'Customers';
ADEventAlerter1.Register;
ADEventAlerter1.Signal('Customers', 123);


See Also

See Also
TADCustomEventAlerter.Signal Method
See Also

Database Alerts, Register


Example 1

Example 1
TADCustomEventAlerter Class
ADEventAlerter1.Names.Text := 'Customers';
ADEventAlerter1.Options.Kind := 'DBMS_ALERT';
ADEventAlerter1.Options.Synchronize := True;
ADEventAlerter1.Options.Timeout := 10000;
ADEventAlerter1.OnAlter := DoAlert;
ADEventAlerter1.OnTimeout := DoTimeout;
ADEventAlerter1.Active := True;
........

procedure TForm1.DoAlert(ASender: TADCustomEventAlerter;
  const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh;
end;

procedure TForm1.DoTimeout(ASender: TObject);
begin
  qryCustomers.Refresh;
end;


Example 2

Example 2
TADCustomEventAlerter Class

See the demo at: FireDAC\Samples\Comp Layer\TADEventAlerter\Main


See Also

See Also
TADCustomEventAlerter Class
See Also

Database Alerts, TADEventAlerter, TADEventAlerterOptions


See Also

See Also
TADCustomEventAlerter.Unregister Method
See Also

Database Alerts, Active, Name, Register


See Also

See Also
TADCustomLocalSQL.Active Property
See Also

Local SQL, Connection


See Also

See Also
TADCustomLocalSQL.Connection Property
See Also

Local SQL, Active


Example

Example
TADCustomLocalSQL.DataSets Property
ADLocalSQL1.DataSets.Add.DataSet := ADOQuery1;
ADLocalSQL1.DataSets.Add.DataSet := ADOQuery2;
ADQuery1.LocalSQL := ADLocalSQL1;
ADQuery2.LocalSQL := ADLocalSQL1;


See Also

See Also
TADCustomLocalSQL.DataSets Property
See Also

Local SQL, TADAdaptedDataSet.LocalSQL, TADLocalSQLDataSets, TADLocalSQLDataSet


See Also

See Also
TADCustomLocalSQL.OnGetDataSet Event
See Also

Local SQL, DataSets, OnReadDataSet


See Also

See Also
TADCustomLocalSQL.OnReadDataSet Event
See Also

Local SQL, OnGetDataSet


Example

Example
TADCustomLocalSQL Class
ADConnection1.DriverName := 'SQLite';

with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADOQuery1;
  Name := 'Orders';
end;
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADOQuery2;
  Name := 'Order Details';
end;
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADMemTable1;
  Name := 'Customers';
end;
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADMemTable2;
  Name := 'Vendors';
end;
ADLocalSQL1.Connection := ADConnection1;
ADLocalSQL1.Active := True;

ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select from Orders o left join "Order Details" od on o.OrderID = od.OrderID');


See Also

See Also
TADCustomLocalSQL Class
See Also

Local SQL, TADLocalSQL


See Also

See Also
TADCustomManager.Active Property
See Also

DriverDefFileAutoLoad, DriverDefFileName, Open, Close


See Also

See Also
TADCustomManager.ActualConnectionDefFileName Property
See Also

ConnectionDefFileName


See Also

See Also
TADCustomManager.ActualDriverDefFileName Property
See Also

DriverDefFileName


Example

Example
TADCustomManager.AddConnectionDef Method
var
  oList: TStringList;
......
  oList := TStringList.Create;
  oList.Add('Server=127.0.0.1');
  oList.Add('Database=addemo');
  ADManager.AddConnectionDef('myconn', 'MySQL', oList);
......
  ADConnection1.ConnectionDefName := 'myconn';
  ADConnection1.Connected := True;


See Also

See Also
TADCustomManager.AddConnectionDef Method
See Also

Defining Connection, ConnectionDefs, SaveConnectionDefFile, DeleteConnectionDef, ModifyConnectionDef, IADStanConnectionDefs.AddConnectionDef, TADCustomConnection.ConnectionDefName


See Also

See Also
TADCustomManager.AfterLoadConnectionDefFile Event
See Also

BeforeLoadConnectionDefFile


See Also

See Also
TADCustomManager.AfterShutdown Event
See Also

Active, Close, BeforeShutdown


See Also

See Also
TADCustomManager.AfterStartup Event
See Also

Active, Open, BeforeStartup


See Also

See Also
TADCustomManager.BeforeLoadConnectionDefFile Event
See Also

AfterLoadConnectionDefFile


See Also

See Also
TADCustomManager.BeforeShutdown Event
See Also

Multi Threading, Active, Close, AfterShutdown


See Also

See Also
TADCustomManager.BeforeStartup Event
See Also

Active, Open, AfterStartup


Example

Example
TADCustomManager.CanRefreshConnectionDefFile Property
// reload connection definition list
if ADManager.CanRefreshConnectionDefFile then begin
  ADManager.ConnectionDefs.Clear;
  ADManager.ConnectionDefs.Load;
end;


See Also

See Also
TADCustomManager.CanRefreshConnectionDefFile Property
See Also

ConnectionDefs


See Also

See Also
TADCustomManager.Close Method
See Also

Open, Active, CloseConnectionDef


See Also

See Also
TADCustomManager.CloseConnectionDef Method
See Also

Close


Example

Example
TADCustomManager.ConnectionCount Property
// perform some task for all application connection objects
for i := 0 to ADManager.ConnectionCount - 1 do
  ADManager.Connections[i].Ping;


See Also

See Also
TADCustomManager.ConnectionCount Property
See Also

TADCustomConnection, Connections


See Also

See Also
TADCustomManager.ConnectionDefFileAutoLoad Property
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileLoaded, ConnectionDefFileName, LoadConnectionDefFile


See Also

See Also
TADCustomManager.ConnectionDefFileLoaded Property
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileautoLoad, ConnectionDefFileName


Example 1

Example 1
TADCustomManager.ConnectionDefFileName Property
ADManager.ConnectionDefFileName := ExtractFilePath(Application.ExeName) + 'myconndef.ini';
ADManager.ConnectionDefFileAutoLoad := True;
oConn := TADConnection.Create(nil);
oConn.ConnectionDefName := 'myconn';
oConn.Connected := True;


Example 2

Example 2
TADCustomManager.ConnectionDefFileName Property
procedure TMyDataModule.DoBeforeLoad(ASender: TNotifyEvent);
begin
  ADManager.ConnectionDefFileName := FSettings.MyConnectionDefFile;
end;
...
ADManager.BeforeLoadConnectionDefFile := DoBeforeLoad;


See Also

See Also
TADCustomManager.ConnectionDefFileName Property
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileAutoLoad, ConnectionDefFileLoaded, ActualConnectionDefFileName


Example 1

Example 1
TADCustomManager.ConnectionDefs Property
var
  oDef: IADStanConnectionDef;
...
// find the connection definition, change it properties and save it to file
oDef := ADManager.ConnectionDefs.ConnectionDefByName('MyDef');
oDef.Server := '127.0.0.1';
oDef.Apply;


Example 2

Example 2
TADCustomManager.ConnectionDefs Property
var
  oDef: IADStanConnectionDef;
...
// add new connection definition and save it to file
oDef := ADManager.ConnectionDefs.AddConnectionDef;
oDef.Name := 'MyDef';
oDef.Server := '127.0.0.1';
oDef.UserName := 'dba';
// use new connection definition
ADConnection1.ConnectionDefName := 'MyDef';


Example 3

Example 3
TADCustomManager.ConnectionDefs Property

See FireDAC\Samples\Comp Layer\TADConnection\ConnectionDefs sample for details of how to work with ConnectionDefs.


See Also

See Also
TADCustomManager.ConnectionDefs Property
See Also

Defining Connection, ConnectionDefFileName, ConnectionDefFileAutoLoad, ConnectionDefFileLoaded


Example

Example
TADCustomManager.Connections Property
// perform some task for all application connection objects
for i := 0 to ADManager.ConnectionCount - 1 do
  ADManager.Connections[i].Ping;


See Also

See Also
TADCustomManager.Connections Property
See Also

TADCustomConnection, ConnectionCount


Example

Example
TADCustomManager.DeleteConnectionDef Method
  ADManager.DeleteConnectionDef('myconn');


See Also

See Also
TADCustomManager.DeleteConnectionDef Method
See Also

Defining Connection, ConnectionDefs, SaveConnectionDefFile, AddConnectionDef, IADStanDefinition.Delete


See Also

See Also
TADCustomManager.DriverDefFileAutoLoad Property
See Also

Configuring Drivers, DriverDefFileName


See Also

See Also
TADCustomManager.DriverDefFileName Property
See Also

Configuring Drivers, DriverDefFileAutoLoad, ActualDriverDefFileName


Example

Example
TADCustomManager.DriverDefs Property
var
  oDef: IADStanDefinition;
...
// add new virtual driver definition
oDef := ADManager.DriverDefs.Add;
oDef.Name := 'Firebird250';
oDef.AsStirngs['VendorLib'] := 'c:\Firebird250\Bin\fbclient.dll';

ADConnection1.Params.Clear;
ADConnection1.Params.Add('DriverID=Firebird250');
ADConnection1.Params.Add('Server=127.0.0.1');
....
ADConnection1.Connected := True;


See Also

See Also
TADCustomManager.DriverDefs Property
See Also

Configuring Drivers, DriverDefFileName, DriverDefFileAutoLoad


See Also

See Also
TADCustomManager.DropConnections Method
See Also

TADCustomConnection.RefCount, TADCustomConnection.Temporary, Connections, ConnectionCount


See Also

See Also
TADCustomManager.FetchOptions Property
See Also

Setting Options, FormatOptions, UpdateOptions, ResourceOptions


See Also

See Also
TADCustomManager.FindConnection Method
See Also

GetConnectionNames, TADCustomConnection.ConnectionName, TADCustomCommand.ConnectionName, TADRdbmsDataSet.ConnectionName


See Also

See Also
TADCustomManager.FormatOptions Property
See Also

Setting Options, FetchOptions, UpdateOptions, ResourceOptions


Example

Example
TADCustomManager.GetBaseDriverID Method
var
  sBaseID: String;
......
  sBaseID := ADManager.GetBaseDriverID('MSSQLExpress');
  if SameText(sBaseID, S_AD_MSSQLId) then
    ShowMessage('It is a MSSQL base driver');


Example

Example
TADCustomManager.GetCatalogNames Method
ADManager.GetCatalogNames('myconn', '', ListBox1.Items);


See Also

See Also
TADCustomManager.GetCatalogNames Method
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetCatalogNames


Example 1

Example 1
TADCustomManager.GetConnectionDefNames Method
ADManager.GetConnectionDefNames(ListBox1.Items);


Example 2

Example 2
TADCustomManager.GetConnectionDefNames Method

See FireDAC\Samples\Comp Layer\TADConnection\ConnectionDefs sample.


See Also

See Also
TADCustomManager.GetConnectionDefNames Method
See Also

IADStanDefinition.Name


Example

Example
TADCustomManager.GetConnectionDefParams Method
ADManager.GetConnectionDefParams('myconn', ListBox1.Items);


See Also

See Also
TADCustomManager.GetConnectionDefParams Method
See Also

IADStanDefinition.Params


See Also

See Also
TADCustomManager.GetConnectionNames Method
See Also

FindConnection, TADCustomConnection.ConnectionName, TADCustomCommand.ConnectionName, TADRdbmsDataSet.ConnectionName


Example

Example
TADCustomManager.GetDriverNames Method
ADManager.GetDriverNames(ListBox1.Items);


See Also

See Also
TADCustomManager.GetDriverNames Method
See Also

Querying Metadata, IADStanConnectionDef.DriverID


Example

Example
TADCustomManager.GetFieldNames Method
ADManager.GetFieldNames('myconn', '', '', 'MYTAB', '', ListBox1.Items);


See Also

See Also
TADCustomManager.GetFieldNames Method
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetFieldNames


Example

Example
TADCustomManager.GetGeneratorNames Method
ADManager.GetGeneratorNames('myconn', '', '', 'MY%', ListBox1.Items, [osMy, osSystem]);


See Also

See Also
TADCustomManager.GetGeneratorNames Method
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetGeneratorNames


Example

Example
TADCustomManager.GetKeyFieldNames Method
ADManager.GetKeyFieldNames('myconn', 'NORTHWIND', 'DBO', 'MYTAB', '', ListBox1.Items);


See Also

See Also
TADCustomManager.GetKeyFieldNames Method
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetKeyFieldNames


Example

Example
TADCustomManager.GetPackageNames Method
ADManager.GetPackageNames('myconn', '', 'SYS', 'DBMS%', ListBox1.Items, [osMy, osSystem]);


See Also

See Also
TADCustomManager.GetPackageNames Method
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetPackageNames


See Also

See Also
TADCustomManager.GetRDBMSKind Method
See Also

GetBaseDriverID


Example

Example
TADCustomManager.GetSchemaNames Method
ADManager.GetSchemaNames('myconn', '', '', ListBox1.Items);


See Also

See Also
TADCustomManager.GetSchemaNames Method
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetSchemaNames


Example

Example
TADCustomManager.GetStoredProcNames Method
ADManager.GetStoredProcNames('myconn', '', '', '', '', ListBox1.Items, [osMy, osSystem]);


See Also

See Also
TADCustomManager.GetStoredProcNames Method
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetStoredProcNames


Example

Example
TADCustomManager.GetTableNames Method
ADManager.GetTableNames('myconn', 'NORTHWIND', 'DBO', 'ADQA%', '', ListBox1.Items,
  [osMy, osSystem, osOther], [tkTable, tkView]);


See Also

See Also
TADCustomManager.GetTableNames Method
See Also

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetTableNames


See Also

See Also
TADCustomManager.LoadConnectionDefFile Method
See Also

ConnectionDefs, ConnectionDefFileAutoLoad, ConnectionDefFileLoaded, ConnectionDefFileName


Example

Example
TADCustomManager.ModifyConnectionDef Method
var
  oList: TStringList;
......
  oList := TStringList.Create;
  oList.Add('Server=myhoster');
  ADManager.ModifyConnectionDef('myconn', oList);
  ADManager.SaveConnectionDefFile;


See Also

See Also
TADCustomManager.ModifyConnectionDef Method
See Also

Defining Connection, ConnectionDefs, SaveConnectionDefFile, DeleteConnectionDef, AddConnectionDef


See Also

See Also
TADCustomManager.Open Method
See Also

Close, Active


Example

Example
TADCustomManager.RefreshConnectionDefFile Method
if ADManager.CanRefreshConnectionDefFile then
  ADManager.RefreshConnectionDefFile;


See Also

See Also
TADCustomManager.RefreshConnectionDefFile Method
See Also

CanRefreshConnectionDefFile, ConnectionDefs


See Also

See Also
TADCustomManager.RefreshMetadataCache Method
See Also

Querying Metadata, TADFetchOptions.Cache, TADCustomConnection.RefreshMetadataCache


See Also

See Also
TADCustomManager.ResourceOptions Property
See Also

Setting Options, FetchOptions, UpdateOptions, FormatOptions


Example

Example
TADCustomManager.SaveConnectionDefFile Method
  ADManager.DeleteConnectionDef('myconn');
  ADManager.SaveConnectionDefFile;


See Also

See Also
TADCustomManager.SaveConnectionDefFile Method
See Also

ConnectionDefs, DeleteConnectionDef, AddConnectionDef, ModifyConnectionDef


See Also

See Also
TADCustomManager.SilentMode Property
See Also

TADResourceOptions.SilentMode, WaitCursor


See Also

See Also
TADCustomManager Class
See Also

TADManager, ADManager, IADPhysManager


See Also

See Also
TADCustomManager.State Property
See Also

Active


See Also

See Also
TADCustomManager.UpdateOptions Property
See Also

Setting Options, FetchOptions, ResourceOptions, FormatOptions


See Also

See Also
TADCustomManager.WaitCursor Property
See Also

SilentMode


Example

Example
TADCustomMemTable.Adapter Property


See Also

See Also
TADCustomMemTable.Adapter Property
See Also

List here...


Example

Example
TADCustomMemTable.AppendData Method
ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select * from [Orders]');
ADMemTable1.AppendData(ADQuery1);

ADQuery2.Connection := ADConnection2;
ADQuery2.Open('select * from "Orders"');
ADMemTable1.AppendData(ADQuery2);


See Also

See Also
TADCustomMemTable.AppendData Method
See Also

Data, CopyDataSet


See Also

See Also
TADCustomMemTable.CommandText Property
See Also

Adapter, TADCustomCommand.CommandText


See Also

See Also
TADCustomMemTable.ConstraintsDisabled Method
See Also

ConstraintsEnabled


See Also

See Also
TADCustomMemTable.DisableStringTrim Property
See Also

FormatOptions, TADFormatOptions.StrsTrim


See Also

See Also
TADCustomMemTable.FetchOnDemand Property
See Also

FetchOptions, TADFetchOptions.Mode


See Also

See Also
TADCustomMemTable.FileName Property
See Also

ResourceOptions, TADBottomResourceOptions.PersistentFileName


Example

Example
TADCustomMemTable.GetOptionalParam Method
var
  dt: Variant;
...
dt := ADMemTable1.GetOptionalParam('last_modified_date');
if VarIsNull(dt) then
  ShowMessage('No modifications were done')
else
  ShowMessage('Last modification was done at ' + DateToStr(dt));


See Also

See Also
TADCustomMemTable.GetOptionalParam Method
See Also

SetOptionalParam


See Also

See Also
TADCustomMemTable.IsClone Property
See Also

CloneSource, TADDataSet.CloneCursor


See Also

See Also
TADCustomMemTable.LogChanges Property
See Also

CachedUpdates


See Also

See Also
TADCustomMemTable.MergeChangeLog Method
See Also

CommitUpdates


See Also

See Also
TADCustomMemTable.PacketRecords Property
See Also

FetchOptions, TADFetchOptions.RowsetSize


See Also

See Also
TADCustomMemTable.ProviderEOF Property
See Also

TADDataSet.SourceEOF


See Also

See Also
TADCustomMemTable.ReadOnly Property
See Also

UpdateOptions, TADUpdateOptions.ReadOnly


See Also

See Also
TADCustomMemTable.SetOptionalParam Method
See Also

GetOptionalParam


Example

Example
TADCustomMemTable Class

See FireDAC\Samples\Comp Layer\TADMemTable\Main sample for details of how to setup TADMemTable.

See FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail sample for details of how to work with master-detail relation.


See Also

See Also
TADCustomMemTable Class
See Also

TADMemTable, TADDatSTable, TADCustomTableAdapter


See Also

See Also
TADCustomMemTable.StatusFilter Property
See Also

FilterChanges


Example

Example
TADCustomMemTable.XMLData Property
var
  s: WideString;
....
  s := ADMemTable1.XMLData;
....
  ADMemTable2.XMLData := s;


See Also

See Also
TADCustomMemTable.XMLData Property
See Also

LoadFromStream, SaveToStream


Example

Example
TADCustomQuery.DataSource Property
MasterQuery.Open('select * from {id Orders}');
MasterSource.DataSet := MasterQuery;
DetailQuery.DataSource := MasterSource;
DetailQuery.Open('select * from {id Order Details} where OrderID = :OrderID');
// here :OrderID parameter of DetailQuery will get the current value of OrderID
// field from MasterQuery


See Also

See Also
TADCustomQuery.DataSource Property
See Also

SQL, Params, ParamByName, TDataSet.BeforeOpen


Example

Example
TADCustomQuery.ExecSQL Method (String, array of Variant, array of TFieldType)
ADQuery1.ExecSQL('insert into mytab (f1, f2) values (:f1, :f2)',
  [100, 'qweqwe'], [ftInteger, ftWideString]);


See Also

See Also
TADCustomQuery.ExecSQL Method (String, array of Variant, array of TFieldType)
See Also

Executing Command, TADRdbmsDataSet.Prepare, TDataSet.Open, SQL, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError, TADDataSet.Execute


Example 1

Example 1
TADCustomQuery.ExecSQL Method (String, array of Variant)
ADQuery1.ExecSQL('insert into mytab (f1, f2) values (:f1, :f2)', [100, 'qweqwe']);


Example 2

Example 2
TADCustomQuery.ExecSQL Method (String, array of Variant)
ADQuery1.SQL.Text := 'insert into mytab (f1, f2) values (:f1, :f2)';
ADQuery1.Params[0].DataType := ftInteger;
ADQuery1.Params[1].DataType := ftWideString;
ADQuery1.ExecSQL('', [100, 'qweqwe']);
ADQuery1.ExecSQL('', [101, 'asdasd']);
ADQuery1.ExecSQL('', [102, 'zxczxc']);


See Also

See Also
TADCustomQuery.ExecSQL Method (String, array of Variant)
See Also

Executing Command, TADRdbmsDataSet.Prepare, TDataSet.Open, SQL, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError, TADDataSet.Execute


Example

Example
TADCustomQuery.ExecSQL Method (String)
ADQuery1.ExecSQL('create table ...');


See Also

See Also
TADCustomQuery.ExecSQL Method (String)
See Also

Executing Command, TADRdbmsDataSet.Prepare, TDataSet.Open, SQL, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError, TADDataSet.Execute


Example 1

Example 1
TADCustomQuery.ExecSQL Method ()
// standard parameterized SQL execution
ADQuery1.SQL.Text := 'insert into mytab values (:id, :name)';
ADQuery1.Params[0].AsInteger := 100;
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.ExecSQL;


Example 2

Example 2
TADCustomQuery.ExecSQL Method ()

See FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\Async demo for asynchronous execution mode.


Example 3

Example 3
TADCustomQuery.ExecSQL Method ()
// avoid [FireDAC][Phys]-310
ADQuery1.SQL.Clear;
ADQuery1.SQL.Add('SELECT f1 INTO @v1 FROM myTab1 WHERE ...;');
ADQuery1.SQL.Add('INSERT INTO myTab2 VALUES (@v1 + 1, ...)');
ADQuery1.Command.CommandKind := skInsert;
ADQuery1.ExecSQL;


See Also

See Also
TADCustomQuery.ExecSQL Method ()
See Also

Executing Command, TADRdbmsDataSet.Prepare, TDataSet.Open, SQL, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError, TADDataSet.Execute


See Also

See Also
TADCustomQuery.ParamCount Property
See Also

Params, SQL, TADResourceOptions.ParamCreate


Example

Example
TADCustomQuery.SQL Property
ADQuery1.SQL.BeginUpdate;
try
  ADQuery1.SQL.Add('SELECT ...');
  ADQuery1.SQL.Add('...');
  ADQuery1.SQL.Add('...');
  ADQuery1.SQL.Add('WHERE ID = :ID');
finally
  ADQuery1.SQL.EndUpdate;
end;
ADQuery1.ParamByName('ID').AsInteger := 100;
ADQuery1.Open;


See Also

See Also
TADCustomQuery.SQL Property
See Also

Executing Command, Preprocessing Command Text, TADRdbmsDataSet.Prepare, TDataSet.Open, ExecSQL, TADResourceOptions.ParamCreate, TADResourceOptions.MacroCreate, TADRdbmsDataSet.ParamBindMode


See Also

See Also
TADCustomQuery Class
See Also

Executing Command, Update Command Generation, TADQuery, TADCustomCommand, uADStanOption


See Also

See Also
TADCustomQuery.Text Property
See Also

SQL, Params


See Also

See Also
TADCustomSchemaAdapter.ApplyUpdates Method
See Also

SchemaAdapter, Reconcile, Caching Updates


See Also

See Also
TADCustomSchemaAdapter.Count Property
See Also

TableAdapters


See Also

See Also
TADCustomSchemaAdapter.Reconcile Method
See Also

Caching Updates, ApplyUpdates


Example

Example
TADCustomSchemaAdapter Class

See demos:

- FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\Centralized

- FireDAC\Samples\Comp Layer\TADSchemaAdapter\MemTable


See Also

See Also
TADCustomSchemaAdapter Class
See Also

Caching Updates, Master-Detail Relationship, TADSchemaAdapter


See Also

See Also
TADCustomSchemaAdapter.TableAdapters Property
See Also

Count


See Also

See Also
TADCustomStoredProc.CatalogName Property
See Also

Object Names, SchemaName, PackageName, Overload, StoredProcName


See Also

See Also
TADCustomStoredProc.DescriptionsAvailable Method
See Also

ExecProc, Params


Example

Example
TADCustomStoredProc.ExecFunc Method (String, array of Variant, array of TFieldType)
var
  v: Variant;
...
v := ADStoredProc1.ExecFunc('myfunc', [100, 'qweqwe'], [ftInteger, ftWideString]);


See Also

See Also
TADCustomStoredProc.ExecFunc Method (String, array of Variant, array of TFieldType)
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


Example 1

Example 1
TADCustomStoredProc.ExecFunc Method (String, array of Variant)
var
  v: Variant;
...
v := ADStoredProc1.ExecFunc('myfunc;2', [100, 'qweqwe']);


Example 2

Example 2
TADCustomStoredProc.ExecFunc Method (String, array of Variant)
var
  v: Variant;
...
ADStoredProc1.StoredProcName := 'myfunc';
ADStoredProc1.Overload := 2;
v := ADStoredProc1.ExecFunc('', [100, 'qweqwe']);
v := ADStoredProc1.ExecFunc('', [101, 'asdasd']);
v := ADStoredProc1.ExecFunc('', [102, 'zxczxc']);


See Also

See Also
TADCustomStoredProc.ExecFunc Method (String, array of Variant)
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


Example

Example
TADCustomStoredProc.ExecFunc Method (String)
var
  v: Variant;
...
v := ADStoredProc1.ExecFunc('myfunc');


See Also

See Also
TADCustomStoredProc.ExecFunc Method (String)
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


Example

Example
TADCustomStoredProc.ExecFunc Method ()
var
  v: Variant;
...
ADStoredProc1.StoredProcName := 'myfunc';
v := ADStoredProc1.ExecFunc;


See Also

See Also
TADCustomStoredProc.ExecFunc Method ()
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


Example

Example
TADCustomStoredProc.ExecProc Method (String, array of Variant, array of TFieldType)
ADStoredProc1.ExecProc('myproc', [100, 'qweqwe'], [ftInteger, ftWideString]);


See Also

See Also
TADCustomStoredProc.ExecProc Method (String, array of Variant, array of TFieldType)
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


Example 1

Example 1
TADCustomStoredProc.ExecProc Method (String, array of Variant)
ADStoredProc1.ExecProc('myproc;2', [100, 'qweqwe']);


Example 2

Example 2
TADCustomStoredProc.ExecProc Method (String, array of Variant)
ADStoredProc1.StoredProcName := 'myproc';
ADStoredProc1.Overload := 2;
ADStoredProc1.ExecProc('', [100, 'qweqwe']);
ADStoredProc1.ExecProc('', [101, 'asdasd']);
ADStoredProc1.ExecProc('', [102, 'zxczxc']);


See Also

See Also
TADCustomStoredProc.ExecProc Method (String, array of Variant)
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


Example

Example
TADCustomStoredProc.ExecProc Method (String)
ADStoredProc1.ExecProc('myproc');


See Also

See Also
TADCustomStoredProc.ExecProc Method (String)
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


Example

Example
TADCustomStoredProc.ExecProc Method ()
ADStoredProc1.StoredProcName := 'myproc';
ADStoredProc1.Prepare;
ADStoredProc1.ParamByName('inval').Value := 100;
ADStoredProc1.ExecProc;
ShowMessage(ADStoredProc1.ParamByName('outval').AsString);


See Also

See Also
TADCustomStoredProc.ExecProc Method ()
See Also

Executing Stored Procedure, TADRdbmsDataSet.Prepare, TDataSet.Open, CatalogName, SchemaName, PackageName, StoredProcName, Overload, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


See Also

See Also
TADCustomStoredProc.Overload Property
See Also

Executing Stored Procedure, Params, StoredProcName


See Also

See Also
TADCustomStoredProc.PackageName Property
See Also

Object Names, CatalogName, SchemaName, Overload, StoredProcName


See Also

See Also
TADCustomStoredProc.ParamCount Property
See Also

Params, SQL, TADResourceOptions.ParamCreate


Example

Example
TADCustomStoredProc.RowsAffected Property
procedure TForm1.ADQuery1AfterExecute(ASender: TObject);
begin
  if ADQuery1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADQuery1.Command1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADQuery1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADQuery1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADQuery1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADQuery1.RowsAffected]);
    end;
end;


See Also

See Also
TADCustomStoredProc.SchemaName Property
See Also

Object Names, CatalogName, PackageName, Overload, StoredProcName


See Also

See Also
TADCustomStoredProc Class
See Also

Executing Stored Procedure, TADStoredProc, TADCustomQuery


Example 1

Example 1
TADCustomStoredProc.StoredProcName Property
ADStoredProc1.StoredProcName := 'Northwind.dbo.[my proc]';
// the same as following
ADStoredProc1.CatalogName := 'Northwind';
ADStoredProc1.SchemaName := 'dbo';
ADStoredProc1.StoredProcName := '[my proc]';


Example 2

Example 2
TADCustomStoredProc.StoredProcName Property
ADStoredProc1.PackageName := 'sys.dbms_sql';
ADStoredProc1.StoredProcName := 'execute';


See Also

See Also
TADCustomStoredProc.StoredProcName Property
See Also

Object Names, Executing Stored Procedure, CatalogName, SchemaName, PackageName, Overload


See Also

See Also
TADCustomTransaction.Active Property
See Also

StartTransaction, Commit, Rollback


See Also

See Also
TADCustomTransaction.AfterCommit Event
See Also

BeforeCommit


See Also

See Also
TADCustomTransaction.AfterRollback Event
See Also

BeforeRollback


See Also

See Also
TADCustomTransaction.AfterStartTransaction Event
See Also

BeforeStartTransaction


See Also

See Also
TADCustomTransaction.BeforeCommit Event
See Also

AfterCommit


See Also

See Also
TADCustomTransaction.BeforeRollback Event
See Also

AfterRollback


See Also

See Also
TADCustomTransaction.BeforeStartTransaction Event
See Also

AfterStartTransaction


Example

Example
TADCustomTransaction.Commit Method
procedure TForm1.ChangeButtonClick(Sender: TObject);
begin
  ADQuery1.Transaction := ADTransaction1;
  ADQuery1.SQL.Text := 'update employees set salary = salary * :k where id = :id';
  ADTransaction1.StartTransaction;
  try
    ADQuery1.ExecSQL('', [1.2, 100]);
    ADQuery1.ExecSQL('', [1.3, 200]);
    ADTransaction1.Commit;
  except
    ADTransaction1.Rollback;
    raise;
  end;
end;


See Also

See Also
TADCustomTransaction.Commit Method
See Also

Managing Transactions, StartTransaction, Active, Rollback, CommitRetaining


Example

Example
TADCustomTransaction.CommitRetaining Method
procedure TForm1.ChangeButtonClick(Sender: TObject);
begin
  ADQuery1.Transaction := ADTransaction1;
  ADQuery1.SQL.Text := 'select * from employees';

  ADQuery2.Transaction := ADTransaction1;
  ADQuery2.SQL.Text := 'update employees set salary = salary * :k where id = :id';

  ADTransaction1.StartTransaction;
  try
    ADQuery1.Open;
    while not ADQuery1.Eof do begin
      ADQuery2.ExecSQL('', [1.2, ADQuery1.FieldByName('id').AsInteger]);
      ADTransaction1.CommitRetaining;
      ADQuery1.Next;
    end;
    ADTransaction1.Commit;
  except
    ADTransaction1.Rollback;
    raise;
  end;
end;


See Also

See Also
TADCustomTransaction.CommitRetaining Method
See Also

Managing Transactions, StartTransaction, Active, Rollback, Commit


See Also

See Also
TADCustomTransaction.Connection Property
See Also

Active


See Also

See Also
TADCustomTransaction.DataSetCount Property
See Also

TADRdbmsDataSet.Transaction, DataSets


See Also

See Also
TADCustomTransaction.DataSets Property
See Also

DataSetCount


Example

Example
TADCustomTransaction.Options Property
ADTransaction1.Options.ReadOnly := True;
ADTransaction1.StartTransaction;


See Also

See Also
TADCustomTransaction.Options Property
See Also

StartTransaction, Commit, Rollback


Example

Example
TADCustomTransaction.Rollback Method
procedure TForm1.ChangeButtonClick(Sender: TObject);
begin
  ADQuery1.Transaction := ADTransaction1;
  ADQuery1.SQL.Text := 'update employees set salary = salary * :k where id = :id';
  ADTransaction1.StartTransaction;
  try
    ADQuery1.ExecSQL('', [1.2, 100]);
    ADQuery1.ExecSQL('', [1.3, 200]);
    ADTransaction1.Commit;
  except
    ADTransaction1.Rollback;
    raise;
  end;
end;


See Also

See Also
TADCustomTransaction.Rollback Method
See Also

Managing Transactions, StartTransaction, Active, Commit, RollbackRetaining


See Also

See Also
TADCustomTransaction.RollbackRetaining Method
See Also

Managing Transactions, StartTransaction, InTransaction, Commit, Rollback


See Also

See Also
TADCustomTransaction Class
See Also

Managing Transactions, Establishing Connection, TADTransaction, TADCustomConnection


Example

Example
TADCustomTransaction.StartTransaction Method
procedure TForm1.ChangeButtonClick(Sender: TObject);
begin
  ADQuery1.Transaction := ADTransaction1;
  ADQuery1.SQL.Text := 'select * from employees';

  ADQuery2.Transaction := ADTransaction1;
  ADQuery2.SQL.Text := 'update employees set salary = salary * :k where id = :id';

  ADTransaction1.Options.Isolation := xiRepeatableRead;
  ADTransaction1.StartTransaction;
  try
    ADQuery1.Open;
    while not ADQuery1.Eof do begin
      ADQuery2.ExecSQL('', [1.2, ADQuery1.FieldByName('id').AsInteger]);
      ADTransaction1.CommitRetaining;
      ADQuery1.Next;
    end;
    ADTransaction1.Commit;
  except
    ADTransaction1.Rollback;
    raise;
  end;
end;


See Also

See Also
TADCustomTransaction.StartTransaction Method
See Also

Managing Transactions, Active, Commit, Rollback, Options


See Also

See Also
TADCustomTransaction.TransactionIntf Property
See Also

IADPhysTransaction


Example 1

Example 1
TADCustomUpdateObject.Apply Method
procedure TfrmCachedUpdates.qrProductsUpdateRecord(ASender: TDataSet;
  ARequest: TADUpdateRequest; var AAction: TADErrorAction;
  AOptions: TADUpdateRowOptions);
begin
  usProducts.ConnectionName := qrProducts.ConnectionName;
  usProducts.DataSet := qrProducts;
  usProducts.Apply(ARequest, AAction, AOptions);

  usCategories.ConnectionName := qrProducts.ConnectionName;
  usCategories.DataSet := qrProducts;
  usCategories.Apply(ARequest, AAction, AOptions);

  AAction := eaApplied;
end;


Example 2

Example 2
TADCustomUpdateObject.Apply Method

See FireDAC\Samples\Comp Layer\TADUpdateSQL\Main demo application.


See Also

See Also
TADCustomUpdateObject.Apply Method
See Also

Overriding Posting Updates, TADUpdateSQL, TADAdaptedDataSet.UpdateObject


See Also

See Also
TADCustomUpdateObject.DataSet Property
See Also

TADDataSet.OnUpdateRecord, TADRdbmsDataSet.Connection, TADRdbmsDataSet.ConnectionName


See Also

See Also
TADCustomUpdateObject Class
See Also

Overriding Posting Updates, TADUpdateSQL


See Also

See Also
TADEventAlerter.Active Property
See Also

Database Alerts, Names, Register, Unregister


See Also

See Also
TADEventAlerter.Connection Property
See Also

Names, Register


Example

Example
TADEventAlerter.Names Property
with ADEventAlerter1 do begin
  Unregister;
  Names.Clear;
  Names.Add('Customers');
  Names.Add('Orders');
  Register;
end;


See Also

See Also
TADEventAlerter.Names Property
See Also

Database Alerts, Register, Active


Example

Example
TADEventAlerter.OnAlert Event
procedure TForm1.ADEventAlerter1Alert(ASender: TADCustomEventAlerter;
    const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh
  else if CompareText(AEventName, 'Orders') = 0 then
    qryOrders.Refresh;
end;


See Also

See Also
TADEventAlerter.OnAlert Event
See Also

Database Alerts, OnTimeout, Names


See Also

See Also
TADEventAlerter.OnTimeout Event
See Also

Database Alerts, OnAlert, Options


See Also

See Also
TADEventAlerter.Options Property
See Also

Database Alerts, TADEventAlerterOptions


Example 1

Example 1
TADEventAlerter Class
ADEventAlerter1.Options.Kind := 'DBMS_ALERT';
ADEventAlerter1.Names.Text := 'Customers';
ADEventAlerter1.Options.Synchronize := True;
ADEventAlerter1.Options.Timeout := 10000;
ADEventAlerter1.OnAlter := DoAlert;
ADEventAlerter1.OnTimeout := DoTimeout;
ADEventAlerter1.Active := True;
........

procedure TForm1.DoAlert(ASender: TADCustomEventAlerter;
  const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh;
end;

procedure TForm1.DoTimeout(ASender: TObject);
begin
  qryCustomers.Refresh;
end;


Example 2

Example 2
TADEventAlerter Class

See the demo at: FireDAC\Samples\Comp Layer\TADEventAlerter\Main


See Also

See Also
TADEventAlerter Class
See Also

Database Alerts, TADCustomEventAlerter


See Also

See Also
TADLocalSQLDataSet.ActualName Property
See Also

Name, DataSet


See Also

See Also
TADLocalSQLDataSet.Adapter Property
See Also

Local SQL, DataSet


See Also

See Also
TADLocalSQLDataSet.DataSet Property
See Also

Local SQL, Name, Adapter


See Also

See Also
TADLocalSQLDataSet.IsValid Property
See Also

DataSet, ActualName


See Also

See Also
TADLocalSQLDataSet.Name Property
See Also

Local SQL, DataSet


See Also

See Also
TADLocalSQLDataSet Class
See Also

Local SQL, TADLocalSQLDataSets, TADCustomLocalSQL, TADAdaptedDataSet.LocalSQL


Example

Example
TADLocalSQLDataSets.Add Method (TDataSet, String, IADPhysLocalQueryAdapter)
ADLocalSQL1.DataSets.Add(ADQuery1, 'Orders');
ADLocalSQL1.Active := True;


See Also

See Also
TADLocalSQLDataSets.Add Method (TDataSet, String, IADPhysLocalQueryAdapter)
See Also

Items, TCollection.Count


Example

Example
TADLocalSQLDataSets.Add Method ()
with ADLocalSQL1.DataSets.Add do begin
  DataSet := ADQuery1;
  Name := 'Orders';
end;
ADLocalSQL1.Active := True;


See Also

See Also
TADLocalSQLDataSets.Add Method ()
See Also

Items, TCollection.Count


See Also

See Also
TADLocalSQLDataSets.Items Property
See Also

TADLocalSQLDataSet, TCollection.Count


See Also

See Also
TADLocalSQLDataSets Class
See Also

Local SQL, TADLocalSQLDataSet


See Also

See Also
TADManager.Active Property
See Also

DriverDefFileAutoLoad, DriverDefFileName, Open, Close


See Also

See Also
TADManager.AfterLoadConnectionDefFile Event
See Also

BeforeLoadConnectionDefFile


See Also

See Also
TADManager.AfterShutdown Event
See Also

Active, Close, BeforeShutdown


See Also

See Also
TADManager.AfterStartup Event
See Also

Active, Open, BeforeStartup


See Also

See Also
TADManager.BeforeLoadConnectionDefFile Event
See Also

AfterLoadConnectionDefFile


See Also

See Also
TADManager.BeforeShutdown Event
See Also

Multi Threading, Active, Close, AfterShutdown


See Also

See Also
TADManager.BeforeStartup Event
See Also

Active, Open, AfterStartup


See Also

See Also
TADManager.ConnectionDefFileAutoLoad Property
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileLoaded, ConnectionDefFileName, LoadConnectionDefFile


Example 1

Example 1
TADManager.ConnectionDefFileName Property
ADManager.ConnectionDefFileName := ExtractFilePath(Application.ExeName) + 'myconndef.ini';
ADManager.ConnectionDefFileAutoLoad := True;
oConn := TADConnection.Create(nil);
oConn.ConnectionDefName := 'myconn';
oConn.Connected := True;


Example 2

Example 2
TADManager.ConnectionDefFileName Property
procedure TMyDataModule.DoBeforeLoad(ASender: TNotifyEvent);
begin
  ADManager.ConnectionDefFileName := FSettings.MyConnectionDefFile;
end;
...
ADManager.BeforeLoadConnectionDefFile := DoBeforeLoad;


See Also

See Also
TADManager.ConnectionDefFileName Property
See Also

Defining Connection, ConnectionDefs, ConnectionDefFileAutoLoad, ConnectionDefFileLoaded, ActualConnectionDefFileName


See Also

See Also
TADManager.DriverDefFileAutoLoad Property
See Also

Configuring Drivers, DriverDefFileName


See Also

See Also
TADManager.DriverDefFileName Property
See Also

Configuring Drivers, DriverDefFileAutoLoad, ActualDriverDefFileName


See Also

See Also
TADManager.FetchOptions Property
See Also

Setting Options, FormatOptions, UpdateOptions, ResourceOptions


See Also

See Also
TADManager.FormatOptions Property
See Also

Setting Options, FetchOptions, UpdateOptions, ResourceOptions


See Also

See Also
TADManager.ResourceOptions Property
See Also

Setting Options, FetchOptions, UpdateOptions, FormatOptions


See Also

See Also
TADManager.SilentMode Property
See Also

TADResourceOptions.SilentMode, WaitCursor


See Also

See Also
TADManager Class
See Also

Defining Connection, TADCustomManager, ADManager


See Also

See Also
TADManager.UpdateOptions Property
See Also

Setting Options, FetchOptions, ResourceOptions, FormatOptions


See Also

See Also
TADManager.WaitCursor Property
See Also

SilentMode


See Also

See Also
TADMemTable.ActiveStoredUsage Property
See Also

TDataSet.Active


Example

Example
TADMemTable.Adapter Property


See Also

See Also
TADMemTable.Adapter Property
See Also

List here...


See Also

See Also
TADMemTable.AfterApplyUpdates Event
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates


See Also

See Also
TADMemTable.AfterExecute Event
See Also

TADDataSetEvent, Execute, BeforeExecute


See Also

See Also
TADMemTable.AfterGetRecord Event
See Also

AfterGetRecords


See Also

See Also
TADMemTable.AfterGetRecords Event
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord


See Also

See Also
TADMemTable.AfterRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest


Example 1

Example 1
TADMemTable.Aggregates Property
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);


Example 2

Example 2
TADMemTable.Aggregates Property

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.


See Also

See Also
TADMemTable.Aggregates Property
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch


Example

Example
TADMemTable.AggregatesActive Property
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;


See Also

See Also
TADMemTable.AggregatesActive Property
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch


See Also

See Also
TADMemTable.BeforeApplyUpdates Event
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates


See Also

See Also
TADMemTable.BeforeExecute Event
See Also

TADDataSetEvent, Execute, AfterExecute


See Also

See Also
TADMemTable.BeforeGetRecords Event
See Also

TADDataSetEvent, AfterGetRecords


See Also

See Also
TADMemTable.BeforeRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest


Example

Example
TADMemTable.CachedUpdates Property
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;


See Also

See Also
TADMemTable.CachedUpdates Property
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates


Example

Example
TADMemTable.Constraints Property
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;


See Also

See Also
TADMemTable.Constraints Property
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint


Example

Example
TADMemTable.ConstraintsEnabled Property
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;


See Also

See Also
TADMemTable.ConstraintsEnabled Property
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired


Example

Example
TADMemTable.DetailFields Property
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';


See Also

See Also
TADMemTable.DetailFields Property
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName


See Also

See Also
TADMemTable.FetchOptions Property
See Also

Setting Options, TADFetchOptions


Example

Example
TADMemTable.FilterChanges Property
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];


See Also

See Also
TADMemTable.FilterChanges Property
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus


See Also

See Also
TADMemTable.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Params


See Also

See Also
TADMemTable.IndexDefs Property
See Also

Sorting Records, Indexes, TADFetchOptions.Items


Example 1

Example 1
TADMemTable.Indexes Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';


Example 2

Example 2
TADMemTable.Indexes Property

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.


See Also

See Also
TADMemTable.Indexes Property
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch


Example

Example
TADMemTable.IndexesActive Property
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;


See Also

See Also
TADMemTable.IndexesActive Property
See Also

Sorting Records, Indexes, BeginBatch, EndBatch


Example

Example
TADMemTable.IndexFieldNames Property
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';


See Also

See Also
TADMemTable.IndexFieldNames Property
See Also

Sorting Records, Indexes, IndexName


Example

Example
TADMemTable.IndexName Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';


See Also

See Also
TADMemTable.IndexName Property
See Also

Sorting Records, Indexes, IndexFieldNames


See Also

See Also
TADMemTable.LocalSQL Property
See Also

Local SQL, TADLocalSQL, TADMemTable


Example

Example
TADMemTable.MasterFields Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


See Also

See Also
TADMemTable.MasterFields Property
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName


Example 1

Example 1
TADMemTable.MasterSource Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


Example 2

Example 2
TADMemTable.MasterSource Property

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.


See Also

See Also
TADMemTable.MasterSource Property
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName


Example

Example
TADMemTable.OnReconcileError Event
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;


See Also

See Also
TADMemTable.OnReconcileError Event
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError


Example

Example
TADMemTable.OnUpdateError Event
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;


See Also

See Also
TADMemTable.OnUpdateError Event
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord


Example 1

Example 1
TADMemTable.OnUpdateRecord Event
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;


Example 2

Example 2
TADMemTable.OnUpdateRecord Event

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main


See Also

See Also
TADMemTable.OnUpdateRecord Event
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError


See Also

See Also
TADMemTable.ResourceOptions Property
See Also

Setting Options, TADBottomResourceOptions


Example

Example
TADMemTable Class

See FireDAC\Samples\Comp Layer\TADMemTable\Main sample for details of how to setup TADMemTable.

See FireDAC\Samples\Comp Layer\TADMemTable\MasterDetail sample for details of how to work with master-detail relation.


See Also

See Also
TADMemTable Class
See Also

TADDataSet, TADCustomMemTable


See Also

See Also
TADMemTable.UpdateOptions Property
See Also

Setting Options, TADBottomUpdateOptions


Example

Example
TADMetaInfoCommand.Active Property
ADCommand1.CommandText.Text := 'select * from "Orders"';
ADCommand1.Active := True;
oTab := ADCommand1.Define;
try
  ADCommand1.Fetch(oTab);
  ....
finally
  oTab.Free;
end;


See Also

See Also
TADMetaInfoCommand.Active Property
See Also

Fetch, Define, Open, Close, CloseAll, State


See Also

See Also
TADMetaInfoCommand.AfterClose Event
See Also

BeforeClose, Close, Active


See Also

See Also
TADMetaInfoCommand.AfterOpen Event
See Also

BeforeOpen, Open, Active


Example 1

Example 1
TADMetaInfoCommand.BaseObjectName Property
// SQL Server: retrieve foreign key fields for FK_DEPARTMENTS constraint of the Northwind.dbo.Employees table
var
  oTab: TADDatSTable;
....
  ADMetaInfoCommand1.BaseObjectName := 'Northwind.dbo.Employees';
  ADMetaInfoCommand1.ObjectName := 'FK_DEPARTMENTS';
  ADMetaInfoCommand1.MetaInfoKind := mkForeignKeyFields;
  ADMetaInfoCommand1.Define(oTab);
  ADMetaInfoCommand1.Open(oTab);
  ADMetaInfoCommand1.Fetch(oTab, True);


Example 2

Example 2
TADMetaInfoCommand.BaseObjectName Property
// Oracle: retrieve procedure list for the SYS.DBMS_SQL package
var
  oTab: TADDatSTable;
....
  ADMetaInfoCommand1.BaseObjectName := 'SYS.DBMS_SQL';
  ADMetaInfoCommand1.MetaInfoKind := mkProcs;
  ADMetaInfoCommand1.Define(oTab);
  ADMetaInfoCommand1.Open(oTab);
  ADMetaInfoCommand1.Fetch(oTab, True);


See Also

See Also
TADMetaInfoCommand.BaseObjectName Property
See Also

MetaInfoKind, CatalogName, SchemaName, ObjectName


See Also

See Also
TADMetaInfoCommand.BeforeClose Event
See Also

AfterClose, Close, Active


See Also

See Also
TADMetaInfoCommand.BeforeOpen Event
See Also

AfterOpen, Open, Active


Example 1

Example 1
TADMetaInfoCommand.CatalogName Property
ADCommand1.CatalogName := 'MY_APP';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;


Example 2

Example 2
TADMetaInfoCommand.CatalogName Property
ADMetaInfoCommand1.CatalogName := 'MY_APP';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on SQL Server just ADMetaInfoCommand1.ObjectName := 'MY_APP..MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;


See Also

See Also
TADMetaInfoCommand.CatalogName Property
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName


See Also

See Also
TADMetaInfoCommand.Connection Property
See Also

ConnectionName, Prepare


See Also

See Also
TADMetaInfoCommand.ConnectionName Property
See Also

Connection, Prepare


See Also

See Also
TADMetaInfoCommand.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Fetch, Params


Example

Example
TADMetaInfoCommand.MetaInfoKind Property


See Also

See Also
TADMetaInfoCommand.MetaInfoKind Property
See Also

CatalogName, SchemaName, BaseObjectName, Overload, ObjectName


Example

Example
TADMetaInfoCommand.ObjectName Property
var
  oTab: TADDatSTable;
....
  ADMetaInfoCommand1.CatalogName := 'Northwind';
  ADMetaInfoCommand1.SchemaName := 'dbo';
  ADMetaInfoCommand1.ObjectName := 'Employees';
  ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
  ADMetaInfoCommand1.Define(oTab);
  ADMetaInfoCommand1.Open(oTab);
  ADMetaInfoCommand1.Fetch(oTab, True);


See Also

See Also
TADMetaInfoCommand.ObjectName Property
See Also

MetaInfoKind, CatalogName, SchemaName, BaseObjectName


See Also

See Also
TADMetaInfoCommand.ObjectScopes Property
See Also

TableKinds


Example

Example
TADMetaInfoCommand.OnCommandChanged Event
procedure TForm1.ADCommand1CommandChanged(ASender: TObject);
begin
  if ADCommand1.FindParam('ID') <> nil then
    ADCommand1.FindParams('ID').AsInteger := 100;
end;


See Also

See Also
TADMetaInfoCommand.OnCommandChanged Event
See Also

CommandText


Example 1

Example 1
TADMetaInfoCommand.OnError Event

Handling Array DML errors:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;


Example 2

Example 2
TADMetaInfoCommand.OnError Event

Error substitution:

procedure TForm1.ADCommand1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;


See Also

See Also
TADMetaInfoCommand.OnError Event
See Also

Handling Errors, Array DML, Open, Execute, Prepare, Fetch, EADDBArrayExecuteError class, EADDBEngineException class


Example

Example
TADMetaInfoCommand.Overload Property
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'DBMS_SQL.PARSE';
ADCommand1.Overload := 1;


See Also

See Also
TADMetaInfoCommand.Overload Property
See Also

CommandText, CommandKind


Example 1

Example 1
TADMetaInfoCommand.SchemaName Property
ADCommand1.SchemaName := 'SCOTT';
ADCommand1.CommandText.Text := 'PROC1';
ADCommand1.CommandKind := skStoredProc;
ADCommand1.Prepare;
ADCommand1.Params[0].AsInteger := 100;
ADCommand1.Params[1].AsString := 'Bill Gates';
ADCommand1.Execute;


Example 2

Example 2
TADMetaInfoCommand.SchemaName Property
ADMetaInfoCommand1.SchemaName := 'ADDEMO';
ADMetaInfoCommand1.ObjectName := 'MY_TAB';
// or on Oracle just ADMetaInfoCommand1.ObjectName := 'ADDEMO.MY_TAB';
ADMetaInfoCommand1.MetaInfoKind := mkTableFields;
ADMetaInfoCommand1.Open;


See Also

See Also
TADMetaInfoCommand.SchemaName Property
See Also

CommandKind, TADMetaInfoCommand.MetaInfoKind, SchemaName


See Also

See Also
TADMetaInfoCommand Class
See Also

Working with Metadata, TADCustomCommand, IADPhysCommand, TADMetaInfoQuery


See Also

See Also
TADMetaInfoCommand.TableKinds Property
See Also

ObjectScopes


See Also

See Also
TADMetaInfoCommand.Wildcard Property
See Also

ObjectScopes, TableKinds


See Also

See Also
TADMetaInfoQuery.ActiveStoredUsage Property
See Also

TDataSet.Active


See Also

See Also
TADMetaInfoQuery.AfterGetRecord Event
See Also

AfterGetRecords


See Also

See Also
TADMetaInfoQuery.AfterGetRecords Event
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord


See Also

See Also
TADMetaInfoQuery.AfterRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest


Example 1

Example 1
TADMetaInfoQuery.Aggregates Property
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);


Example 2

Example 2
TADMetaInfoQuery.Aggregates Property

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.


See Also

See Also
TADMetaInfoQuery.Aggregates Property
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch


Example

Example
TADMetaInfoQuery.AggregatesActive Property
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;


See Also

See Also
TADMetaInfoQuery.AggregatesActive Property
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch


Example 1

Example 1
TADMetaInfoQuery.BaseObjectName Property
  // SQL Server: retrieve foreign key fields for FK_DEPARTMENTS constraint of the Northwind.dbo.Employees table
  ADMetaInfoQuery1.BaseObjectName := 'Northwind.dbo.Employees';
  ADMetaInfoQuery1.ObjectName := 'FK_DEPARTMENTS';
  ADMetaInfoQuery1.MetaInfoKind := mkForeignKeyFields;
  ADMetaInfoQuery1.Open;


Example 2

Example 2
TADMetaInfoQuery.BaseObjectName Property
  // Oracle: retrieve procedure list for the SYS.DBMS_SQL package
  ADMetaInfoQuery1.BaseObjectName := 'SYS.DBMS_SQL';
  ADMetaInfoQuery1.MetaInfoKind := mkProcs;
  ADMetaInfoQuery1.Open;


See Also

See Also
TADMetaInfoQuery.BaseObjectName Property
See Also

MetaInfoKind, CatalogName, SchemaName, ObjectName


See Also

See Also
TADMetaInfoQuery.BeforeGetRecords Event
See Also

TADDataSetEvent, AfterGetRecords


See Also

See Also
TADMetaInfoQuery.BeforeRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest


See Also

See Also
TADMetaInfoQuery.CatalogName Property
See Also

SchemaName, ObjectScopes


See Also

See Also
TADMetaInfoQuery.Connection Property
See Also

ConnectionName


Example

Example
TADMetaInfoQuery.ConnectionName Property
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');


See Also

See Also
TADMetaInfoQuery.ConnectionName Property
See Also

Connection, TADCustomConnection.Temporary


See Also

See Also
TADMetaInfoQuery.FetchOptions Property
See Also

Setting Options, TADFetchOptions


See Also

See Also
TADMetaInfoQuery.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Params


Example 1

Example 1
TADMetaInfoQuery.Indexes Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';


Example 2

Example 2
TADMetaInfoQuery.Indexes Property

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.


See Also

See Also
TADMetaInfoQuery.Indexes Property
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch


Example

Example
TADMetaInfoQuery.IndexesActive Property
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;


See Also

See Also
TADMetaInfoQuery.IndexesActive Property
See Also

Sorting Records, Indexes, BeginBatch, EndBatch


Example

Example
TADMetaInfoQuery.IndexFieldNames Property
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';


See Also

See Also
TADMetaInfoQuery.IndexFieldNames Property
See Also

Sorting Records, Indexes, IndexName


Example

Example
TADMetaInfoQuery.IndexName Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';


See Also

See Also
TADMetaInfoQuery.IndexName Property
See Also

Sorting Records, Indexes, IndexFieldNames


See Also

See Also
TADMetaInfoQuery.LocalSQL Property
See Also

Local SQL, TADLocalSQL, TADMemTable


Example

Example
TADMetaInfoQuery.MetaInfoKind Property
  // get the table list for Northwind catalog, dbo schema
  ADMetaInfoQuery1.CatalogName := 'Northwind';
  ADMetaInfoQuery1.SchemaName := 'dbo';
  ADMetaInfoQuery1.MetaInfoKind := mkTables;
  ADMetaInfoQuery1.Open;


See Also

See Also
TADMetaInfoQuery.MetaInfoKind Property
See Also

Working with Metadata, CatalogName, SchemaName, BaseObjectName, Overload, ObjectName


Example

Example
TADMetaInfoQuery.ObjectName Property
  // get the field list of Northwind.dbo.Employees table
  ADMetaInfoQuery1.CatalogName := 'Northwind';
  ADMetaInfoQuery1.SchemaName := 'dbo';
  ADMetaInfoQuery1.ObjectName := 'Employees';
  ADMetaInfoQuery1.MetaInfoKind := mkTableFields;
  ADMetaInfoQuery1.Open;


See Also

See Also
TADMetaInfoQuery.ObjectName Property
See Also

Working with Metadata, MetaInfoKind, CatalogName, SchemaName, BaseObjectName


See Also

See Also
TADMetaInfoQuery.ObjectScopes Property
See Also

TableKinds, CatalogName, SchemaName


See Also

See Also
TADMetaInfoQuery.OnCommandChanged Event
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName


Example 1

Example 1
TADMetaInfoQuery.OnError Event

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;


Example 2

Example 2
TADMetaInfoQuery.OnError Event

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;


See Also

See Also
TADMetaInfoQuery.OnError Event
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError


See Also

See Also
TADMetaInfoQuery.ResourceOptions Property
See Also

Setting Options, TADBottomResourceOptions


Example

Example
TADMetaInfoQuery.SchemaAdapter Property
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;


See Also

See Also
TADMetaInfoQuery.SchemaAdapter Property
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade


See Also

See Also
TADMetaInfoQuery.SchemaName Property
See Also

CatalogName, ObjectScopes


Example

Example
TADMetaInfoQuery Class

See FireDAC\Samples\Comp Layer\TADMetaInfoQuery\Main sample for details.


See Also

See Also
TADMetaInfoQuery Class
See Also

Working with Metadata, TADMetaInfoCommand


See Also

See Also
TADMetaInfoQuery.TableKinds Property
See Also

Working with Metadata, ObjectScopes, CatalogName, SchemaName


See Also

See Also
TADMetaInfoQuery.Transaction Property
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction


Example

Example
TADMetaInfoQuery.UpdateTransaction Property
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction


See Also

See Also
TADMetaInfoQuery.UpdateTransaction Property
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction


See Also

See Also
TADMetaInfoQuery.Wildcard Property
See Also

ObjectScopes, TableKinds


See Also

See Also
TADQuery.ActiveStoredUsage Property
See Also

TDataSet.Active


See Also

See Also
TADQuery.AfterApplyUpdates Event
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates


See Also

See Also
TADQuery.AfterExecute Event
See Also

TADDataSetEvent, Execute, BeforeExecute


See Also

See Also
TADQuery.AfterGetRecord Event
See Also

AfterGetRecords


See Also

See Also
TADQuery.AfterGetRecords Event
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord


See Also

See Also
TADQuery.AfterRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest


Example 1

Example 1
TADQuery.Aggregates Property
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);


Example 2

Example 2
TADQuery.Aggregates Property

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.


See Also

See Also
TADQuery.Aggregates Property
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch


Example

Example
TADQuery.AggregatesActive Property
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;


See Also

See Also
TADQuery.AggregatesActive Property
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch


See Also

See Also
TADQuery.BeforeApplyUpdates Event
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates


See Also

See Also
TADQuery.BeforeExecute Event
See Also

TADDataSetEvent, Execute, AfterExecute


See Also

See Also
TADQuery.BeforeGetRecords Event
See Also

TADDataSetEvent, AfterGetRecords


See Also

See Also
TADQuery.BeforeRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest


Example

Example
TADQuery.CachedUpdates Property
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;


See Also

See Also
TADQuery.CachedUpdates Property
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates


See Also

See Also
TADQuery.Connection Property
See Also

ConnectionName


Example

Example
TADQuery.ConnectionName Property
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');


See Also

See Also
TADQuery.ConnectionName Property
See Also

Connection, TADCustomConnection.Temporary


Example

Example
TADQuery.Constraints Property
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;


See Also

See Also
TADQuery.Constraints Property
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint


Example

Example
TADQuery.ConstraintsEnabled Property
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;


See Also

See Also
TADQuery.ConstraintsEnabled Property
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired


Example

Example
TADQuery.DetailFields Property
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';


See Also

See Also
TADQuery.DetailFields Property
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName


See Also

See Also
TADQuery.FetchOptions Property
See Also

Setting Options, TADFetchOptions


Example

Example
TADQuery.FilterChanges Property
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];


See Also

See Also
TADQuery.FilterChanges Property
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus


See Also

See Also
TADQuery.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Params


Example 1

Example 1
TADQuery.Indexes Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';


Example 2

Example 2
TADQuery.Indexes Property

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.


See Also

See Also
TADQuery.Indexes Property
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch


Example

Example
TADQuery.IndexesActive Property
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;


See Also

See Also
TADQuery.IndexesActive Property
See Also

Sorting Records, Indexes, BeginBatch, EndBatch


Example

Example
TADQuery.IndexFieldNames Property
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';


See Also

See Also
TADQuery.IndexFieldNames Property
See Also

Sorting Records, Indexes, IndexName


Example

Example
TADQuery.IndexName Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';


See Also

See Also
TADQuery.IndexName Property
See Also

Sorting Records, Indexes, IndexFieldNames


See Also

See Also
TADQuery.LocalSQL Property
See Also

Local SQL, TADLocalSQL, TADMemTable


See Also

See Also
TADQuery.MacroCount Property
See Also

Macros


Example 1

Example 1
TADQuery.Macros Property

Substitute table name:

ADQuery1.SQL.Text := 'select * from &Tab';
ADQuery1.Macros[0].AsIdentifier := 'Order Details';
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from "Order Details"


Example 2

Example 2
TADQuery.Macros Property

Substitute WHERE condition:

ADQuery1.SQL.Text := 'select * from MyTab {if !cond} where !cond {fi}';

ADQuery1.Macros[0].AsString := 'ID > 100';
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from MyTab where ID > 100

ADQuery1.Macros[0].Clear;
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from MyTab


Example 3

Example 3
TADQuery.Macros Property

See FireDAC\Samples\Comp Layer\TADQuery\Macros demo for details.


See Also

See Also
TADQuery.Macros Property
See Also

TADCustomQuery.SQL, Params, Prepare, TADMacros, TADResourceOptions.MacroCreate, TADResourceOptions.MacroExpand


Example

Example
TADQuery.MasterFields Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


See Also

See Also
TADQuery.MasterFields Property
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName


Example 1

Example 1
TADQuery.MasterSource Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


Example 2

Example 2
TADQuery.MasterSource Property

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.


See Also

See Also
TADQuery.MasterSource Property
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName


See Also

See Also
TADQuery.OnCommandChanged Event
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName


Example 1

Example 1
TADQuery.OnError Event

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;


Example 2

Example 2
TADQuery.OnError Event

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;


See Also

See Also
TADQuery.OnError Event
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError


Example

Example
TADQuery.OnExecuteError Event
procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AError: EADDBEngineException; var AAction: TADErrorAction);
begin
  if AException.Errors[0].Kind = ekUKViolated then
    AAction := eaSkip
  else
    AAction := eaFail;
end;


See Also

See Also
TADQuery.OnExecuteError Event
See Also

Array DML, EADDBEngineException, TADErrorAction, TADDataSet.Execute


See Also

See Also
TADQuery.OnMasterSetValues Event
See Also

Master-Detail Relationship, MasterSource, MasterFields


Example

Example
TADQuery.OnReconcileError Event
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;


See Also

See Also
TADQuery.OnReconcileError Event
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError


Example

Example
TADQuery.OnUpdateError Event
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;


See Also

See Also
TADQuery.OnUpdateError Event
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord


Example 1

Example 1
TADQuery.OnUpdateRecord Event
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;


Example 2

Example 2
TADQuery.OnUpdateRecord Event

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main


See Also

See Also
TADQuery.OnUpdateRecord Event
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError


Example 1

Example 1
TADQuery.Params Property
// TADQuery automatic parameters creation - ResourceOptions.ParamCreate = True
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.Open;


Example 2

Example 2
TADQuery.Params Property
// TADQuery manual parameters creation - ResourceOptions.ParamCreate = False
ADQuery1.ResourceOptions.ParamCreate := False;
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
with ADQuery1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
  AsString := 'qwe';
end;
ADQuery1.Open;


Example 3

Example 3
TADQuery.Params Property
// TADStoredProc automatic parameters creation - fiMeta in FetchOptions.Items
ADStoredProc1.StoredProcName := 'my_proc';
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;


Example 4

Example 4
TADQuery.Params Property
// TADStoredProc manual parameters creation - fiMeta not in FetchOptions.Items
ADStoredProc1.FetchOptions.Items := ADStoredProc1.FetchOptions.Items - [fiMeta];
ADStoredProc1.StoredProcName := 'my_proc';
with ADStoredProc1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
end;
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;


See Also

See Also
TADQuery.Params Property
See Also

Executing Command, Executing Stored Procedure, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items


See Also

See Also
TADQuery.ResourceOptions Property
See Also

Setting Options, TADBottomResourceOptions


Example

Example
TADQuery.RowsAffected Property
procedure TForm1.ADQuery1AfterExecute(ASender: TObject);
begin
  if ADQuery1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADQuery1.Command1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADQuery1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADQuery1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADQuery1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADQuery1.RowsAffected]);
    end;
end;


Example

Example
TADQuery.SchemaAdapter Property
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;


See Also

See Also
TADQuery.SchemaAdapter Property
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade


Example

Example
TADQuery.SQL Property
ADQuery1.SQL.BeginUpdate;
try
  ADQuery1.SQL.Add('SELECT ...');
  ADQuery1.SQL.Add('...');
  ADQuery1.SQL.Add('...');
  ADQuery1.SQL.Add('WHERE ID = :ID');
finally
  ADQuery1.SQL.EndUpdate;
end;
ADQuery1.ParamByName('ID').AsInteger := 100;
ADQuery1.Open;


See Also

See Also
TADQuery.SQL Property
See Also

Executing Command, Preprocessing Command Text, TADRdbmsDataSet.Prepare, TDataSet.Open, ExecSQL, TADResourceOptions.ParamCreate, TADResourceOptions.MacroCreate, TADRdbmsDataSet.ParamBindMode


See Also

See Also
TADQuery Class
See Also

Executing Command, TADCommand, TADCustomQuery, IADPhysCommand


See Also

See Also
TADQuery.Transaction Property
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction


Example 1

Example 1
TADQuery.UpdateObject Property
ADUpdateSQL1.InsertSQL.Text := 'insert into mytab values (:new_id, :new_name)';
ADQuery1.UpdateObject := ADUpdateSQL1;
ADQuery1.Append;
ADQuery1['id'] := 100;
ADQuery1['name'] := 'qwe';
ADQuery1.Post;


Example 2

Example 2
TADQuery.UpdateObject Property

Demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.


See Also

See Also
TADQuery.UpdateObject Property
See Also

OnUpdateRecord, TADUpdateSQL


See Also

See Also
TADQuery.UpdateOptions Property
See Also

Setting Options, TADBottomUpdateOptions


Example

Example
TADQuery.UpdateTransaction Property
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction


See Also

See Also
TADQuery.UpdateTransaction Property
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction


See Also

See Also
TADRdbmsDataSet.Connection Property
See Also

ConnectionName


Example

Example
TADRdbmsDataSet.ConnectionName Property
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');


See Also

See Also
TADRdbmsDataSet.ConnectionName Property
See Also

Connection, TADCustomConnection.Temporary


Example

Example
TADRdbmsDataSet.Disconnect Method
ADQuery1.Disconnect(True);
// is equivalent to:
// ADQuery1.AbortJob(True);
// ADQuery1.Close;
// ADQuery1.Unprepare;


See Also

See Also
TADRdbmsDataSet.Disconnect Method
See Also

AbortJob


See Also

See Also
TADRdbmsDataSet.FetchOptions Property
See Also

Setting Options, TADFetchOptions


See Also

See Also
TADRdbmsDataSet.FindMacro Method
See Also

Macros, MacroByName


See Also

See Also
TADRdbmsDataSet.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Params


See Also

See Also
TADRdbmsDataSet.MacroByName Method
See Also

Macros, FindMacro


See Also

See Also
TADRdbmsDataSet.MacroCount Property
See Also

Macros


Example 1

Example 1
TADRdbmsDataSet.Macros Property

Substitute table name:

ADQuery1.SQL.Text := 'select * from &Tab';
ADQuery1.Macros[0].AsIdentifier := 'Order Details';
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from "Order Details"


Example 2

Example 2
TADRdbmsDataSet.Macros Property

Substitute WHERE condition:

ADQuery1.SQL.Text := 'select * from MyTab {if !cond} where !cond {fi}';

ADQuery1.Macros[0].AsString := 'ID > 100';
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from MyTab where ID > 100

ADQuery1.Macros[0].Clear;
ADQuery1.Prepare;
ShowMessage(ADQuery1.SQLText); // select * from MyTab


Example 3

Example 3
TADRdbmsDataSet.Macros Property

See FireDAC\Samples\Comp Layer\TADQuery\Macros demo for details.


See Also

See Also
TADRdbmsDataSet.Macros Property
See Also

TADCustomQuery.SQL, Params, Prepare, TADMacros, TADResourceOptions.MacroCreate, TADResourceOptions.MacroExpand


See Also

See Also
TADRdbmsDataSet.OnCommandChanged Event
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName


Example 1

Example 1
TADRdbmsDataSet.OnError Event

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;


Example 2

Example 2
TADRdbmsDataSet.OnError Event

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;


See Also

See Also
TADRdbmsDataSet.OnError Event
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError


Example

Example
TADRdbmsDataSet.Open Method (String, array of Variant, array of TFieldType)
ADQuery1.Open('select * from Employees where department_id = :id', [100], [ftInteger]);


See Also

See Also
TADRdbmsDataSet.Open Method (String, array of Variant, array of TFieldType)
See Also

Prepare, TDataSet.Open, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


Example

Example
TADRdbmsDataSet.Open Method (String, array of Variant)
ADQuery1.Open('select * from Employees where department_id = :id', [100]);
....
ADQuery1.Open('', [101]); // executes the above SQL command, but for ID = 101
....
ADQuery1.Open('', [102]); // executes the above SQL command, but for ID = 101
....


See Also

See Also
TADRdbmsDataSet.Open Method (String, array of Variant)
See Also

Prepare, TDataSet.Open, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


Example

Example
TADRdbmsDataSet.Open Method (String)
ADQuery1.Open('select * from customers');


See Also

See Also
TADRdbmsDataSet.Open Method (String)
See Also

Prepare, TDataSet.Open, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


See Also

See Also
TADRdbmsDataSet.ParamBindMode Property
See Also

Params


Example

Example
TADRdbmsDataSet.Prepare Method
ADQuery1.SQL.Text := 'select * from MyTab';
ADQuery1.Prepare;


See Also

See Also
TADRdbmsDataSet.Prepare Method
See Also

Prepared, Unprepare, Params


See Also

See Also
TADRdbmsDataSet.Prepared Property
See Also

Prepare, Unprepare, Params


See Also

See Also
TADRdbmsDataSet.ResourceOptions Property
See Also

Setting Options, TADBottomResourceOptions


Example

Example
TADRdbmsDataSet.RowsAffected Property
procedure TForm1.ADQuery1AfterExecute(ASender: TObject);
begin
  if ADQuery1.RowsAffected = -1 then
    StatusBar1.SimpleText := 'Ok'
  else
    case ADQuery1.Command1.CommandKind of
    skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADQuery1.RowsAffected]);
    skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADQuery1.RowsAffected]);
    skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADQuery1.RowsAffected]);
    else      StatusBar1.SimpleText := Format('%d rows affected', [ADQuery1.RowsAffected]);
    end;
end;


Example

Example
TADRdbmsDataSet.SchemaAdapter Property
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;


See Also

See Also
TADRdbmsDataSet.SchemaAdapter Property
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade


See Also

See Also
TADRdbmsDataSet Class
See Also

TADAdaptedDataSet, TADCustomQuery, TADCustomStoredProc, TADMetaInfoQuery, uADStanOption


See Also

See Also
TADRdbmsDataSet.Transaction Property
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction


See Also

See Also
TADRdbmsDataSet.Unprepare Method
See Also

Prepare, Prepared


See Also

See Also
TADRdbmsDataSet.UpdateOptions Property
See Also

Setting Options, TADBottomUpdateOptions


Example

Example
TADRdbmsDataSet.UpdateTransaction Property
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction


See Also

See Also
TADRdbmsDataSet.UpdateTransaction Property
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction


Example

Example
TADSchemaAdapter Class

See demos:

- FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\Centralized

- FireDAC\Samples\Comp Layer\TADSchemaAdapter\MemTable


See Also

See Also
TADSchemaAdapter Class
See Also

Caching Updates, Master-Detail Relationship, TADCustomSchemaAdapter


See Also

See Also
TADStoredProc.ActiveStoredUsage Property
See Also

TDataSet.Active


See Also

See Also
TADStoredProc.AfterApplyUpdates Event
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates


See Also

See Also
TADStoredProc.AfterExecute Event
See Also

TADDataSetEvent, Execute, BeforeExecute


See Also

See Also
TADStoredProc.AfterGetRecord Event
See Also

AfterGetRecords


See Also

See Also
TADStoredProc.AfterGetRecords Event
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord


See Also

See Also
TADStoredProc.AfterRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest


Example 1

Example 1
TADStoredProc.Aggregates Property
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);


Example 2

Example 2
TADStoredProc.Aggregates Property

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.


See Also

See Also
TADStoredProc.Aggregates Property
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch


Example

Example
TADStoredProc.AggregatesActive Property
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;


See Also

See Also
TADStoredProc.AggregatesActive Property
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch


See Also

See Also
TADStoredProc.BeforeApplyUpdates Event
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates


See Also

See Also
TADStoredProc.BeforeExecute Event
See Also

TADDataSetEvent, Execute, AfterExecute


See Also

See Also
TADStoredProc.BeforeGetRecords Event
See Also

TADDataSetEvent, AfterGetRecords


See Also

See Also
TADStoredProc.BeforeRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest


Example

Example
TADStoredProc.CachedUpdates Property
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;


See Also

See Also
TADStoredProc.CachedUpdates Property
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates


See Also

See Also
TADStoredProc.CatalogName Property
See Also

Object Names, SchemaName, PackageName, Overload, StoredProcName


See Also

See Also
TADStoredProc.Connection Property
See Also

ConnectionName


Example

Example
TADStoredProc.ConnectionName Property
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');


See Also

See Also
TADStoredProc.ConnectionName Property
See Also

Connection, TADCustomConnection.Temporary


Example

Example
TADStoredProc.Constraints Property
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;


See Also

See Also
TADStoredProc.Constraints Property
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint


Example

Example
TADStoredProc.ConstraintsEnabled Property
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;


See Also

See Also
TADStoredProc.ConstraintsEnabled Property
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired


Example

Example
TADStoredProc.DetailFields Property
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';


See Also

See Also
TADStoredProc.DetailFields Property
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName


See Also

See Also
TADStoredProc.FetchOptions Property
See Also

Setting Options, TADFetchOptions


Example

Example
TADStoredProc.FilterChanges Property
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];


See Also

See Also
TADStoredProc.FilterChanges Property
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus


See Also

See Also
TADStoredProc.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Params


Example 1

Example 1
TADStoredProc.Indexes Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';


Example 2

Example 2
TADStoredProc.Indexes Property

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.


See Also

See Also
TADStoredProc.Indexes Property
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch


Example

Example
TADStoredProc.IndexesActive Property
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;


See Also

See Also
TADStoredProc.IndexesActive Property
See Also

Sorting Records, Indexes, BeginBatch, EndBatch


Example

Example
TADStoredProc.IndexFieldNames Property
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';


See Also

See Also
TADStoredProc.IndexFieldNames Property
See Also

Sorting Records, Indexes, IndexName


Example

Example
TADStoredProc.IndexName Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';


See Also

See Also
TADStoredProc.IndexName Property
See Also

Sorting Records, Indexes, IndexFieldNames


See Also

See Also
TADStoredProc.LocalSQL Property
See Also

Local SQL, TADLocalSQL, TADMemTable


Example

Example
TADStoredProc.MasterFields Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


See Also

See Also
TADStoredProc.MasterFields Property
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName


Example 1

Example 1
TADStoredProc.MasterSource Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


Example 2

Example 2
TADStoredProc.MasterSource Property

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.


See Also

See Also
TADStoredProc.MasterSource Property
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName


See Also

See Also
TADStoredProc.OnCommandChanged Event
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName


Example 1

Example 1
TADStoredProc.OnError Event

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;


Example 2

Example 2
TADStoredProc.OnError Event

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;


See Also

See Also
TADStoredProc.OnError Event
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError


Example

Example
TADStoredProc.OnExecuteError Event
procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AError: EADDBEngineException; var AAction: TADErrorAction);
begin
  if AException.Errors[0].Kind = ekUKViolated then
    AAction := eaSkip
  else
    AAction := eaFail;
end;


See Also

See Also
TADStoredProc.OnExecuteError Event
See Also

Array DML, EADDBEngineException, TADErrorAction, TADDataSet.Execute


Example

Example
TADStoredProc.OnReconcileError Event
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;


See Also

See Also
TADStoredProc.OnReconcileError Event
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError


Example

Example
TADStoredProc.OnUpdateError Event
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;


See Also

See Also
TADStoredProc.OnUpdateError Event
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord


Example 1

Example 1
TADStoredProc.OnUpdateRecord Event
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;


Example 2

Example 2
TADStoredProc.OnUpdateRecord Event

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main


See Also

See Also
TADStoredProc.OnUpdateRecord Event
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError


See Also

See Also
TADStoredProc.Overload Property
See Also

Executing Stored Procedure, Params, StoredProcName


See Also

See Also
TADStoredProc.PackageName Property
See Also

Object Names, CatalogName, SchemaName, Overload, StoredProcName


See Also

See Also
TADStoredProc.ParamBindMode Property
See Also

Params


Example 1

Example 1
TADStoredProc.Params Property
// TADQuery automatic parameters creation - ResourceOptions.ParamCreate = True
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.Open;


Example 2

Example 2
TADStoredProc.Params Property
// TADQuery manual parameters creation - ResourceOptions.ParamCreate = False
ADQuery1.ResourceOptions.ParamCreate := False;
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
with ADQuery1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
  AsString := 'qwe';
end;
ADQuery1.Open;


Example 3

Example 3
TADStoredProc.Params Property
// TADStoredProc automatic parameters creation - fiMeta in FetchOptions.Items
ADStoredProc1.StoredProcName := 'my_proc';
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;


Example 4

Example 4
TADStoredProc.Params Property
// TADStoredProc manual parameters creation - fiMeta not in FetchOptions.Items
ADStoredProc1.FetchOptions.Items := ADStoredProc1.FetchOptions.Items - [fiMeta];
ADStoredProc1.StoredProcName := 'my_proc';
with ADStoredProc1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
end;
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;


See Also

See Also
TADStoredProc.Params Property
See Also

Executing Command, Executing Stored Procedure, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items


See Also

See Also
TADStoredProc.ResourceOptions Property
See Also

Setting Options, TADBottomResourceOptions


Example

Example
TADStoredProc.SchemaAdapter Property
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;


See Also

See Also
TADStoredProc.SchemaAdapter Property
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade


See Also

See Also
TADStoredProc.SchemaName Property
See Also

Object Names, CatalogName, PackageName, Overload, StoredProcName


See Also

See Also
TADStoredProc Class
See Also

Executing Stored Procedure, TADCustomStoredProc, TADQuery


Example 1

Example 1
TADStoredProc.StoredProcName Property
ADStoredProc1.StoredProcName := 'Northwind.dbo.[my proc]';
// the same as following
ADStoredProc1.CatalogName := 'Northwind';
ADStoredProc1.SchemaName := 'dbo';
ADStoredProc1.StoredProcName := '[my proc]';


Example 2

Example 2
TADStoredProc.StoredProcName Property
ADStoredProc1.PackageName := 'sys.dbms_sql';
ADStoredProc1.StoredProcName := 'execute';


See Also

See Also
TADStoredProc.StoredProcName Property
See Also

Object Names, Executing Stored Procedure, CatalogName, SchemaName, PackageName, Overload


See Also

See Also
TADStoredProc.Transaction Property
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction


Example 1

Example 1
TADStoredProc.UpdateObject Property
ADUpdateSQL1.InsertSQL.Text := 'insert into mytab values (:new_id, :new_name)';
ADQuery1.UpdateObject := ADUpdateSQL1;
ADQuery1.Append;
ADQuery1['id'] := 100;
ADQuery1['name'] := 'qwe';
ADQuery1.Post;


Example 2

Example 2
TADStoredProc.UpdateObject Property

Demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.


See Also

See Also
TADStoredProc.UpdateObject Property
See Also

OnUpdateRecord, TADUpdateSQL


See Also

See Also
TADStoredProc.UpdateOptions Property
See Also

Setting Options, TADBottomUpdateOptions


Example

Example
TADStoredProc.UpdateTransaction Property
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction


See Also

See Also
TADStoredProc.UpdateTransaction Property
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction


See Also

See Also
TADTable.ActiveStoredUsage Property
See Also

TDataSet.Active


See Also

See Also
TADTable.AfterApplyUpdates Event
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates


See Also

See Also
TADTable.AfterGetRecord Event
See Also

AfterGetRecords


See Also

See Also
TADTable.AfterGetRecords Event
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord


See Also

See Also
TADTable.AfterRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest


Example 1

Example 1
TADTable.Aggregates Property
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);


Example 2

Example 2
TADTable.Aggregates Property

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.


See Also

See Also
TADTable.Aggregates Property
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch


Example

Example
TADTable.AggregatesActive Property
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;


See Also

See Also
TADTable.AggregatesActive Property
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch


See Also

See Also
TADTable.BeforeApplyUpdates Event
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates


See Also

See Also
TADTable.BeforeGetRecords Event
See Also

TADDataSetEvent, AfterGetRecords


See Also

See Also
TADTable.BeforeRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest


Example

Example
TADTable.CachedUpdates Property
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;


See Also

See Also
TADTable.CachedUpdates Property
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates


See Also

See Also
TADTable.CatalogName Property
See Also

Object Names, SchemaName, TableName


See Also

See Also
TADTable.Connection Property
See Also

ConnectionName


Example

Example
TADTable.ConnectionName Property
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');


See Also

See Also
TADTable.ConnectionName Property
See Also

Connection, TADCustomConnection.Temporary


Example

Example
TADTable.Constraints Property
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;


See Also

See Also
TADTable.Constraints Property
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint


Example

Example
TADTable.ConstraintsEnabled Property
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;


See Also

See Also
TADTable.ConstraintsEnabled Property
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired


Example

Example
TADTable.DetailFields Property
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';


See Also

See Also
TADTable.DetailFields Property
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName


Example

Example
TADTable.Disconnect Method
ADQuery1.Disconnect(True);
// is equivalent to:
// ADQuery1.AbortJob(True);
// ADQuery1.Close;
// ADQuery1.Unprepare;


See Also

See Also
TADTable.Disconnect Method
See Also

AbortJob


See Also

See Also
TADTable.Exists Property
See Also

CatalogName, SchemaName, TableName


See Also

See Also
TADTable.FetchOptions Property
See Also

Setting Options, TADFetchOptions


Example

Example
TADTable.FilterChanges Property
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];


See Also

See Also
TADTable.FilterChanges Property
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus


See Also

See Also
TADTable.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Params


See Also

See Also
TADTable.GetCustomWhere Method
See Also

Filtering Records


Example

Example
TADTable.IndexFieldNames Property
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';


See Also

See Also
TADTable.IndexFieldNames Property
See Also

Sorting Records, Indexes, IndexName


Example

Example
TADTable.IndexName Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';


See Also

See Also
TADTable.IndexName Property
See Also

Sorting Records, Indexes, IndexFieldNames


See Also

See Also
TADTable.LocalSQL Property
See Also

Local SQL, TADLocalSQL, TADMemTable


Example

Example
TADTable.MasterFields Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


See Also

See Also
TADTable.MasterFields Property
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName


Example 1

Example 1
TADTable.MasterSource Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


Example 2

Example 2
TADTable.MasterSource Property

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.


See Also

See Also
TADTable.MasterSource Property
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName


See Also

See Also
TADTable.OnCommandChanged Event
See Also

TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADTable.TableName


Example 1

Example 1
TADTable.OnError Event

Handling Array DML errors:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if AException is EADPhysArrayExecuteError then
    with EADPhysArrayExecuteError(AException) do
      if Errors[0].Kind = ekUKViolated then
        AAction := eaSkip
      else
        AAction := eaFail
  else
    ...
end;


Example 2

Example 2
TADTable.OnError Event

Error substitution:

procedure TForm1.ADQuery1Error(ASender: TObject; const AInitiator: IADStanObject; var AException: Exception);
begin
  if EADDBEngineException(AException).Errors[0].Kind = ekPKViolated then begin
    AException.Free;
    AException := Exception.Create('Please, enter unique ID value');
  end;
end;


See Also

See Also
TADTable.OnError Event
See Also

TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc, TDataSet.Open, Prepare, EADDBArrayExecuteError, EADDBEngineException, TADCustomConnection.OnError


Example

Example
TADTable.OnExecuteError Event
procedure TForm1.ADQuery1ExecuteError(ASender: TObject; ATimes,
  AOffset: Integer; AError: EADDBEngineException; var AAction: TADErrorAction);
begin
  if AException.Errors[0].Kind = ekUKViolated then
    AAction := eaSkip
  else
    AAction := eaFail;
end;


See Also

See Also
TADTable.OnExecuteError Event
See Also

Array DML, EADDBEngineException, TADErrorAction, TADDataSet.Execute


Example

Example
TADTable.OnReconcileError Event
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;


See Also

See Also
TADTable.OnReconcileError Event
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError


Example

Example
TADTable.OnUpdateError Event
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;


See Also

See Also
TADTable.OnUpdateError Event
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord


Example 1

Example 1
TADTable.OnUpdateRecord Event
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;


Example 2

Example 2
TADTable.OnUpdateRecord Event

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main


See Also

See Also
TADTable.OnUpdateRecord Event
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError


Example

Example
TADTable.Open Method
ADQuery1.Open('select * from customers');


See Also

See Also
TADTable.Open Method
See Also

Prepare, TDataSet.Open, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADAdaptedDataSet.AbortJob, TADAdaptedDataSet.OnError


See Also

See Also
TADTable.RefireSQL Method
See Also

GetCustomWhere


See Also

See Also
TADTable.ResourceOptions Property
See Also

Setting Options, TADBottomResourceOptions


Example

Example
TADTable.SchemaAdapter Property
dsOrders.DataSet := qOrders;
qOrders.SchemaAdapter := ADSchemaAdapter1;
qOrders.CachedUpdates := True;

dsOrderDetails.DataSet := qOrderDetails;
qOrderDetails.SchemaAdapter := ADSchemaAdapter1;
qOrderDetails.CachedUpdates := True;
qOrderDetails.MasterSource := dsOrders;
qOrderDetails.MasterFields := 'OrderID';
qOrderDetails.IndexFieldNames := 'OrderID';
qOrderDetails.FetchOptions.DetailCascade := True;

qOrders.Open;
qOrderDetails.Open;

qOrders.Append;
....
qOrders.Post;

qOrderDetails.Append;
...
qOrderDetails.Post;

ADSchemaAdapter1.ApplyUpdates;
qOrders.CommitUpdates;
qOrderDetails.CommitUpdates;


See Also

See Also
TADTable.SchemaAdapter Property
See Also

Caching Updates, Master-Detail Relationship, TADFetchOptions.DetailCascade


See Also

See Also
TADTable.SchemaName Property
See Also

Object Names, CatalogName, TableName


See Also

See Also
TADTable Class
See Also

Browsing Table, TADQuery


See Also

See Also
TADTable.TableName Property
See Also

Browsing Table, Object Names, CatalogName, SchemaName


See Also

See Also
TADTable.Transaction Property
See Also

Managing Transactions, UpdateTransaction, TADCustomConnection.Transaction


Example 1

Example 1
TADTable.UpdateObject Property
ADUpdateSQL1.InsertSQL.Text := 'insert into mytab values (:new_id, :new_name)';
ADQuery1.UpdateObject := ADUpdateSQL1;
ADQuery1.Append;
ADQuery1['id'] := 100;
ADQuery1['name'] := 'qwe';
ADQuery1.Post;


Example 2

Example 2
TADTable.UpdateObject Property

Demo FireDAC\Samples\Comp Layer\TADUpdateSQL\Main.


See Also

See Also
TADTable.UpdateObject Property
See Also

OnUpdateRecord, TADUpdateSQL


See Also

See Also
TADTable.UpdateOptions Property
See Also

Setting Options, TADBottomUpdateOptions


Example

Example
TADTable.UpdateTransaction Property
var
  oSelectTransaction: TADTransaction;
  oUpdateTransaction: TADTransaction;
  oCusts: TADQuery;
.....
  oSelectTransaction := TADTransaction.Create(nil);
  oSelectTransaction.Connection := ADConnection1;
  oSelectTransaction.Options.ReadOnly := True;

  oUpdateTransaction := TADTransaction.Create(nil);
  oUpdateTransaction.Connection := ADConnection1;

  oCusts := TADQuery.Create(nil);
  oCusts.Connection := ADConnection1;
  oCusts.Transaction := oSelectTransaction;
  oCusts.UpdateTransaction := oUpdateTransaction;
  oCusts.Open('select * from Customers'); // uses oSelectTransaction
  ...
  oCusts.Edit; // uses oUpdateTransaction, if needed
  ...
  oCusts.Post; // uses oUpdateTransaction


See Also

See Also
TADTable.UpdateTransaction Property
See Also

Managing Transactions,Transaction, TADCustomConnection.UpdateTransaction


See Also

See Also
TADTransaction.AfterCommit Event
See Also

BeforeCommit


See Also

See Also
TADTransaction.AfterRollback Event
See Also

BeforeRollback


See Also

See Also
TADTransaction.AfterStartTransaction Event
See Also

BeforeStartTransaction


See Also

See Also
TADTransaction.BeforeCommit Event
See Also

AfterCommit


See Also

See Also
TADTransaction.BeforeRollback Event
See Also

AfterRollback


See Also

See Also
TADTransaction.BeforeStartTransaction Event
See Also

AfterStartTransaction


See Also

See Also
TADTransaction.Connection Property
See Also

Active


Example

Example
TADTransaction.Options Property
ADTransaction1.Options.ReadOnly := True;
ADTransaction1.StartTransaction;


See Also

See Also
TADTransaction.Options Property
See Also

StartTransaction, Commit, Rollback


See Also

See Also
TADTransaction Class
See Also

Managing Transactions, TADCustomTransaction, TADCustomConnection


Example 1

Example 1
TADUpdateSQL.Apply Method
procedure TfrmCachedUpdates.qrProductsUpdateRecord(ASender: TDataSet;
  ARequest: TADUpdateRequest; var AAction: TADErrorAction;
  AOptions: TADUpdateRowOptions);
begin
  usProducts.ConnectionName := qrProducts.ConnectionName;
  usProducts.DataSet := qrProducts;
  usProducts.Apply(ARequest, AAction, AOptions);

  usCategories.ConnectionName := qrProducts.ConnectionName;
  usCategories.DataSet := qrProducts;
  usCategories.Apply(ARequest, AAction, AOptions);

  AAction := eaApplied;
end;


Example 2

Example 2
TADUpdateSQL.Apply Method

See FireDAC\Samples\Comp Layer\TADUpdateSQL\Main demo application.


See Also

See Also
TADUpdateSQL.Apply Method
See Also

Overriding Posting Updates, TADUpdateSQL, TADAdaptedDataSet.UpdateObject


Example

Example
TADUpdateSQL.Commands Property
ADUpdateSQL1.InsertSQL := 'insert into !tab (workstation_time, id, name) values (:workstation_time, :new_id, :new_name)';
ADUpdateSQL1.Commands[arInsert].ParamByName('workstation_time').AsDateTime := Now();
ADUpdateSQL1.Commands[arInsert].MacroByName('tab').AsRaw := 'mytab';


See Also

See Also
TADUpdateSQL.Commands Property
See Also

TADCustomCommand, TADCustomCommand.Params, TADCustomCommand.Macros, SQL


See Also

See Also
TADUpdateSQL.Connection Property
See Also

ConnectionName, Commands


See Also

See Also
TADUpdateSQL.ConnectionName Property
See Also

Connection, Commands


Example

Example
TADUpdateSQL.DeleteSQL Property
ADUpdateSQL1.DeleteSQL := 'DELETE FROM ADDEMO."Shippers" WHERE SHIPPERID = :OLD_SHIPPERID';


See Also

See Also
TADUpdateSQL.DeleteSQL Property
See Also

Commands, InsertSQL, ModifySQL, LockSQL, UnlockSQL, FetchRowSQL


Example

Example
TADUpdateSQL.FetchRowSQL Property
ADUpdateSQL1.FetchRowSQL := 'SELECT SHIPPERID, COMPANYNAME, PHONE FROM ADDEMO."Shippers" ' +
  'WHERE SHIPPERID = :OLD_SHIPPERID';


See Also

See Also
TADUpdateSQL.FetchRowSQL Property
See Also

Commands, InsertSQL, ModifySQL, LockSQL, UnlockSQL, DeleteSQL, TADUpdateOptions.RefreshMode


Example 1

Example 1
TADUpdateSQL.InsertSQL Property
// SQL Server sample
ADUpdateSQL1.InsertSQL := 'INSERT INTO [Shippers] (COMPANYNAME, PHONE) ' +
  'VALUES (:NEW_COMPANYNAME, :NEW_PHONE); SELECT SCOPE_IDENTITY() AS SHIPPERID';


Example 2

Example 2
TADUpdateSQL.InsertSQL Property
// Oracle sample
ADUpdateSQL1.InsertSQL := 'INSERT INTO ADDEMO."Shippers" (COMPANYNAME, PHONE) ' +
  'VALUES (:NEW_COMPANYNAME, :NEW_PHONE) RETURNING SHIPPERID INTO :NEW_SHIPPERID';
ADUpdateSQL1.Commands[arInsert].ParamByName('NEW_SHIPPERID').ParamType := ptOutput;


See Also

See Also
TADUpdateSQL.InsertSQL Property
See Also

Commands, ModifySQL, DeleteSQL, LockSQL, UnlockSQL, FetchRowSQL


See Also

See Also
TADUpdateSQL.LockSQL Property
See Also

Commands, ModifySQL, DeleteSQL, InsertSQL, UnlockSQL, FetchRowSQL


Example

Example
TADUpdateSQL.ModifySQL Property
ADUpdateSQL1.InsertSQL := 'UPDATE ADDEMO."Shippers" SET SHIPPERID = :NEW_SHIPPERID, ' +
  'COMPANYNAME = :NEW_COMPANYNAME, PHONE = :NEW_PHONE WHERE SHIPPERID = :OLD_SHIPPERID';


See Also

See Also
TADUpdateSQL.ModifySQL Property
See Also

Commands, InsertSQL, DeleteSQL, LockSQL, UnlockSQL, FetchRowSQL


See Also

See Also
TADUpdateSQL.SQL Property
See Also

Commands, InsertSQL, ModifySQL, DeleteSQL, LockSQL, UnlockSQL, FetchRowSQL


See Also

See Also
TADUpdateSQL Class
See Also

Overriding Posting Updates, TADQuery, TADStoredProc, TADTable, TADCustomUpdateObject, TADAdaptedDataSet.UpdateObject


See Also

See Also
TADUpdateSQL.UnlockSQL Property
See Also

Commands, ModifySQL, DeleteSQL, InsertSQL, LockSQL, FetchRowSQL


See Also

See Also
uADCompDataSet Namespace
See Also

uADCompClient, uADCompScript


uADCompDataSet Namespace Classes

uADCompDataSet Namespace Classes
uADCompDataSet Namespace Legend
Classes
Class | Description
TADAggregate | TADAggregate represents a maintained client aggregate value in an FireDAC dataset.
TADAggregates | TADAggregates is a collection of TADAggregate objects.
TADAutoIncField | TADAutoIncField represents integer auto incremental field in an FireDAC dataset.
TADBlobStream | TADBlobStream is a stream object giving access to BLOB / Memo fields.
TADDataSet | The TADDataSet is a direct TDataSet descendant, introducing base functionality for all FireDAC datasets.
TADIndex | TADIndex represents a maintained client view to records in an FireDAC dataset.
TADIndexes | TADIndexes is a collection of TADIndex objects.
TADMasterDataLink | TADMasterDataLink controlls master-detail link between two datasets.
TADSQLTimeIntervalField | TADSQLTimeIntervalField represents a time interval field in a dataset.
TADWideMemoField | TADWideMemoField represents a Unicode encoded memo field in a dataset.
TADXMLField | TADXMLField represents a Unicode encoded XML data field in a dataset.


Legend

Legend
uADCompDataSet Namespace
Legend
Class


Topics

Topics
uADCompDataSet Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADAggregate.Active Property
See Also

ActualValue, TADDataSet.AggregatesActive


See Also

See Also
TADAggregate.ActualActive Property
See Also

Active, Expression, InUse, TADDataSet.AggregatesActive


See Also

See Also
TADAggregate.DataSet Property
See Also

TADDataSet


See Also

See Also
TADAggregate.DataType Property
See Also

TADDataType


Example 1

Example 1
TADAggregate.Expression Property
// count number of records with Discount > 0
ADQuery1.Aggregates[0].Expression := 'COUNT(IIF(Discount > 0, 1, NULL))';

// OK
ADQuery1.Aggregates[0].Expression := 'COUNT(*) * 5';
// INVALID - cannot combine aggregating function with field
ADQuery1.Aggregates[0].Expression := 'AVG(Discount) * Amount';


Example 2

Example 2
TADAggregate.Expression Property

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.


See Also

See Also
TADAggregate.Expression Property
See Also

GroupingLevel, Value


Example

Example
TADAggregate.GroupingLevel Property
ADQuery1.IndexFieldNames : = 'ORDER_NO;PART_NO';
ADQuery1.AgregatesActive := True;
// calculate number of rows in each order
ADQuery1.Aggregates[0].Expression := 'COUNT(*)';
ADQuery1.Aggregates[0].GroupingLevel := 1;
ADQuery1.Aggregates[0].Active := True;


See Also

See Also
TADAggregate.GroupingLevel Property
See Also

Expression, IndexName, TADDataSet.IndexName, TADDataSet.IndexFieldNames


See Also

See Also
TADAggregate.IndexName Property
See Also

TADDataSet.IndexName, TADDataSet.IndexFieldNames, GroupingLevel


Example

Example
TADAggregate.InUse Property
if ADQuery1.Aggregates[0].InUse then
  Label1.Caption := VarToStr(ADQuery1.Aggregates[0].Value)
else
  Label1.Caption := '<not accessible>';


See Also

See Also
TADAggregate.InUse Property
See Also

Active, Expression, Value


See Also

See Also
TADAggregate.Name Property
See Also

TADAggregates.FindAggregate, TADAggregates.AggregateByName


Example 1

Example 1
TADAggregate Class
ADQuery1.AggregatesActive := True;
ADQuery1.Open;

with ADQuery1.Aggregates.Add do begin
  Name := 'AvgSalary';
  Expression := 'Avg(Salary)';
  Active := True;

  if InUse then
    Label1.Caption := VarToStr(Value)
  else
    Label1.Caption := '<not accessible>';
end;


Example 2

Example 2
TADAggregate Class

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.


See Also

See Also
TADAggregate Class
See Also

Calculated and Aggregated Fields, TAggregatedField, TADAggregates, TADDataSet, TADDataSet.Aggregates, TADDataSet.AggregatesActive


Example

Example
TADAggregates.Add Method
with ADQuery1.Aggregates.Add do begin
  Name := 'a1';
  Expression := 'count(*)';
  Active := True;
end;


See Also

See Also
TADAggregates.Add Method
See Also

Items, TCollection.Count


Example

Example
TADAggregates.AggregateByName Method
Label1.Caption := VarToStr(ADQuery1.Aggregates.AggregateByName('a1').Value);


See Also

See Also
TADAggregates.AggregateByName Method
See Also

TADAggregate.Name, FindAggregate, Items


Example

Example
TADAggregates.FindAggregate Method
var
  oAgg: TADAggregate;
...
oAgg := ADQuery1.Aggregates.FindAggregate('a1');
if oAgg <> nil then
  Label1.Caption := VarToStr(oAgg.Value);


See Also

See Also
TADAggregates.FindAggregate Method
See Also

TADAggregate.Name, AggregateByName, Items


See Also

See Also
TADAggregates.Items Property
See Also

TADAggregate, TCollection.Count


See Also

See Also
TADAggregates Class
See Also

Calculated and Aggregated Fields, TADAggregate, TADDataSet, TADDataSet.AggregatesActive


Example

Example
TADAutoIncField.AutoIncrementSeed Property
TADAutoIncfield(ADQuery1.FieldByName('ID')).AutoIncrementSeed := -1000;


See Also

See Also
TADAutoIncField.AutoIncrementSeed Property
See Also

ClientAutoIncrement, AutoIncrementStep


Example

Example
TADAutoIncField.AutoIncrementStep Property

TADAutoIncfield(ADQuery1.FieldByName('ID')).AutoIncrementStep := -1;


See Also

See Also
TADAutoIncField.AutoIncrementStep Property
See Also

ClientAutoIncrement, AutoIncrementSeed


Example

Example
TADAutoIncField.ClientAutoIncrement Property
ADQuery1.CachedUpdates := True;
ADQuery1.Open;
ADQuery1.Append;
....
ADQuery1.Post;
// TADAutoIncField(ADQuery1.Fields[0]).Value -> -1
ADQuery1.Append;
....
ADQuery1.Post;
// TADAutoIncField(ADQuery1.Fields[0]).Value -> -2
ADQuery1.Append;
....
ADQuery1.Post;
// TADAutoIncField(ADQuery1.Fields[0]).Value -> -3
ADQuery1.ApplyUpdates;


See Also

See Also
TADAutoIncField.ClientAutoIncrement Property
See Also

Auto-Incremental Fields, ServerAutoIncrement


Example

Example
TADAutoIncField.GeneratorName Property
TADAutoIncField(ADQuery1.Fields[0]).GeneratorName := 'GEN_ID';


See Also

See Also
TADAutoIncField.GeneratorName Property
See Also

Auto-Incremental Fields, Object Names, TADUpdateOptions.GeneratorName, TADUpdateOptions.FetchGeneratorsPoint


Example

Example
TADAutoIncField.IdentityInsert Property
TADAutoIncField(ADQuery1.Fields[0]).IdentityInsert := True;
ADQuery1.Append;
ADQuery1.Fields[0].Value := 123;
ADQuery1.Post;


See Also

See Also
TADAutoIncField.IdentityInsert Property
See Also

Auto-Incremental Fields, TADDataMove


See Also

See Also
TADAutoIncField.ServerAutoIncrement Property
See Also

Auto-Incremental Fields, IdentityInsert, ClientAutoIncrement


See Also

See Also
TADAutoIncField Class
See Also

Auto-Incremental Fields, TADUpdateOptions.GeneratorName, TADUpdateOptions.FetchGeneratorsPoint, TADUpdateOptions.RefreshMode


Example 1

Example 1
TADBlobStream Class

The demo shows how to load BLOB field value from external file

ADQuery1.Append;
// assign other fields
....
// load BLOB field value
oStr := TADBlobStream.Create(ADQuery1.FieldByName('PHOTO'), bmWrite);
try
  oStr.LoadFromFile('c:\aaa.jpg');
finally
  oStr.Free;
end;
ADQuery1.Post;


Example 2

Example 2
TADBlobStream Class

The demo shows how to save BLOB field value into external file

// save BLOB field value
oStr := TADBlobStream.Create(ADQuery1.FieldByName('PHOTO'), bmRead);
try
  oStr.SaveToFile('c:\aaa.jpg');
finally
  oStr.Free;
end;


Example 3

Example 3
TADBlobStream Class

See FireDAC\Samples\Comp Layer\TADQuery\Blobs demo for details.


See Also

See Also
TADBlobStream Class
See Also

TADDataSet.CreateBlobStream


See Also

See Also
TADBlobStream.Truncate Method
See Also

Create


See Also

See Also
TADDataSet.ActiveStoredUsage Property
See Also

TDataSet.Active


See Also

See Also
TADDataSet.AddIndex Method
See Also

Indexes


See Also

See Also
TADDataSet.AfterApplyUpdates Event
See Also

TADAfterApplyUpdatesEvent, ApplyUpdates, BeforeApplyUpdates


See Also

See Also
TADDataSet.AfterExecute Event
See Also

TADDataSetEvent, Execute, BeforeExecute


See Also

See Also
TADDataSet.AfterGetRecord Event
See Also

AfterGetRecords


See Also

See Also
TADDataSet.AfterGetRecords Event
See Also

TADDataSetEvent, BeforeGetRecords, AfterGetRecord


See Also

See Also
TADDataSet.AfterRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, BeforeRowRequest


Example 1

Example 1
TADDataSet.Aggregates Property
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  Active := True;
end;
with ADMemTable1.Aggregates.Add do begin
  Expression := 'sum(sal + bonus)';
  IndexName := 'by_deps';
  Active := True;
end;
ADMemTable1.IndexName := 'by_deps';
ADMemTable1.AggregatesActive := True;

Label1.Caption := 'Total payments : ' + VarToStr(ADMemTable1.Aggregates[0].Value);
Label2.Caption := 'Current department payments : ' + VarToStr(ADMemTable1.Aggregates[1].Value);


Example 2

Example 2
TADDataSet.Aggregates Property

See FireDAC\Samples\Comp Layer\TADQuery\Aggregates sample for details.


See Also

See Also
TADDataSet.Aggregates Property
See Also

Calculated and Aggregated Fields, AggregatesActive, BeginBatch, EndBatch


Example

Example
TADDataSet.AggregatesActive Property
var
  lPrevAggsActive: Boolean;
...
lPrevAggsActive := ADQuery1.AggregatesActive;
ADQuery1.AggregatesActive := False;
try
  // perform updates here, without calculating and reading client aggregates
finally
  ADQuery1.AggregatesActive := lPrevAggsActive;
end;


See Also

See Also
TADDataSet.AggregatesActive Property
See Also

Calculated and Aggregated Fields,Aggregates, TADAggregate.Active, BeginBatch, EndBatch


See Also

See Also
TADDataSet.ApplyMaster Method
See Also

Master-Detail Relationship, TDataSet.DisableControls, TADMasterLink.DisableScroll, TADMasterLink.Synchronize


Example

Example
TADDataSet.ApplyRange Method
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRangeStart;
ADQuery1['CUST_NO'] := '100';
ADQuery1.SetRangeEnd;
ADQuery1['CUST_NO'] := '200';
ADQuery1.ApplyRange;


See Also

See Also
TADDataSet.ApplyRange Method
See Also

Filtering Records, CancelRange, EditRangeEnd, EditRangeStart, SetRange, SetRangeEnd, SetRangeStart, IsRanged


Example 1

Example 1
TADDataSet.ApplyUpdates Method
procedure TForm1.btnApplyClick(ASender: TObject);
begin
  if ADStoredProc1.UpdatesPending then
    ADStoredProc1.ApplyUpdates;
end;


Example 2

Example 2
TADDataSet.ApplyUpdates Method

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.


See Also

See Also
TADDataSet.ApplyUpdates Method
See Also

Caching Updates, CachedUpdates, CancelUpdates, CommitUpdates, RowError, FilterChanges, Reconcile, UpdatesPending


Example

Example
TADDataSet.AttachTable Method
var
  oTab: TADDatSTable;
...
  oTab := TADDatSTable.Create;
  oTab.Columns.Add('id', dtInt32);
  oTab.Columns.Add('name').Size := 13;
  oTab.Columns.Add('cnt', dtInt16);
  oTab.Columns.Add('price', dtCurrency);
  ADMemTable1.Attach(oTab, nil);
  ADMemTable1.Open;
  // working with ADMemTable1
  ADMemTable1.AttachTable(nil, nil);
  oTab.Free;


See Also

See Also
TADDataSet.AttachTable Method
See Also

Table, View, SourceView


See Also

See Also
TADDataSet.BeforeApplyUpdates Event
See Also

TADDataSetEvent, ApplyUpdates, AfterApplyUpdates


See Also

See Also
TADDataSet.BeforeExecute Event
See Also

TADDataSetEvent, Execute, AfterExecute


See Also

See Also
TADDataSet.BeforeGetRecords Event
See Also

TADDataSetEvent, AfterGetRecords


See Also

See Also
TADDataSet.BeforeRowRequest Event
See Also

TADDataSetEvent, RefreshRecord, FetchBlobs, FetchDetails, AfterRowRequest


Example

Example
TADDataSet.BeginBatch Method
ADQuery1.BeginBatch;
try
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ......
finally
  ADQuery1.EndBatch;
end;


See Also

See Also
TADDataSet.BeginBatch Method
See Also

EndBatch


Example

Example
TADDataSet.CachedUpdates Property
ADQuery1.CachedUpdates := True;
...
ADQuery1.Edit;
...
ADQuery1.Post;
...
ADQuery1.Append;
...
ADQuery1.Post;
...
ADQuery1.ApplyUpdates;
ADQuery1.CommitUpdates;
ADQuery1.CachedUpdates := False;


See Also

See Also
TADDataSet.CachedUpdates Property
See Also

Caching Updates, ApplyUpdates, CancelUpdates, CommitUpdates


See Also

See Also
TADDataSet.CancelRange Method
See Also

Filtering Records, ApplyRange, EditRangeEnd, EditRangeStart, SetRange, SetRangeEnd, SetRangeStart, IsRanged


Example

Example
TADDataSet.CancelUpdates Method

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.


See Also

See Also
TADDataSet.CancelUpdates Method
See Also

Caching Updates, ApplyUpdates, CachedUpdates, CommitUpdates, UndoLastChange, SavePoint


Example 1

Example 1
TADDataSet.ChangeCount Property
procedure TForm1.ADQuery1AfterPost(DataSet: TDataSet);
begin
  if TADDataSet(DataSet).ChangeCount = 0 then
    StatusBar1.SimpleText := 'no changes'
  else
    StatusBar1.SimpleText := Format('%d changed rows', [TADDataSet(DataSet).ChangeCount]);
end;


Example 2

Example 2
TADDataSet.ChangeCount Property

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.


See Also

See Also
TADDataSet.ChangeCount Property
See Also

Caching Updates, CachedUpdates, UndoLastChange, CancelUpdates, CommitUpdates, ApplyUpdates


Example 1

Example 1
TADDataSet.CloneCursor Method
ADMemTable1.CloneCursor(ADQuery1, True, False);
ADMemTable1.Locate(...);
ADMemTable1.Edit;
...


Example 2

Example 2
TADDataSet.CloneCursor Method

See FireDAC\Samples\Comp Layer\TADMemTable\CloneCursor sample for details.


See Also

See Also
TADDataSet.CloneCursor Method
See Also

Data


See Also

See Also
TADDataSet.CloneSource Property
See Also

CloneCursor


See Also

See Also
TADDataSet.CommitUpdates Method
See Also

CachedUpdates, UpdatesPending, OnUpdateError, OnUpdateRecord, ApplyUpdates, CancelUpdates


Example

Example
TADDataSet.Constraints Property
with ADMemTable1.Constraints.Add do begin
  CustomConstraint := 'sal + bonus <= 2000';
  ErrorMessage := 'The employee payments must be equal or less than 2000 usd';
end;

ADMemTable1.ConstraintsEnabled := True;
ADMemTable1.Edit;
try
  ADMemTable1.FieldByName('sal').AsFloat := 1800;
  ADMemTable1.FieldByName('bonus').AsFloat := 300;
  // here exception will be raised
  ADMemTable1.Post;
except
  ADMemTable1.Cancel;
  Application.HandleException(Self);
end;

ADMemTable1.ConstraintsEnabled := False;
ADMemTable1.Edit;
ADMemTable1.FieldByName('sal').AsFloat := 1800;
ADMemTable1.FieldByName('bonus').AsFloat := 300;
// here exception will be NOT raised, because constraint checking is disabled
ADMemTable1.Post;


See Also

See Also
TADDataSet.Constraints Property
See Also

ConstraintsEnabled, DisableConstraints, EnableConstraints, BeginBatch, EndBatch, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TField.CustomConstraint, TField.ImportedConstraint


Example

Example
TADDataSet.ConstraintsEnabled Property
var
  lPrevConsEnabled: Boolean;
...
lPrevConsEnabled := ADQuery1.ConstraintEnabled;
ADQuery1.ConstraintEnabled := False;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.ConstraintEnabled := lPrevConsEnabled;
end;


See Also

See Also
TADDataSet.ConstraintsEnabled Property
See Also

Constraints, BeginBatch, EndBatch, DisableConstraints, EnableConstraints, TDataSet.Post, TDataSet.AppendRecord, TDataSet.InsertRecord, TADUpdateOptions.CheckRequired


Example

Example
TADDataSet.CopyDataSet Method
// copies dataset structure and all records
ADMemTable1.CopyDataSet(Query1, [coStructure, coRestart, coAppend]);

// refreshed dataset data using records from ADQuery2 dataset. If a record is not found, then it will be appended
ADQuery1.CopyDataSet(ADQuery2, [coRestart, coRefresh, coAppend]);


See Also

See Also
TADDataSet.CopyDataSet Method
See Also

CopyRecord, Data, TADDataMove


See Also

See Also
TADDataSet.CopyRecord Method
See Also

CopyDataSet, Data, TADDataMove


Example

Example
TADDataSet.CreateDataSet Method
with ADMemTable1 do begin
  FieldDefs.Add('ID', ftAutoInc);
  FieldDefs.Add('Code', ftString, 10);
  FieldDefs.Add('Name', ftString, 50);
  CreateDataSet;
  // here dataset is active, has 3 fields and is empty
end;


See Also

See Also
TADDataSet.CreateDataSet Method
See Also

TDataSet.FieldDefs, TDataSet.Fields, TADCustomMemTable


Example

Example
TADDataSet.CreateExpression Method
var
  oEval: IADStanExpressionEvaluator;
...
oEval := ADMemTable1.CreateExpresison('(sal + comm) * tax / 100');
Label1.Caption := oEval.Evaluate;
...
ADMemTable1.Next;
oEval.DataSource.Position := ADMemTable1.GetRow;
Label1.Caption := oEval.Evaluate;
...
oEval := nil;
ADMemTable1.Close;


See Also

See Also
TADDataSet.CreateExpression Method
See Also

Writing Expressions, GetRow, Aggregates, Constraints, Indexes


Example

Example
TADDataSet.Data Property
ADQuery1.SQL.Text := 'select * from orders; select * from customers';

ADQuery1.Open;
ADQuery1.FetchAll;
// assign orders records to ADMemTable1
ADMemTable1.Data := ADQuery1.Data;

ADQuery1.NextRecordSet;
ADQuery1.FetchAll;
// assign customers records to ADMemTable2
ADMemTable2.Data := ADQuery1.Data;


See Also

See Also
TADDataSet.Data Property
See Also

Delta, FilteredData, CopyDataSet, CachedUpdates


See Also

See Also
TADDataSet.DatSManager Property
See Also

Table, View, SourceView, AttachTable


See Also

See Also
TADDataSet.DeleteIndex Method
See Also

Indexes, AddIndex, DeleteIndexes


See Also

See Also
TADDataSet.DeleteIndexes Method
See Also

Indexes, AddIndex, DeleteIndex


Example

Example
TADDataSet.Delta Property
// copy to ADMemTable1 all ADQuery1 changed records and their versions
ADMemTable1.FilterChanges := [rtModified, rtInserted, rtDeleted];
ADMemTable1.Data := ADQuery1.Delta;


See Also

See Also
TADDataSet.Delta Property
See Also

Data, FilteredData, FilterChanges


Example

Example
TADDataSet.DetailFields Property
ADQuery1.SQL.Text := 'SELECT * FROM "Orders" WHERE CustomerID = :ID';
ADQuery1.MasterSource := CustomersDS;
ADQuery1.MasterFields := 'ID';
ADQuery1.DetailFields := 'CustomerID';


See Also

See Also
TADDataSet.DetailFields Property
See Also

Master-Detail Relationship, MasterSource, MasterFields, IndexFieldNames, IndexName


Example

Example
TADDataSet.DisableConstraints Method
ADQuery1.DisableConstraints;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.EnableConstraints;
end;


See Also

See Also
TADDataSet.DisableConstraints Method
See Also

EnableConstraints, Constraints, ConstraintsEnabled, UpdateConstraints


Example

Example
TADDataSet.Disconnect Method
ADQuery1.SQL.Text := 'select * from [Order Details]';
ADQuery1.Prepare := True;
ADQuery1.Active := True;
ADQuery1.Disconnect;
// Active = False and Prepare = False


Example

Example
TADDataSet.EditKey Method
ADQuery1.IndexFieldNames := 'CUSTOMER_ID;ORDER_DATE';
...
ADQuery1.EditKey;
ADQuery1.FieldByName('ORDER_DATE').AsDateTime := EncodeDate(2008, 5, 2);
if not ADQuery1.GotoKey then
  ShowMesage('Order is not found');


See Also

See Also
TADDataSet.EditKey Method
See Also

Finding a Record, IndexFields, FindKey, GotoKey, GotoNearest, SetKey, TDataSet.State, KeyFieldCount, KeyExclusive


Example

Example
TADDataSet.EditRangeEnd Method
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRangeStart;
ADQuery1['CUST_NO'] := 100;
ADQuery1.SetRangeEnd;
ADQuery1['CUST_NO'] := 200;
ADQuery1.ApplyRange;
......
ADQuery1.EditRangeEnd;
ADQuery1['CUST_NO'] := ADQuery1['CUST_NO'] - 1;
ADQuery1.ApplyRange;


See Also

See Also
TADDataSet.EditRangeEnd Method
See Also

Filtering Records, ApplyRange, CancelRange, EditRangeStart, IndexFieldNames, IndexName, KeyExclusive, SetRange, SetRangeEnd, SetRangeStart


Example

Example
TADDataSet.EditRangeStart Method
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRangeStart;
ADQuery1['CUST_NO'] := 100;
ADQuery1.SetRangeEnd;
ADQuery1['CUST_NO'] := 200;
ADQuery1.ApplyRange;
......
ADQuery1.EditRangeStart;
ADQuery1['CUST_NO'] := ADQuery1['CUST_NO'] + 1;
ADQuery1.ApplyRange;


See Also

See Also
TADDataSet.EditRangeStart Method
See Also

Filtering Records, ApplyRange, CancelRange, EditRangeEnd, IndexFieldNames, IndexName, KeyExclusive, SetRange, SetRangeEnd, SetRangeStart


See Also

See Also
TADDataSet.EmptyDataSet Method
See Also

Table, TDataSet.Delete


Example

Example
TADDataSet.EnableConstraints Method
ADQuery1.DisableConstraints;
try
  // perform updates here, without checking client constraints
finally
  ADQuery1.EnableConstraints;
end;


See Also

See Also
TADDataSet.EnableConstraints Method
See Also

DisableConstraints, Constraints, ConstraintsEnabled, UpdateConstraints


Example

Example
TADDataSet.EndBatch Method
ADQuery1.BeginBatch;
try
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ADQuery1.AppendRecord([...]);
  ......
finally
  ADQuery1.EndBatch;
end;


See Also

See Also
TADDataSet.EndBatch Method
See Also

BeginBatch


Example 1

Example 1
TADDataSet.Execute Method
var
  i: Integer;
....
ADQuery1.SQL.Text := 'insert into mytab values (:p1, :p2)';
ADQuery1.Params.ArraySize := 10;
for i := 0 to ADQuery1.Params.ArraySize - 1 do begin
  ADQuery1.Params[0].AsIntegers[i] := i;
  ADQuery1.Params[1].AsStrings[i] := 'qwe';
end;
ADQuery1.Execute(ADQuery1.Params.ArraySize, 0);


Example 2

Example 2
TADDataSet.Execute Method

See demos for details:

  • FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\Batch;
  • FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\BatchErrorHandling.


See Also

See Also
TADDataSet.Execute Method
See Also

Executing Command, Array DML, TADCustomQuery.SQL, TADCustomQuery.ExecSQL, TADCustomStoredProc.StoredProcName, TADCustomStoredProc.ExecProc, TADAdaptedDataSet.AbortJob, TADCustomMemTable.Adapter, TADRdbmsDataSet.Prepare, TADRdbmsDataSet.OnError, BeforeExecute, AfterExecute


Example

Example
TADDataSet.FetchAgain Method
// set SQL command
ADCommand1.CommandText := 'select * from orders where customerid = :cid';
// link command to table adapter
ADTableAdapter1.SelectCommand := ADCommand1;
// link table adapter to memtable
ADMemTable1.Adapter := ADTableAdapter1;

// set SQL command parameter value, then execute command and fetch all records
ADCommand1.Params[0].AsInteger := 100;
ADMemTable1.Open;
ADMemTable1.FetchAll;

// reset SourceEOF flag, reexecute command by hands and fetch all records
ADMemTable1.FetchAgain;
ADCommand1.Close;
ADCommand1.Params[0].AsInteger := 200;
ADCommand1.Open;
ADMemTable1.FetchAll;

// here we will have in memtable orders for customers with ID=100 and ID=200


See Also

See Also
TADDataSet.FetchAgain Method
See Also

FetchAll, TDataSet.Open, TADCustomCommand, TADCustomTableAdapter


See Also

See Also
TADDataSet.FetchAll Method
See Also

TADFetchOptions.Mode, TDataSet.Open


Example

Example
TADDataSet.FetchBlobs Method
ADQuery1.FetchOptions.Items := ADQuery1.FetchOptions.Items - [fiBlobs];
ADQuery1.Open;
....
ADQuery1.FetchBlobs;
oStr := ADQuery1.CreateBlobStream(ADQuery1.FieldByName('image'), bmRead);
try
  // process image
finally
  oStr.Free;
end;


See Also

See Also
TADDataSet.FetchBlobs Method
See Also

TADFetchOptions.Items


See Also

See Also
TADDataSet.FetchDetails Method
See Also

TADFetchOptions.Items


See Also

See Also
TADDataSet.FetchNext Method
See Also

GetNextPacket


See Also

See Also
TADDataSet.FetchOptions Property
See Also

Setting Options, TADFetchOptions


Example

Example
TADDataSet.FilterChanges Property
// see only inserted records
ADQuery1.FilterChanges := [rtInserted];


See Also

See Also
TADDataSet.FilterChanges Property
See Also

Filtering Records, Caching Updates, RowError, UpdateStatus


Example

Example
TADDataSet.FilteredData Property
ADQuery1.Filter := 'upper(name) like ''D%''';
ADQuery1.Filtered := True;
// copy to ADMemTable1 all ADQuery1 visible (where name starts from D) records
ADMemTable1.Data := ADQuery1.FilteredData;


See Also

See Also
TADDataSet.FilteredData Property
See Also

Delta, Data, Filter, OnFilterRecord, IndexName, IndexFieldNames, Indexes


Example

Example
TADDataSet.FindKey Method
ADQuery1.IndexFieldNames := 'F1;F2';
if not ADQuery1.FindKey([100, 'qwe']) then
  ShowMessage('100;qwe is not found');


See Also

See Also
TADDataSet.FindKey Method
See Also

Finding a Record, FindNearest, GotoKey, GotoNearest, IndexName, IndexFieldNames, Locate


Example

Example
TADDataSet.FindNearest Method
ADQuery1.IndexFieldNames := 'F1;F2';
ADQuery1.FindNearest([100, 'qwe']);


See Also

See Also
TADDataSet.FindNearest Method
See Also

Finding a Record, FindKey, GotoKey, GotoNearest, IndexName, IndexFieldNames, Locate


See Also

See Also
TADDataSet.FindParam Method
See Also

Params, ParamByName


See Also

See Also
TADDataSet.FormatOptions Property
See Also

Setting Options, TADFormatOptions, Params


See Also

See Also
TADDataSet.GetColumnField Method
See Also

GetFieldColumn


See Also

See Also
TADDataSet.GetDetailLinkFields Method
See Also

Master-Detail Relationship


See Also

See Also
TADDataSet.GetFieldColumn Method
See Also

Master-Detail Relationship, GetColumnField


See Also

See Also
TADDataSet.GetGroupState Method
See Also

GroupingLevel, IndexName, AggregatesActive


See Also

See Also
TADDataSet.GetIndexNames Method
See Also

IndexDefs, Indexes


Example

Example
TADDataSet.GetNextPacket Method
ADQuery1.FetchOptions.Mode := dmManual;
ADQuery1.SQL.Text := 'select * from mytab';
ADQuery1.Open;
// here RecordCount = 0
ADQuery1.GetNextPacket;
// here RecordCount <= FetchOptions.RowsetSize


See Also

See Also
TADDataSet.GetNextPacket Method
See Also

TDataSet.Open, TADFetchOptions.Mode, TADFetchOptions.RowsetSize


See Also

See Also
TADDataSet.GetParentRow Method
See Also

ParentDataSet


Example

Example
TADDataSet.GetRow Method
var
  oRow: TADDatSRow;
.....
oRow := ADQuery1.GetRow;
// cancel all changes for this row
oRow.RejectChanges;


See Also

See Also
TADDataSet.GetRow Method
See Also

TADDatSRow, TDataSet.ActiveBuffer


See Also

See Also
TADDataSet.GotoCurrent Method
See Also

CloneCursor


Example

Example
TADDataSet.GotoKey Method
ADQuery1.IndexFieldNames := 'CUSTOMER_ID;ORDER_DATE';
ADQuery1.SetKey;
ADQuery1.FieldByName('CUSTOMER_ID').AsInteger := 100;
ADQuery1.FieldByName('ORDER_DATE').AsDateTime := EncodeDate(2008, 5, 1);
if not ADQuery1.GotoKey then
  ShowMesage('Order is not found');


See Also

See Also
TADDataSet.GotoKey Method
See Also

Finding a Record, FindKey, FindNearest, GotoNearest, SetKey, Locate


Example

Example
TADDataSet.GotoNearest Method
ADQuery1.IndexFieldNames := 'CUSTOMER_ID;ORDER_DATE';
ADQuery1.SetKey;
ADQuery1.FieldByName('CUSTOMER_ID').AsInteger := 100;
ADQuery1.FieldByName('ORDER_DATE').AsDateTime := EncodeDate(2008, 5, 1);
ADQuery1.GotoNearest;


See Also

See Also
TADDataSet.GotoNearest Method
See Also

Finding a Record, FindKey, FindNearest, GotoKey, SetKey, Locate


See Also

See Also
TADDataSet.GroupingLevel Property
See Also

GetGroupState, IndexFieldCount


See Also

See Also
TADDataSet.IndexDefs Property
See Also

Sorting Records, Indexes, TADFetchOptions.Items


Example 1

Example 1
TADDataSet.Indexes Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_payments';
  Expression := 'sum(sal + bonus)';
  Filter := 'dep_id is not null;
  Active := True;
end;
ADMemTable1.IndexesActive := True;
ADMemTable1.IndexName := 'by_name';


Example 2

Example 2
TADDataSet.Indexes Property

See FireDAC\Samples\Comp Layer\TADQuery\Indices demo for details.


See Also

See Also
TADDataSet.Indexes Property
See Also

Sorting Records, Writing Expressions, IndexDefs, IndexesActive, IndexFieldNames, IndexName, BeginBatch, EndBatch


Example

Example
TADDataSet.IndexesActive Property
var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := ADQuery1.IndexesActive;
ADQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  ADQuery1.IndexesActive := lPrevIndsActive;
end;


See Also

See Also
TADDataSet.IndexesActive Property
See Also

Sorting Records, Indexes, BeginBatch, EndBatch


See Also

See Also
TADDataSet.IndexFieldCount Property
See Also

IndexFieldNames, IndexName


Example

Example
TADDataSet.IndexFieldNames Property
ADQuery1.IndexFieldNames := 'order_date;customer_name:N';


See Also

See Also
TADDataSet.IndexFieldNames Property
See Also

Sorting Records, Indexes, IndexName


See Also

See Also
TADDataSet.IndexFields Property
See Also

IndexFieldNames, IndexName, IndexFieldCount


Example

Example
TADDataSet.IndexName Property
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';


See Also

See Also
TADDataSet.IndexName Property
See Also

Sorting Records, Indexes, IndexFieldNames


See Also

See Also
TADDataSet.IsIndexed Method
See Also

IndexFieldNames, IndexName


See Also

See Also
TADDataSet.IsLinked Method
See Also

Master-Detail Relationship, MasterSource, ParentDataSet


See Also

See Also
TADDataSet.IsRanged Method
See Also

Filtering Records, ApplyRange, CancelRange


See Also

See Also
TADDataSet.KeyExclusive Property
See Also

Filtering Records, FindNearest, GotoNearest, SetRange, SetRangeEnd, SetRangeStart


Example 1

Example 1
TADDataSet.KeyFieldCount Property
ADQuery1.IndexFieldNames := 'EmployeeID;CustomerID;SellDate';
ADQuery1.SetKey;
ADQuery1.KeyFieldCount := 2;
ADQuery1.FieldByName('EmployeeID').AsInteger := 100;
ADQuery1.FieldByName('CustomerID').AsInteger := 200;
ADQuery1.GotoKey;


Example 2

Example 2
TADDataSet.KeyFieldCount Property
ADQuery1.IndexFieldNames := 'EmployeeID;CustomerID;SellDate';
ADQuery1.SetRangeStart;
ADQuery1.KeyFieldCount := 1;
ADQuery1.FieldByName('EmployeeID').AsInteger := 100;
ADQuery1.SetRangeEnd;
ADQuery1.KeyFieldCount := 1;
ADQuery1.FieldByName('EmployeeID').AsInteger := 100;
ADQuery1.ApplyRange;


See Also

See Also
TADDataSet.KeyFieldCount Property
See Also

Filtering Records, FindKey, FindNearest, GotoKey, GotoNearest


Example

Example
TADDataSet.LoadFromFile Method
ADQuery1.Open('select * from customers');
ADQuery1.FetchAll;
ADQuery1.SaveToFile('c:\customers.xml', sfAuto);
....
ADMemTable1.LoadFromFile('c:\customers.xml', sfAuto);
ADMemTable1.Locate('CUSTOMER_ID', [100], []);


See Also

See Also
TADDataSet.LoadFromFile Method
See Also

LoadFromStream, SaveToFile, TADResourceOptions.DefaultStoreExt, TADResourceOptions.DefaultStoreFormat, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADDataSet.LoadFromFileAtOpen Method
See Also

TADBottomResourceOptions.PersistentFileName, TADTopResourceOptions.DefaultStoreFolder, TADResourceOptions.Persistent


Example

Example
TADDataSet.LoadFromStream Method
var
  oStr: TStream;
....
oStr := ADQuery1.CreateBlobStream(ADQuery1.FieldByName('data'), bmRead);
try
  ADMemTable1.LoadFromStream(oStr, sfBinary);
finally
  oStr.Free;
end;


See Also

See Also
TADDataSet.LoadFromStream Method
See Also

LoadFromFile, SaveToStream, TADResourceOptions.DefaultStoreExt, TADResourceOptions.DefaultStoreFormat, TADBottomResourceOptions.PersistentFileName


Example 1

Example 1
TADDataSet.Locate Method
CustTable.IndexFieldNames := 'ID';
if CustTable.Locate('ID', 1001, []) then
  CustTable.Delete
else
  ShowMessage('The customer with ID=1001 is not found');


Example 2

Example 2
TADDataSet.Locate Method
CustTable.Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '831-431-1000']), [loPartialKey]);


See Also

See Also
TADDataSet.Locate Method
See Also

Finding a Record, LocateEx, Lookup, LookupEx, Indexes, IndexFieldNames, IndexName


Example

Example
TADDataSet.LocateEx Method (string, TADDataSetLocateOptions, PInteger)
procedure TForm1.BtnFindClick(ASender: TObject);
begin
  if not CustTable.LocateEx('name like ''P%D''', [lxoCaseInsensitive]) then
    ShowMessage('The customer with name starting from P and ending by D is not found');
end;

procedure TForm1.BtnNextClick(ASender: TObject);
begin
  if not CustTable.LocateEx('name like ''P%D''', [lxoCaseInsensitive, lxoFromCurrent]) then
    ShowMessage('The customer with name starting from P and ending by D is not found');
end;


See Also

See Also
TADDataSet.LocateEx Method (string, TADDataSetLocateOptions, PInteger)
See Also

Finding a Record, Locate, Lookup, LookupEx


Example

Example
TADDataSet.LocateEx Method (string, Variant, TADDataSetLocateOptions, PInteger)
procedure TForm1.BtnFindClick(ASender: TObject);
begin
  if not CustTable.LocateEx('COMPANY', 'AMCO', [lxoCaseInsensitive]) then
    ShowMessage('The customer from AMCO company is not found');
end;

procedure TForm1.BtnNextClick(ASender: TObject);
begin
  if not CustTable.LocateEx('COMPANY', 'AMCO', [lxoCaseInsensitive, lxoFromCurrent]) then
    ShowMessage('The customer from AMCO company is not found');
end;


See Also

See Also
TADDataSet.LocateEx Method (string, Variant, TADDataSetLocateOptions, PInteger)
See Also

Finding a Record, Locate, Lookup, LookupEx, Indexes, IndexFieldNames, IndexName


Example

Example
TADDataSet.Lookup Method
procedure TForm1.Button1Click(Sender: TObject);
var
  V: Variant;
  C: Integer;
  A: String;
begin
  V := ADQuery1.Lookup('Company;State', VarArrayOf(['Blue Sports', 'OR']), 'CustNo;Addr1');
  if not VarIsNull(V) then begin
    C := V[0];
    A := V[1];
    ShowMessage(IntToStr(C) + #13#10 + A);
  end
  else
    ShowMessage('The record is not found !');
end;


See Also

See Also
TADDataSet.Lookup Method
See Also

Finding a Record, LookupEx, Locate, LocateEx, Indexes, IndexFieldNames, IndexName


Example

Example
TADDataSet.LookupEx Method (string, string, TADDataSetLocateOptions, PInteger)
procedure TForm1.Button1Click(Sender: TObject);
var
  V: Variant;
  C: Integer;
  A: String;
begin
  V := ADQuery1.LookupEx('Company = ''Blue Sports'' and State = ''OR''', 'CustNo;Addr1', [lxoCaseInsensitive]);
  if not VarIsNull(V) then begin
    C := V[0];
    A := V[1];
    ShowMessage(IntToStr(C) + #13#10 + A);
  end
  else
    ShowMessage('The record is not found !');
end;


See Also

See Also
TADDataSet.LookupEx Method (string, string, TADDataSetLocateOptions, PInteger)
See Also

Finding a Record, Lookup, Locate, LocateEx


See Also

See Also
TADDataSet.LookupEx Method (string, Variant, string, TADDataSetLocateOptions, PInteger)
See Also

Finding a Record, Lookup, Locate, LocateEx, Indexes, IndexFieldNames, IndexName


Example

Example
TADDataSet.MasterFields Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


See Also

See Also
TADDataSet.MasterFields Property
See Also

Master-Detail Relationship, MasterSource, DetailFields, IndexFieldNames, IndexName


See Also

See Also
TADDataSet.MasterLink Property
See Also

Master-Detail Relationship


Example 1

Example 1
TADDataSet.MasterSource Property
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';


Example 2

Example 2
TADDataSet.MasterSource Property

See FireDAC\Samples\Comp Layer\TADQuery\MasterDetail demo for details.


See Also

See Also
TADDataSet.MasterSource Property
See Also

Master-Detail Relationship, MasterFields, IndexFieldNames, IndexName


See Also

See Also
TADDataSet.Offline Method
See Also

TADCustomConnection.Offline, FetchAll, Release


See Also

See Also
TADDataSet.OnMasterSetValues Event
See Also

Master-Detail Relationship, MasterSource, MasterFields


Example

Example
TADDataSet.OnReconcileError Event
procedure TForm1.ADMemTable1ReconcileError(DataSet: TADDataSet; E: EADException;
  UpdateKind: TADDatSRowState; var Action: TADDAptReconcileAction);
begin
  if (UpdateKind = rsInserted) and (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := raCorrect;
  end;
end;


See Also

See Also
TADDataSet.OnReconcileError Event
See Also

Caching Updates, Reconcile, ApplyUpdates, OnUpdateError


Example

Example
TADDataSet.OnUpdateError Event
procedure TForm1.ADQuery1UpdateError(ASender: TDataSet; AException: EADException;
    ARow: TADDatSRow; ARequest: TADUpdateRequest; var AAction: TADErrorAction);
begin
  if (E is EADDBEngineException) and (EADDBEngineException(E).Kind = ekUKViolated) then begin
    DataSet.FieldByName('ID').AsInteger := GetNextFreeID;
    Action := eaRetry;
  end;
end;


See Also

See Also
TADDataSet.OnUpdateError Event
See Also

Caching Updates, ApplyUpdates, CachedUpdates, Post, Delete, EADDBEngineException, OnUpdateRecord


Example 1

Example 1
TADDataSet.OnUpdateRecord Event
procedure TForm1.ADQuery1UpdateRecord(ASender: TDataSet; ARequest: TADUpdateRequest;
 var AAction: TADErrorAction; AOptions: TADUpdateRowOptions);
begin
  if ARequest = arInsert then begin
    // set the SQL command to insert new record
    ADQuery2.SQL := 'insert into mytab (id, code, name) values (:id, :code, :name) returning tmstamp into :ts';

    // set parameter values
    ADQuery2.Params[0].Value := ASender['id'];
    ADQuery2.Params[1].Value := ASender['code'];
    ADQuery2.Params[2].Value := ASender['name'];

    // specially define TS parameter
    ADQuery2.Params[3].DataType := ftDateTime;
    ADQuery2.Params[3].ParamType := ptOutput;

    // insert new record
    ADQuery2.ExecSQL;

    // move TS output parameter value back to dataset
    ASender['tmstamp'] := ADQuery2.Params[3].Value;

    // return 'Ok' status
    AAction := eaApplied;
  end;
end;


Example 2

Example 2
TADDataSet.OnUpdateRecord Event

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\CachedUpdates\OnUpdateRecord
  • FireDAC\Samples\Comp Layer\TADUpdateSQL\Main


See Also

See Also
TADDataSet.OnUpdateRecord Event
See Also

Overriding Posting Updates, ApplyUpdates, CachedUpdates, Post, Delete, OnUpdateError


Example

Example
TADDataSet.OpenOrExecute Method
ADQuery1.Disconnect(True);
ADQuery1.SQL.Assign(Memo1.Lines);
if ADQuery1.OpenOrExecute then begin
  PageControl1.ActivePage := DataGridPage;
  DataGridPage.TabVisible := True;
end
else
  DataGridPage.TabVisible := False;


See Also

See Also
TADDataSet.OpenOrExecute Method
See Also

TDataSet.Open, Execute, TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc


See Also

See Also
TADDataSet.ParamByName Method
See Also

FindParam


Example

Example
TADDataSet.ParamCount Property
var
  i: Integer;
...
Memo1.Lines.Clear;
for i := 0 to ADQuery1.ParamCount - 1 do
  Memo1.Lines.Add(ADQuery1.Params[i].Name);


See Also

See Also
TADDataSet.ParamCount Property
See Also

Params, TADResourceOptions.ParamCreate


Example 1

Example 1
TADDataSet.Params Property
// TADQuery automatic parameters creation - ResourceOptions.ParamCreate = True
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
ADQuery1.Params[0].AsString := 'qwe';
ADQuery1.Open;


Example 2

Example 2
TADDataSet.Params Property
// TADQuery manual parameters creation - ResourceOptions.ParamCreate = False
ADQuery1.ResourceOptions.ParamCreate := False;
ADQuery1.SQL.Text := 'select * from mytab where id = :id';
with ADQuery1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
  AsString := 'qwe';
end;
ADQuery1.Open;


Example 3

Example 3
TADDataSet.Params Property
// TADStoredProc automatic parameters creation - fiMeta in FetchOptions.Items
ADStoredProc1.StoredProcName := 'my_proc';
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;


Example 4

Example 4
TADDataSet.Params Property
// TADStoredProc manual parameters creation - fiMeta not in FetchOptions.Items
ADStoredProc1.FetchOptions.Items := ADStoredProc1.FetchOptions.Items - [fiMeta];
ADStoredProc1.StoredProcName := 'my_proc';
with ADStoredProc1.Params.Add do begin
  Name := 'id';
  DataType := ftString;
  Size := 10;
end;
ADStoredProc1.Prepare;
ADStoredProc1.Params[0].AsString := 'qwe';
ADStoredProc1.ExecProc;


See Also

See Also
TADDataSet.Params Property
See Also

Executing Command, Executing Stored Procedure, TADCustomQuery.SQL, TADCustomStoredProc.StoredProcName, TADParams, TADResourceOptions.ParamCreate, TADFetchOptions.Items


See Also

See Also
TADDataSet.ParentDataSet Property
See Also

DB.TDataSetField


See Also

See Also
TADDataSet.Reconcile Method
See Also

Caching Updates, ApplyUpdates, RowError, FilterChanges, OnReconcileError


Example

Example
TADDataSet.RefreshRecord Method
ADQuery1.UpdateObject := ADUpdateSQL;
// PL/SQL block calling packaged procedure returning customer data by its ID
ADUpdateSQL.FetchRowSQL.Text := 'begin cust_pack.read_cust_data(:new_name, :new_company, :new_state, :old_id); end;';
// always is required to setup output parameters
with ADUpdateSQL.Commands[arFetchRow] do begin
  Params[0].ParamType := ptOutput;
  Params[0].DataType := ftString;
  Params[1].ParamType := ptOutput;
  Params[1].DataType := ftString;
  Params[2].ParamType := ptOutput;
  Params[2].DataType := ftString;
end;
...
ADQuery1.RefreshRecord;


See Also

See Also
TADDataSet.RefreshRecord Method
See Also

TDataSet.Refresh, OnUpdateRecord, TADAdaptedDataSet.UpdateObject, TADUpdateSQL.FetchRowSQL, TADUpdateOptions.RefreshDelete, Update Command Generation


Example

Example
TADDataSet.RefreshUnknownRecord Method
// Assign 101 to ID field, fetch record immediately and set current position to it.
ADQuery1.RefreshUnknownRecord([101], True, True);


See Also

See Also
TADDataSet.RefreshUnknownRecord Method
See Also

RefreshRecord, TDataSet.Refresh


See Also

See Also
TADDataSet.Release Method
See Also

FetchAll, Offline, Disconnect


See Also

See Also
TADDataSet.ResourceOptions Property
See Also

Setting Options, TADBottomResourceOptions


Example

Example
TADDataSet.RevertRecord Method

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.


See Also

See Also
TADDataSet.RevertRecord Method
See Also

UndoLastChange, CancelUpdates, SavePoint


Example

Example
TADDataSet.RowError Property
var
  oErr: EADException;
...
if ADQuery1.ApplyUpdate > 0 then begin
  ADQuery1.FilterChanges := [rtModified, rtInserted, rtDeleted, rtHasErrors];
  ADQuery1.First;
  while not ADQuery1.Eof do begin
    oErr := ADQuery1.RowError;
    // process exception object
    ADQuery1.Next;
  end;
  ADQuery1.FilterChanges := [rtUnmodified, rtModified, rtInserted];
end;


See Also

See Also
TADDataSet.RowError Property
See Also

Caching Updates, CachedUpdates, FilterChanges


Example 1

Example 1
TADDataSet.SavePoint Property
var
  iSavePoint: Integer;
....
  // remember changes log state
  iSavePoint := ADMemTable1.SavePoint;
  try
    ADMemTable1.AppendRecord(....);
    ADMemTable1.AppendRecord(....);
    ADMemTable1.AppendRecord(....);
    ...
    ADMemTable1.Delete;
    // mark changes as persistent and clear change log
    ADMemTable1.CommitUpdates;
  except
    // in case of exception, undo changes
    ADMemTable1.SavePoint := iSavePoint;
    raise;
  end;


Example 2

Example 2
TADDataSet.SavePoint Property

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.


See Also

See Also
TADDataSet.SavePoint Property
See Also

CachedUpdates, ChangeCount, UndoLastChange, RevertRecord, CancelUpdates


Example

Example
TADDataSet.SaveToFile Method
ADQuery1.Open('select * from customers');
ADQuery1.FetchAll;
ADQuery1.SaveToFile('c:\customers.xml', sfAuto);
....
ADMemTable1.LoadFromFile('c:\customers.xml', sfAuto);
ADMemTable1.Locate('CUSTOMER_ID', [100], []);


See Also

See Also
TADDataSet.SaveToFile Method
See Also

SaveToStream, TADResourceOptions.DefaultStoreExt, TADResourceOptions.DefaultStoreFormat, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADDataSet.SaveToFileAtClose Method
See Also

TADBottomResourceOptions.PersistentFileName, TADTopResourceOptions.DefaultStoreFolder, TADResourceOptions.Persistent


Example

Example
TADDataSet.SaveToStream Method
var
  oStr: TStream;
  ....
  ADQuery1.Edit;
  oStr := ADQuery1.CreateBlobStream(ADQuery1.FieldByName('data'), bmWrite);
  try
    ADMemTable1.SaveToStream(oStr, sfBinary);
  finally
    oStr.Free;
    ADQuery1.Post;
  end;


See Also

See Also
TADDataSet.SaveToStream Method
See Also

SaveToFile, LoadFromStream, TADResourceOptions.DefaultStoreExt, TADResourceOptions.DefaultStoreFormat, TADBottomResourceOptions.PersistentFileName


Example

Example
TADDataSet.SetFieldAttributes Method
ADQuery1.FieldDefs.Updated := False;
ADQuery1.FieldDefs.Update;
ADQuery1.CreateFields;
....
ADQuery1.Open;
ADQuery1.SetFieldAttributes;


See Also

See Also
TADDataSet.SetFieldAttributes Method
See Also

TField.ProviderFlags, TDataSet.CreateFields


Example

Example
TADDataSet.SetKey Method
ADQuery1.IndexFieldNames := 'CUSTOMER_ID;ORDER_DATE';
ADQuery1.SetKey;
ADQuery1.FieldByName('CUSTOMER_ID').AsInteger := 100;
ADQuery1.FieldByName('ORDER_DATE').AsDateTime := EncodeDate(2008, 5, 1);
if not ADQuery1.GotoKey then
  ShowMesage('Order is not found');


See Also

See Also
TADDataSet.SetKey Method
See Also

Finding a Record, EditKey, GotoKey, SetRange, SetRangeEnd, SetRangeStart, TDataSet.State, TDataSet.FieldByName, IndexName, IndexFieldNames, Indexes


Example

Example
TADDataSet.SetRange Method
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRange([100], [200]);


See Also

See Also
TADDataSet.SetRange Method
See Also

Filtering Records, SetRangeEnd, SetRangeStart, ApplyRange, TDataSet.State, TDataSet.FieldByName, IndexName, IndexFieldNames, Indexes


Example

Example
TADDataSet.SetRangeEnd Method
ADQuery1.IndexFieldNames := 'CUST_NO';
...
ADQuery1.SetRangeEnd;
ADQuery1.FieldByName('CUST_NO').AsInteger := 200;
...
ADQuery1.ApplyRange;


See Also

See Also
TADDataSet.SetRangeEnd Method
See Also

Filtering Records, SetRangeStart, EditRangeStart, ApplyRange, IndexName, IndexFieldNames, Indexes, TDataSet.State, TDataSet.FieldByName


Example

Example
TADDataSet.SetRangeStart Method
ADQuery1.IndexFieldNames := 'CUST_NO';
ADQuery1.SetRangeStart;
ADQuery1.FieldByName('CUST_NO').AsInteger := 100;
...
ADQuery1.ApplyRange;


See Also

See Also
TADDataSet.SetRangeStart Method
See Also

Filtering Records, SetRangeEnd, EditRangeStart, ApplyRange, IndexName, IndexFieldNames, Indexes, TDataSet.State, TDataSet.FieldByName


See Also

See Also
TADDataSet.SourceEOF Property
See Also

Next, FetchAll


Example

Example
TADDataSet.SourceView Property
var
  i, iVal, iMax: Integer;
....
// searching the maximum value of ID integer field, without navigating through dataset
iMax := 0;
for i := 0 to ADQuery1.SourceView.Rows.Count - 1 do
  if ADQuery1.SourceView.Rows[i].GetData('id', @iVal) and (iVal > iMax) then
    iMax := iVal;


See Also

See Also
TADDataSet.SourceView Property
See Also

Table, View, uADDatSManager.TADDatSView


See Also

See Also
TADDataSet Class
See Also

TADAdaptedDataSet, TADDatSTable, TADDatSView, TADDatSRow, uADStanOption


Example

Example
TADDataSet.Table Property
var
  i: Integer;
....
// delete all rows, where ID = 100, without navigating through dataset
for i := ADQuery1.Table.Rows.Count - 1 downto 0 do
  if ADQuery1.Table.Rows[i].GetData('id') = 100 then
    ADQuery1.Table.Rows[i].Delete;
ADQuery1.Resync([]);


See Also

See Also
TADDataSet.Table Property
See Also

View, SourceView, AttachTable, TADCustomMemTable


Example 1

Example 1
TADDataSet.UndoLastChange Method
procedure TForm1.btnUndoClick(ASender: TObject);
begin
  ADQuery1.UndoLastChange(True);
end;


Example 2

Example 2
TADDataSet.UndoLastChange Method

See FireDAC\Samples\Comp Layer\TADMemTable\CachedUpdates sample for details.


See Also

See Also
TADDataSet.UndoLastChange Method
See Also

Caching Updates, UpdatesPending, RevertRecord, CancelUpdates, SavePoint


Example

Example
TADDataSet.UpdateAttributes Method
ADQuery1.FieldByName('ObjGUID').DefaultExpression := 'NEWGUID()';
ADQuery1.UpdateAttributes;


See Also

See Also
TADDataSet.UpdateAttributes Method
See Also

Specifying Default Values, UpdateConstraints, TField.DefaultExpression, TADAutoIncField


Example

Example
TADDataSet.UpdateConstraints Method
with ADQuery1.FieldByName('age') do begin
  CustomConstraint := 'age >= 18';
  ConstraintErrorMessage := 'The age must be greater or equal to 18 years';
end;
ADQuery1.UpdateConstraints;


See Also

See Also
TADDataSet.UpdateConstraints Method
See Also

DisableConstraints, EnableConstraints, Constraints, ConstraintsEnabled, UpdateAttributes


See Also

See Also
TADDataSet.UpdateOptions Property
See Also

Setting Options, TADBottomUpdateOptions


See Also

See Also
TADDataSet.Updates Property
See Also

TADDatSUpdatesJournal


See Also

See Also
TADDataSet.UpdatesPending Property
See Also

Caching Updates, CachedUpdates, ChangeCount, ApplyUpdates, CommitUpdates, CancelUpdates


Example

Example
TADDataSet.UpdateStatus Method
procedure TForm1.ADQuery1AfterScroll(DataSet: TDataSet);
begin
  case TADQuery(DataSet).UpdateStatus of
  usUnmodified: Label1.Caption := '';
  usModified: Label1.Caption := 'Modified';
  usDeleted: Label1.Caption := 'Deleted';
  usInserted: Label1.Caption := 'Inserted';
  end;
end;


See Also

See Also
TADDataSet.UpdateStatus Method
See Also

Caching Updates, UndoLastChange, FilterChanges


See Also

See Also
TADDataSet.View Property
See Also

Table, SourceView, AttachTable, TADCustomMemTable


See Also

See Also
TADIndex.Active Property
See Also

ActualValue, Selected, TADDataSet.IndexesActive


See Also

See Also
TADIndex.ActualActive Property
See Also

Active, Selected, TADDataSet.IndexesActive


Example

Example
TADIndex.CaseInsFields Property
with ADQuery1.Indexes.Add do begin
  Name := 'i1';
  Fields := 'Name;BirthDate';
  CaseInsFields := 'Name';
  Active := True;
  Selected := True;
end;


See Also

See Also
TADIndex.CaseInsFields Property
See Also

Fields, DescFields


See Also

See Also
TADIndex.DataSet Property
See Also

TADDataSet


Example

Example
TADIndex.DescFields Property
with ADQuery1.Indexes.Add do begin
  Name := 'i1';
  Fields := 'Name;BirthDate';
  DescFields := 'BirthDate';
  Active := True;
  Selected := True;
end;


See Also

See Also
TADIndex.DescFields Property
See Also

Fields, CaseInsFields


Example

Example
TADIndex.Expression Property
ADQuery1.Indexes[0].Expression := 'Upper(Left(Name, 1))';


See Also

See Also
TADIndex.Expression Property
See Also

Fields, Options


Example

Example
TADIndex.Fields Property
// sort by Name - case insensitive and by BithDate - descending
ADQuery1.Indexes[0].Fields := 'Name:N;BirthDate:D';


See Also

See Also
TADIndex.Fields Property
See Also

DescFields, CaseInsFields, Expression, Options


Example

Example
TADIndex.Filter Property
ADMemTable.Indexes[0].Filter := 'Name LIKE ''A%''';


See Also

See Also
TADIndex.Filter Property
See Also

Fields, Expression, FilterOptions


See Also

See Also
TADIndex.FilterOptions Property
See Also

Filter


See Also

See Also
TADIndex.Name Property
See Also

TADIndexes.FindIndex, TADIndexes.IndexByName


See Also

See Also
TADIndex.Options Property
See Also

Fields, Expression, CaseInsFields, DescFields, TADDataSet.ConstraintsEnabled


See Also

See Also
TADIndex.Selected Property
See Also

TADDataSet.IndexName, TADDataSet.IndexFieldNames, TADIndex.Active


Example

Example
TADIndex Class
ADQuery1.IndexesActive := True;
ADQuery1.Open;

with ADQuery1.Indexes.Add do begin
  Name := 'Orders';
  Fields := 'ORDER_NO;PART_NO';
  Filter := 'OrderDate < ''01.01.2008''';
  Active := True;
  Selected := True;
end;


See Also

See Also
TADIndex Class
See Also

TADIndexes, TADDataSet, TADDataSet.IndexFieldNames, TADDataSet.IndexName, TADDataSet.Indexes, TADDataSet.IndexesActive


Example

Example
TADIndexes.Add Method
with ADQuery1.Indexes.Add do begin
  Name := 'i1';
  Fields := 'Name';
  Active := True;
end;


See Also

See Also
TADIndexes.Add Method
See Also

Items, TCollection.Count


Example

Example
TADIndexes.FindIndex Method
var
  oInd: TADIndex;
...
oInd := ADQuery1.Indexes.FindIndex('i1');
if oInd = nil then
  with ADQuery1.Indexes.Add do begin
    Name := 'i1';
    Fields := 'Name';
    Active := True;
  end;


See Also

See Also
TADIndexes.FindIndex Method
See Also

TADIndex.Name, IndexByName, FindIndexForFields, Items


Example

Example
TADIndexes.FindIndexForFields Method
var
  oInd: TADIndex;
...
oInd := ADMemTable1.Indexes.FindIndexForFields('ID', [soUnique], []);
if oInd <> nil then
  oInd.Selected := True;


See Also

See Also
TADIndexes.FindIndexForFields Method
See Also

TADIndex.Fields, TADIndex.Options, FindIndex, IndexByName, Items


Example

Example
TADIndexes.IndexByName Method
ADQuery1.Indexes.IndexByName('i1').Selected := True;


See Also

See Also
TADIndexes.IndexByName Method
See Also

TADIndex.Name, FindIndex, Items


See Also

See Also
TADIndexes.Items Property
See Also

TADIndex, TCollection.Count


See Also

See Also
TADIndexes Class
See Also

TADIndex, TADDataSet, TADDataSet.IndexesActive


See Also

See Also
TADMasterDataLink.ActualDelayedScrollEnabled Property
See Also

DelayedScrollEnabled, DetailDelay


See Also

See Also
TADMasterDataLink.CancelSync Method
See Also

Synchronize


See Also

See Also
TADMasterDataLink.DelayedScrollEnabled Property
See Also

ActualDelayedScrollEnabled, DisableDelayedScroll, EnableDelayedScroll, DetailDelay


Example

Example
TADMasterDataLink.DisableDelayedScroll Method
qDetail.MasterLink.DisableDelayedScroll;
try
  qMaster.First;
  while not qMaster.Eof do begin
    if qMaster.Fields[i].AsInteger = 100 then begin
      // read qDetail dataset - it is synchronized with qMaster
    end;
    qMaster.Next;
  end;
finally
  qDetail.MasterLink.EnableDelayedScroll;
end;


See Also

See Also
TADMasterDataLink.DisableDelayedScroll Method
See Also

Synchronize, EnableDelayedScroll, DetailDelay


Example

Example
TADMasterDataLink.DisableScroll Method
qDetail.MasterLink.DisableScroll;
try
  qMaster.First;
  while not qMaster.Eof do begin
    if qMaster.Fields[i].AsInteger = 100 then begin
      qDetail.ApplyMaster;
      // read qDetail dataset - it is synchronized with qMaster
    end;
    qMaster.Next;
  end;
finally
  qDetail.MasterLink.EnableScroll;
end;


See Also

See Also
TADMasterDataLink.DisableScroll Method
See Also

EnableScroll


See Also

See Also
TADMasterDataLink.EnableDelayedScroll Method
See Also

Synchronize, DisableDelayedScroll


See Also

See Also
TADMasterDataLink.EnableScroll Method
See Also

DisableScroll


See Also

See Also
TADMasterDataLink Class
See Also

Master-Detail Relationship, DetailDelay


Example

Example
TADMasterDataLink.Synchronize Method
qMaster.First;
while not qMaster.Eof do begin
  if qMaster.Fields[i].AsInteger = 100 then begin
    qDetail.MasterLink.Synchronize(True);
    // read qDetail dataset - here it is synchronized with qMaster
  end;
  qMaster.Next;
end;


See Also

See Also
TADMasterDataLink.Synchronize Method
See Also

CancelSync, DisableDelayedScroll, EnableDelayedScroll, DisableScroll, EnableScroll, DetailDelay


Example

Example
TADSQLTimeIntervalField.AsSQLTimeInterval Property
var
  rInt: TADSQLTimeInterval;
...
  rInt.Sign := 1;
  rInt.Kind := itYear2Month;
  rInt.Years := 5;
  rInt.Months := 11;
  ADQuery1EventInt.AsSQLTimeInterval := rInt;


See Also

See Also
TADSQLTimeIntervalField.AsSQLTimeInterval Property
See Also

TField.AsVariant, TField.AsString, uADStanSQLTimeInt.TADSQLTimeInterval


See Also

See Also
TADSQLTimeIntervalField.IntervalKind Property
See Also

uADStanSQLTimeInt


See Also

See Also
TADSQLTimeIntervalField Class
See Also

uADStanSQLTimeInt


See Also

See Also
TADWideMemoField Class
See Also

TWideMemoField


See Also

See Also
TADXMLField Class
See Also

TADWideMemoField


See Also

See Also
uADCompGUIx Namespace
See Also

TADResourceOptions.CmdExecMode, Handling Errors, uADStanError, Establishing Connection, Executing SQL Scripts, uADCompScript Namespace


uADCompGUIx Namespace Classes

uADCompGUIx Namespace Classes
uADCompGUIx Namespace Legend
Classes
Class | Description
TADGUIxAsyncExecuteDialog | The dialog showing a SQL query execution progress.
TADGUIxComponent | The base class for all FireDAC GUIx components.
TADGUIxErrorDialog | The dialog displaying FireDAC exceptions.
TADGUIxLoginDialog | The dialog allows the users to enter their DB credentials.
TADGUIxScriptDialog | The dialog showing a SQL script execution progress.
TADGUIxWaitCursor | The component allowing to control the wait cursor.


Legend

Legend
uADCompGUIx Namespace
Legend
Class


Topics

Topics
uADCompGUIx Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADGUIxAsyncExecuteDialog.Caption Property
See Also

Prompt


See Also

See Also
TADGUIxAsyncExecuteDialog.HideDelay Property
See Also

ShowDelay.


See Also

See Also
TADGUIxAsyncExecuteDialog.OnHide Event
See Also

OnShow


See Also

See Also
TADGUIxAsyncExecuteDialog.OnShow Event
See Also

OnHide


See Also

See Also
TADGUIxAsyncExecuteDialog.Prompt Property
See Also

Caption


See Also

See Also
TADGUIxAsyncExecuteDialog.ShowDelay Property
See Also

HideDelay


See Also

See Also
TADGUIxAsyncExecuteDialog Class
See Also

TADResourceOptions.CmdExecMode


Example

Example
TADGUIxComponent.Provider Property
uses
   uADGUIxFMXfLogin;
....
ADGUIxLoginDialog1.Provider := 'FMX';
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.Connected := True;


See Also

See Also
TADGUIxErrorDialog.OnHide Property
See Also

OnShow, Enabled


See Also

See Also
TADGUIxErrorDialog.OnShow Property
See Also

OnHide, Enabled


See Also

See Also
TADGUIxErrorDialog Class
See Also

Handling Errors, EADDBEngineException


See Also

See Also
TADGUIxErrorDialog.StayOnTop Property
See Also

Enabled


See Also

See Also
TADGUIxLoginDialog.GetAllLoginParams Method
See Also

ConnectionDef


See Also

See Also
TADGUIxLoginDialog.HistoryEnabled Property
See Also

HistoryKey, HistoryStorage, HistoryWithPassword


See Also

See Also
TADGUIxLoginDialog.HistoryKey Property
See Also

HistoryStorage, HistoryEnabled, HistoryWithPassword


See Also

See Also
TADGUIxLoginDialog.HistoryStorage Property
See Also

HistoryKey, HistoryEnabled, HistoryWithPassword


See Also

See Also
TADGUIxLoginDialog.HistoryWithPassword Property
See Also

HistoryStorage, HistoryKey, HistoryEnabled


See Also

See Also
TADGUIxLoginDialog.OnChangePassword Property
See Also

ConnectionDef


See Also

See Also
TADGUIxLoginDialog.OnHide Event
See Also

OnShow


See Also

See Also
TADGUIxLoginDialog.OnLogin Property
See Also

ConnectionDef


See Also

See Also
TADGUIxLoginDialog.OnShow Event
See Also

OnHide


Example

Example
TADGUIxLoginDialog Class
ADGUIxLoginDialog1.Caption := 'Your ERP login';
with ADGUIxLoginDialog1.VisibleItems do begin
  Clear;
  Add('User_name=Your name');
  Add('Password=Your key');
end;
ADGUIxLoginDialog1.HistoryEnabled := False;

ADConnection1.ConnectionDefName := 'Oracle_Demo';
ADConnection1.LoginDialog := ADGUIxLoginDialog1;
ADConnection1.Connected := True;


See Also

See Also
TADGUIxLoginDialog Class
See Also

Establishing Connection, TADCustomConnection.LoginDialog


Example

Example
TADGUIxLoginDialog.VisibleItems Property
with ADGUIxLoginDialog1.VisibleItems do begin
  Clear;
  Add('Database');
  Add('User_name=Your name');
  Add('Password=Your key');
end;


See Also

See Also
TADGUIxScriptDialog.OnHide Event
See Also

OnShow


See Also

See Also
TADGUIxScriptDialog.OnInput Property
See Also

OnPause


See Also

See Also
TADGUIxScriptDialog.OnPause Property
See Also

OnInput


See Also

See Also
TADGUIxScriptDialog.OnShow Event
See Also

OnHide


See Also

See Also
TADGUIxScriptDialog Class
See Also

Executing SQL Scripts, TADScript Class


See Also

See Also
TADGUIxWaitCursor.OnHide Event
See Also

OnShow


See Also

See Also
TADGUIxWaitCursor.OnShow Event
See Also

OnHide


See Also

See Also
uADCompScript Namespace
See Also

Executing SQL Scripts, uADCompClient, uADCompScriptCommands


uADCompScript Namespace Classes

uADCompScript Namespace Classes
uADCompScript Namespace Legend
Classes
Class | Description
TADScript | The class implementing SQL script engine, capable to execute a series of SQL queries.
TADScriptCommand | The base class for custom script commands.
TADScriptCommandRegistry | The list of the registered script commands.
TADScriptOptions | The class implementing SQL script engine options.
TADSQLScript | An in-memory stored SQL script.
TADSQLScripts | TADSQLScripts is a collection of the TADSQLScript objects.


Legend

Legend
uADCompScript Namespace
Legend
Class


Topics

Topics
uADCompScript Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


Example

Example
TADScript.AbortJob Method
// background thread
ADScript1.ExecuteAll;
...
// main thread
ADScript1.AbortJob(True);


See Also

See Also
TADScript.AbortJob Method
See Also

Finished, Status


See Also

See Also
TADScript.AfterExecute Event
See Also

BeforeExecute, AfterScript


See Also

See Also
TADScript.AfterScript Event
See Also

BeforeScript, AfterExecute


See Also

See Also
TADScript.AllSpools Property
See Also

ExecuteAll, SpoolOutput, SpoolFileName, CloseSpool, UpdateSpool


Example 1

Example 1
TADScript.Arguments Property
with ADScript1.Arguments do begin
  Add('scott/tiger@orasrv');
  Add('c:\temp\');
end;
with ADScript1.SQLScripts.Add do begin
  SQL.Add(....);
  SQL.Add('connect &1');
  SQL.Add(....);
  SQL.Add('spool &2');
end;


Example 2

Example 2
TADScript.Arguments Property
with ADScript1.SQLScripts.Add do begin
  SQL.Add('@@DropTab Orders');
  SQL.Add('@@DropTab Tickets');
  SQL.Add('@@DropTab Posts');
end;
with ADScript1.SQLScripts.Add do begin
  Name := 'DropTab';
  SQL.Add('drop table &1;');
  SQL.Add('drop table &1_details;');
end;


See Also

See Also
TADScript.Arguments Property
See Also

Macros, Params


See Also

See Also
TADScript.BeforeExecute Event
See Also

AfterExecute, BeforeScript


See Also

See Also
TADScript.BeforeScript Event
See Also

AfterScript, BeforeExecute


See Also

See Also
TADScript.Connection Property
See Also

TADScriptOptions.DriverID, Transaction


See Also

See Also
TADScript.CurrentCommand Property
See Also

CallStack


Example

Example
TADScript.EOF Property
procedure TForm1.acRunUpdate(Sender: TObject);
begin
  acStep.Enabled := ADScript1.Connection.Connected and not ADScript1.EOF;
end;


See Also

See Also
TADScript.EOF Property
See Also

Position, ValidateStep, ExecuteStep, Finished, Status


Example 1

Example 1
TADScript.ExecuteAll Method
ADScript1.SQLScriptFileName := 'c:\temp\createdb.sql';
ADScript1.ExecuteAll;


Example 2

Example 2
TADScript.ExecuteAll Method

The following code shows how to wrap the script execution into transaction:

ADConnection1.StartTransaction;
try
  ADScript1.ExecuteAll;
finally
  if ADScript1.TotalErrors > 0 then
    ADConnection1.Rollback
  else
    ADConnection1.Commit;
end;


See Also

See Also
TADScript.ExecuteAll Method
See Also

ExecuteFile, ExecuteScript, AbortJob, BeforeExecute, AfterExecute, BeforeScript, AfterScript


Example

Example
TADScript.ExecuteFile Method (String, array of String)
ADScript1.ExecuteFile('c:\temp\createdb.sql', ['scott/tiger@mydb', 'c:\temp\']);


See Also

See Also
TADScript.ExecuteFile Method (String, array of String)
See Also

SQLScripts, SQLScriptFileName, ValidateAll, ExecuteAll, Arguments


Example

Example
TADScript.ExecuteFile Method (String)
 ADScript1.ExecuteFile('c:\temp\createdb.sql');


See Also

See Also
TADScript.ExecuteFile Method (String)
See Also

SQLScripts, SQLScriptFileName, ValidateAll, ExecuteAll


Example

Example
TADScript.ExecuteScript Method (TStrings, array of String)
ADScript1.ExecuteScript(Memo1.Lines, ['scott/tiger@mydb', 'c:\temp\']);


See Also

See Also
TADScript.ExecuteScript Method (TStrings, array of String)
See Also

SQLScripts, SQLScriptFileName, ValidateAll, ExecuteAll, Arguments


Example

Example
TADScript.ExecuteScript Method (TStrings)
ADScript1.ExecuteScript(Memo1.Lines);


See Also

See Also
TADScript.ExecuteScript Method (TStrings)
See Also

SQLScripts, SQLScriptFileName, ValidateAll, ExecuteAll


Example

Example
TADScript.ExecuteStep Method
ADScript1.Position := Memo1.CaretPos;
ADScript1.ExecuteStep;
Memo1.CaretPos := ADScript1.Position;


See Also

See Also
TADScript.ExecuteStep Method
See Also

Position, EOF, ValidateStep, ExecuteAll


See Also

See Also
TADScript.FetchOptions Property
See Also

FormatOptions, ResourceOptions


See Also

See Also
TADScript.Finished Property
See Also

AbortJob, Status, ValidateStep, ExecuteStep


See Also

See Also
TADScript.FormatOptions Property
See Also

FetchOptions, ResourceOptions


See Also

See Also
TADScript.LastSpoolFileName Property
See Also

SpoolOutput, SpoolFileName


See Also

See Also
TADScript.Macros Property
See Also

Arguments, Params


Example

Example
TADScript.OnConsoleGet Event
procedure TForm1.ADScript1ConsoleGet(AEngine: TADScript; const APrompt: String; var AResult: String);
begin
  InputQuery('Enter value', APrompt, AResult);
end;


See Also

See Also
TADScript.OnConsoleGet Event
See Also

ScriptDialog, OnConsolePut, OnPause


See Also

See Also
TADScript.OnConsoleLockUpdate Event
See Also

OnConsolePut


Example

Example
TADScript.OnConsolePut Event
procedure TForm1.ADScrip1ConsolePut(AEngine: TADScript; const AMessage: String; AKind: TADScriptOuputKind);
begin
  mmLog.Lines.AddObject(AMessage, nil);
  Application.ProcessMessages;
end;


See Also

See Also
TADScript.OnConsolePut Event
See Also

ScriptDialog, OnConsoleGet, OnConsoleLockUpdate


Example

Example
TADScript.OnGetText Event
procedure TForm1.ADScript1GetText(AEngine: TADScript; const AFileName: string; AMode: TADScriptTextMode; out AText: TADTextFile);
begin
   AText := TADTextFile.Create(...);
end;


See Also

See Also
TADScript.OnGetText Event
See Also

OnReleaseText


Example

Example
TADScript.OnPause Event
procedure TForm1.ADScript1Pause(AEngine: TADScript; const AText: String);
begin
  ShowMessage(AText);
end;


See Also

See Also
TADScript.OnPause Event
See Also

ScriptDialog, OnConsoleGet


Example

Example
TADScript.OnProgress Event
procedure TForm1.ADScript1Progress(ASender: TObject);
begin
  ProgressBar1.Position := ADScript1.TotalPct10Done;
end;


See Also

See Also
TADScript.OnProgress Event
See Also

TotalJobDone, TotalJobSize, TotalPct10Done, ScriptDialog


See Also

See Also
TADScript.OnReleaseText Event
See Also

OnGetText


Example

Example
TADScript.OnSpoolPut Event
procedure TForm1.ADScript1SpoolPut(AEngine: TADScript; const AMessage: String; AKind: TADScriptOuputKind);
begin
  Memo1.Lines.Add(AMessage);
end;


See Also

See Also
TADScript.OnSpoolPut Event
See Also

SpoolOutput, SpoolFileName


See Also

See Also
TADScript.Params Property
See Also

Arguments, Macros


See Also

See Also
TADScript.Position Property
See Also

EOF, ValidateStep, ExecuteStep


See Also

See Also
TADScript.ProcessedAfterCommit Property
See Also

CommitEachNCommands


See Also

See Also
TADScript.ResourceOptions Property
See Also

FetchOptions, FormatOptions


Example 1

Example 1
TADScript.ScriptDialog Property

GUI application:

uses
  uADGUIxFormsfScript;
...
ADGUIxScriptDialog1.Provider := 'Forms';
ADScript1.ScriptDialog := ADGUIxScriptDialog1;


Example 2

Example 2
TADScript.ScriptDialog Property

Console application:

uses
  uADGUIxConsoleScript;
...
ADGUIxScriptDialog1.Provider := 'Console';
ADScript1.ScriptDialog := ADGUIxScriptDialog1;


See Also

See Also
TADScript.ScriptDialog Property
See Also

TADGUIxScriptDialog, OnProgress, OnConsoleGet, OnConsolePut, OnPause


See Also

See Also
TADScript.ScriptOptions Property
See Also

TADScriptOptions


Example

Example
TADScript.SQLScriptFileName Property
ADScript1.Arguments.Clear;
ADScript1.Arguments.Add('financial');
ADScript1.ScriptOptions.DefaultScriptPath := 'c:\temp';
ADScript1.SQLScriptFileName := 'create_&1_db';
// a file name will be resolved into c:\temp\create_financial_db.sql
ADScript1.ExecuteAll;


See Also

See Also
TADScript.SQLScriptFileName Property
See Also

ExecuteAll, DefaultScriptPath, OnGetText, SQLScripts, Macros, Arguments


Example

Example
TADScript.SQLScripts Property
with ADScript1.SQLScripts do begin
  Clear;
  with Add do begin
    Name := 'root';
    SQL.Add('@first');  // explicitly call 'first' script
    SQL.Add('@second'); // explicitly call 'second' script
  end;
  with Add do begin
    Name := 'first';
    SQL.Add('create table t1 (...);');
    SQL.Add('create table t2 (...);');
  end;
  with Add do begin
    Name := 'second';
    SQL.Add('create procedure p1 (...);');
    SQL.Add('create procedure p2 (...);');
  end;
end;
ADScript1.ValidateAll;
ADScript1.ExecuteAll;


See Also

See Also
TADScript.SQLScripts Property
See Also

ExecuteAll, OnGetText, SQLScriptFileName


Example

Example
TADScript Class

You can find TADScript related demos in the FireDAC\Samples\Comp Layer\TADScript folder:

  • Main - the demo application, showing different aspects of TADScript
  • GUI - the generic SQL script execution GUI application
  • Console - the generic SQL script execution console application


See Also

See Also
TADScript Class
See Also

Executing SQL Scripts, TADQuery, TADConnection


See Also

See Also
TADScript.Status Property
See Also

Finished, EOF, TotalErrors


See Also

See Also
TADScript.TotalErrors Property
See Also

IgnoreError, BreakOnError


See Also

See Also
TADScript.TotalJobDone Property
See Also

TotalJobSize, TotalPct10Done


See Also

See Also
TADScript.TotalJobSize Property
See Also

TotalJobDone, TotalPct10Done, ValidateAll


See Also

See Also
TADScript.TotalPct10Done Property
See Also

TotalJobDone, TotalJobSize


See Also

See Also
TADScript.Transaction Property
See Also

Managing Transactions, Connection


See Also

See Also
TADScript.ValidateAll Method
See Also

ExecuteAll, TotalJobDone


Example

Example
TADScript.ValidateStep Method
ADScript1.Position := Memo1.CaretPos;
ADScript1.ValidateStep;
Memo1.CaretPos := ADScript1.Position;


See Also

See Also
TADScript.ValidateStep Method
See Also

Position, EOF, ExecuteStep, ValidateAll


See Also

See Also
TADScriptCommand.AbortJob Method
See Also

Developing Custom Commands, Execute


See Also

See Also
TADScriptCommand.Engine Property
See Also

Developing Custom Commands, EngineIntf


See Also

See Also
TADScriptCommand.EngineIntf Property
See Also

Developing Custom Commands, Engine


See Also

See Also
TADScriptCommand.Execute Method
See Also

Developing Custom Commands, Parse


See Also

See Also
TADScriptCommand.Help Method
See Also

Developing Custom Commands


See Also

See Also
TADScriptCommand.Keywords Method
See Also

Developing Custom Commands, Parse


See Also

See Also
TADScriptCommand.Parse Method
See Also

Developing Custom Commands, Execute, Keywords


See Also

See Also
TADScriptCommand.Parser Property
See Also

Developing Custom Commands, Parse


See Also

See Also
TADScriptCommand.Position Property
See Also

Developing Custom Commands, Parse


Example

Example
TADScriptCommand Class

Please, check the uADCompScriptCommands unit for the command examples.


See Also

See Also
TADScriptCommand Class
See Also

Executing SQL Scripts, SQL Script Control Commands, Developing Custom Commands, AddCommand


See Also

See Also
TADScriptCommand.Validate Method
See Also

Developing Custom Commands, Execute, Parse


See Also

See Also
TADScriptCommandRegistry.AddCommand Method
See Also

Developing Custom Commands, Commands, Count


See Also

See Also
TADScriptCommandRegistry.Commands Property
See Also

Count


See Also

See Also
TADScriptCommandRegistry.Count Property
See Also

Commands


See Also

See Also
TADScriptCommandRegistry.LookupCommand Method
See Also

AddCommand


See Also

See Also
TADScriptCommandRegistry Class
See Also

Executing SQL Scripts, Developing Custom Commands, TADScriptCommand


See Also

See Also
TADScriptOptions.BreakOnError Property
See Also

IgnoreError


See Also

See Also
TADScriptOptions.CharacterSet Property
See Also

DriverID, ClientLib


Example 1

Example 1
TADScriptOptions.ClientLib Property
ADScript1.ScriptOptions.DriverID := 'IB';
ADScript1.ScriptOptions.ClientLib := 'c:\fbclient.dll';
with ADScript1.SQLScripts.Add do begin
  SQL.Add(...);
  SQL.Add('connect sysdba/masterkey');
end;


Example 2

Example 2
TADScriptOptions.ClientLib Property
with ADScript1.SQLScripts.Add do begin
  SQL.Add('SET DRIVERID IB');
  SQL.Add('SET CLIENTLIB ''c:\fbclient.dll''');
  SQL.Add('connect sysdba/masterkey');
end;


See Also

See Also
TADScriptOptions.ClientLib Property
See Also

DriverID, TADScript.Connection


See Also

See Also
TADScriptOptions.ColumnHeadings Property
See Also

PageSize, ConsoleOutput, SpoolOutput


See Also

See Also
TADScriptOptions.CommandSeparator Property
See Also

ActualCommandSeparator


See Also

See Also
TADScriptOptions.CommitEachNCommands Property
See Also

TADTxOptions.AutoCommit


See Also

See Also
TADScriptOptions.ConsoleOutput Property
See Also

TrimConsole, TADScript.OnConsolePut, TADScript.ScriptDialog


See Also

See Also
TADScriptOptions.DefaultScriptPath Property
See Also

TADScript.SQLScriptFileName


Example

Example
TADScriptOptions.DriverID Property
ADScript1.ScriptOptions.DriverID := 'Ora';
with ADScript1.SQLScripts.Add do begin
  SQL.Add(...);
  SQL.Add('connect scott/tiger@orasrv');
end;


See Also

See Also
TADScriptOptions.DriverID Property
See Also

TADScript.Connection


See Also

See Also
TADScriptOptions.DropNonexistObj Property
See Also

BreakOnError


See Also

See Also
TADScriptOptions.EchoCommands Property
See Also

ConsoleOutput, EchoCommandTrim, TrimConsole


See Also

See Also
TADScriptOptions.EchoCommandTrim Property
See Also

ConsoleOutput, EchoCommands, TrimConsole


See Also

See Also
TADScriptOptions.FeedbackCommands Property
See Also

ConsoleOutput, FeedbackScript, Timing


See Also

See Also
TADScriptOptions.FeedbackScript Property
See Also

ConsoleOutput, FeedbackCommands, Timing


See Also

See Also
TADScriptOptions.FileEncoding Property
See Also

FileEndOfLine


See Also

See Also
TADScriptOptions.FileEndOfLine Property
See Also

FileEncoding


See Also

See Also
TADScriptOptions.IgnoreError Property
See Also

BreakOnError


See Also

See Also
TADScriptOptions.MacroExpand Property
See Also

TADScript.Macros, TADScript.Arguments


See Also

See Also
TADScriptOptions.MaxStringWidth Property
See Also

LineSize


See Also

See Also
TADScriptOptions.PageSize Property
See Also

ColumnHeadings, ConsoleOutput, SpoolOutput


See Also

See Also
TADScriptOptions.ParamArraySize Property
See Also

TADScript.Params


See Also

See Also
TADScriptOptions.RaisePLSQLErrors Property
See Also

BreakOnError, IgnoreError


See Also

See Also
TADScriptOptions.SpoolFileName Property
See Also

SpoolOutput, TrimSpool, TADScript.OnSpoolPut


See Also

See Also
TADScriptOptions.SpoolOutput Property
See Also

SpoolFileName, TrimSpool, TADScript.OnSpoolPut


See Also

See Also
TADScriptOptions Class
See Also

Executing SQL Scripts, TADScript


See Also

See Also
TADScriptOptions.Timing Property
See Also

FeedbackCommands


See Also

See Also
TADScriptOptions.TrimConsole Property
See Also

ConsoleOutput, TrimSpool


See Also

See Also
TADScriptOptions.TrimSpool Property
See Also

SpoolOutput


See Also

See Also
TADSQLScript.Name Property
See Also

SQL, TADSQLScripts.FindScript


See Also

See Also
TADSQLScript.SQL Property
See Also

Name, TADScriptOptions.CommandSeparator


See Also

See Also
TADSQLScript Class
See Also

Executing SQL Scripts


See Also

See Also
TADSQLScripts.Items Property
See Also

FindScript


See Also

See Also
TADSQLScripts Class
See Also

Executing SQL Scripts, TADScript.SQLScripts


See Also

See Also
uADMoniRemoteClient Namespace
See Also

Tracing and Monitoring


uADMoniRemoteClient Namespace Classes

uADMoniRemoteClient Namespace Classes
uADMoniRemoteClient Namespace Legend
Classes
Class | Description
TADMoniRemoteClientLink | Use the TADMoniRemoteClientLink component to link ADMonitor tracing capabilities to an application and setup it.


Legend

Legend
uADMoniRemoteClient Namespace
Legend
Class


Topics

Topics
uADMoniRemoteClient Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADMoniRemoteClientLink.Host Property
See Also

Port


See Also

See Also
TADMoniRemoteClientLink.Port Property
See Also

Host


See Also

See Also
TADMoniRemoteClientLink Class
See Also

Tracing and Monitoring


Example

Example
TADMoniRemoteClientLink.Tracing Property


See Also

See Also
TADMoniRemoteClientLink.Tracing Property
See Also

List here...


See Also

See Also
uADPhysADS Namespace
See Also

Configuring Drivers, Connect to Advantage Database Server


uADPhysADS Namespace Classes

uADPhysADS Namespace Classes
uADPhysADS Namespace Legend
Classes
Class | Description
TADADSBackup | The class implementing Advantage backup database service.
TADADSBackupRestore | The base class for backup and restored Advantage service classes.
TADADSRestore | The class implementing Advantage service restoring a database from a backup.
TADADSService | The base class for all Advantage service classes.
TADADSUtility | The class implementing Advantage table utilities.
TADPhysADSDriverLink | Use the TADPhysADSDriverLink component to link the Advantage Database Server driver to an application and setup it.


Legend

Legend
uADPhysADS Namespace
Legend
Class


Topics

Topics
uADPhysADS Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADADSBackup.Backup Method
See Also

TADADSService.Database, TADADSService.UserName, TADADSService.Password, BackupPath, Options


See Also

See Also
TADADSBackup.BackupPath Property
See Also

TADADSService.Database


Example

Example
TADADSBackup Class
ADADSBackup1.DriverLink := ADPhysADSDriverLink1;

ADADSBackup1.Database := '\\DA\ADS_DB\addemo.add';
ADADSBackup1.UserName := 'adssys';
ADADSBackup1.Password := 'a';
ADADSBackup1.BackupPath := 'C:\Temp';

ADADSBackup1.Backup;

ADMemTable1.AttachTable(ADADSBackup1.Results, nil);
ADMemTable1.Open;


See Also

See Also
TADADSBackup Class
See Also

TADADSRestore


See Also

See Also
TADADSBackupRestore.Exclude Property
See Also

Include, TableTypeMap


See Also

See Also
TADADSBackupRestore.Include Property
See Also

Exclude, TableTypeMap


Example

Example
TADADSBackupRestore.Results Property
ADADSBackup.Backup;
ADMemTable1.AttachTable(ADADSBackup.Results, nil);
ADMemTable1.Open;


See Also

See Also
TADADSBackupRestore.Results Property
See Also

Backup, Restore


Example

Example
TADADSBackupRestore.TableTypeMap Property
with ADADSBackup1.TableTypeMap do begin
  Clear;
  Add('adt=ADS_ADT');
  Add('dbf=ADS_CDX');
end;


See Also

See Also
TADADSBackupRestore.TableTypeMap Property
See Also

Exclude, Include


See Also

See Also
TADADSRestore.DestinationPath Property
See Also

SourcePath


See Also

See Also
TADADSRestore.Restore Method
See Also

TADADSService.Database, TADADSService.UserName, TADADSService.Password, SourcePath, DestinationPath, Options


See Also

See Also
TADADSRestore.SourcePassword Property
See Also

SourcePath


See Also

See Also
TADADSRestore.SourcePath Property
See Also

SourcePassword, DestinationPath


Example

Example
TADADSRestore Class
ADADSRestore1.DriverLink := ADPhysADSDriverLink1;

ADADSRestore1.Database := '\\DA\ADS_DB\addemo.add';
ADADSRestore1.UserName := 'adssys';
ADADSRestore1.Password := 'a';
ADADSRestore1.SourcePath := 'C:\Temp';
ADADSRestore1.DestinationPath := '\\DA\ADS_DB\addemo.add';

ADADSRestore1.Restore;

ADMemTable1.AttachTable(ADADSRestore1.Results, nil);
ADMemTable1.Open;


See Also

See Also
TADADSRestore Class
See Also

TADADSBackup


Example

Example
TADADSService.Database Property
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';


See Also

See Also
TADADSService.Database Property
See Also

Connect to Advantage Database Server


See Also

See Also
TADADSService.Password Property
See Also

UserName


See Also

See Also
TADADSService.UserName Property
See Also

Password


Example

Example
TADADSUtility.Decrypt Method
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';
ADADSUtility1.Tables.Add('EVENT.DBF');
ADADSUtility1.TableType := ttVFP;
ADADSUtility1.TablePassword := '12345';
ADADSUtility1.Decrypt;


See Also

See Also
TADADSUtility.Decrypt Method
See Also

Tables, TableType, TablePassword, Encrypt


Example

Example
TADADSUtility.Encrypt Method
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';
ADADSUtility1.Tables.Add('ORDERS.DBF');
ADADSUtility1.TableType := ttVFP;
ADADSUtility1.TablePassword := '12345';
ADADSUtility1.Encrypt;


See Also

See Also
TADADSUtility.Encrypt Method
See Also

Tables, TableType, TablePassword, Decrypt


See Also

See Also
TADADSUtility.OnProgress Event
See Also

Tables


Example

Example
TADADSUtility.Pack Method
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';
ADADSUtility1.Tables.Add('ORDERS.DBF');
ADADSUtility1.TableType := ttVFP;
ADADSUtility1.Pack;


See Also

See Also
TADADSUtility.Pack Method
See Also

Tables, TableType, TablePassword, Recall, Reindex


Example

Example
TADADSUtility.Recall Method
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := '\\DA\ADS_DB';
ADADSUtility1.Tables.Add('ORDERS');
ADADSUtility1.Tables.Add('ORDER DETAILS');
ADADSUtility1.Recall;


See Also

See Also
TADADSUtility.Recall Method
See Also

Tables, TableType, TablePassword, Pack, Reindex


Example

Example
TADADSUtility.Reindex Method
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := '\\DA\ADS_DB';
ADADSUtility1.Tables.Add('ORDERS');
ADADSUtility1.Tables.Add('ORDER DETAILS');
ADADSUtility1.Reindex;


See Also

See Also
TADADSUtility.Reindex Method
See Also

Tables, TableType, TablePassword, Pack


Example

Example
TADADSUtility Class
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := 'C:\DB;ServerTypes=Local';
ADADSUtility1.Tables.Add('EVENT.DBF');
ADADSUtility1.TableType := ttVFP;
ADADSUtility1.Pack;


See Also

See Also
TADADSUtility.TablePassword Property
See Also

Tables


See Also

See Also
TADADSUtility.Tables Property
See Also

TableType


See Also

See Also
TADADSUtility.TableType Property
See Also

Tables


Example

Example
TADADSUtility.Zap Method
ADADSUtility1.DriverLink := ADPhysADSDriverLink1;
ADADSUtility1.Database := '\\DA\ADS_DB';
ADADSUtility1.Tables.Add('ORDERS');
ADADSUtility1.Tables.Add('ORDER DETAILS');
ADADSUtility1.Reindex;


See Also

See Also
TADADSUtility.Zap Method
See Also

Tables, TableType, TablePassword, Pack


See Also

See Also
TADPhysADSDriverLink.DateFormat Property
See Also

Epoch, Decimals


See Also

See Also
TADPhysADSDriverLink.Decimals Property
See Also

DateFormat, Epoch


See Also

See Also
TADPhysADSDriverLink.DefaultPath Property
See Also

SearchPath


See Also

See Also
TADPhysADSDriverLink.Epoch Property
See Also

DateFormat, Decimals


See Also

See Also
TADPhysADSDriverLink.SearchPath Property
See Also

DefaultPath


Example

Example
TADPhysADSDriverLink Class
ADPhysADSDriverLink1.VendorLib := 'c:\ads\ace32.dll';
ADPhysADSDriverLink1.DefaultPath := 'c:\temp';


See Also

See Also
TADPhysADSDriverLink Class
See Also

Configuring Drivers, Connect to Advantage Database Server


See Also

See Also
uADPhysASA Namespace
See Also

Configuring Drivers, Connect to Sybase SQL Anywhere


uADPhysASA Namespace Classes

uADPhysASA Namespace Classes
uADPhysASA Namespace Legend
Classes
Class | Description
TADASABackup | The class implementing SQL Anywhere backup database service.
TADASAService | The base class for all Sybase SQL Anywhere service classes.
TADASAValidate | The class implementing SQL Anywhere database validate service.
TADPhysASADriverLink | Use the TADPhysASADriverLink component to link the Sybase SQL Anywhere driver to an application and setup it.


Legend

Legend
uADPhysASA Namespace
Legend
Class


Topics

Topics
uADPhysASA Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADASABackup.Backup Method
See Also

ConnectParams, StartLine, OutputDir


See Also

See Also
TADASABackup.ConnectParams Property
See Also

StartLine


See Also

See Also
TADASABackup.Flags Property
See Also

HotlogFilename


See Also

See Also
TADASABackup.HotlogFilename Property
See Also

Flags


See Also

See Also
TADASABackup.PageBlocksize Property
See Also

Flags


Example

Example
TADASABackup Class
ADASABackup1.DriverLink := ADPhysASADriverLink1;
ADASABackup1.ConnectParams := 'ENG=addemo_asa11;DBN=addemo_asa11;UID=DBA;PWD=sql';
ADASABackup1.OutputDir := 'c:\temp\db';
ADASABackup1.Flags := [bfBackupDB, bfBackupLog];
ADASABackup1.OnProgress := ADASABackup1Progress;
ADASABackup1.Backup;


See Also

See Also
TADASABackup Class
See Also

TADASAService.OnProgress


See Also

See Also
TADASABackup.StartLine Property
See Also

ConnectParams


Example

Example
TADASAService.OnProgress Property
procedure TForm1.ADASABackup1Progress(ASender: TObject; AMessage: string;
  AKind: TASAToolMessageKind; var AResult: Integer);
begin
  if Memo1 <> nil then
    Memo1.Lines.Add(AMessage);
  if AKind = tmConfirm then
    if MessageDlg(AMessage, mtConfirmation, mbYesNo, -1) = mrYes then
      AResult := 1
    else
      AResult := 0;
end;


See Also

See Also
TADASAValidate.ConnectParams Property
See Also

StartLine


See Also

See Also
TADASAValidate.Flags Property
See Also

ValidateType, Tables


Example

Example
TADASAValidate Class
ADASAValidate1.DriverLink := ADPhysASADriverLink1;
ADASAValidate1.ConnectParams := 'ENG=addemo_asa11;DBN=addemo_asa11;UID=DBA;PWD=sql';
ADASAValidate1.ValidateType := vtNormal;
ADASAValidate1.Flags := [];
ADASAValidate1.OnProgress := ADASABackup1Progress;
ADASAValidate1.Validate;


See Also

See Also
TADASAValidate Class
See Also

TADASAService.OnProgress


See Also

See Also
TADASAValidate.StartLine Property
See Also

ConnectParams


See Also

See Also
TADASAValidate.Tables Property
See Also

Flags


See Also

See Also
TADASAValidate.Validate Method
See Also

ConnectParams, StartLine


See Also

See Also
TADASAValidate.ValidateType Property
See Also

Flags, Tables


Example

Example
TADPhysASADriverLink Class
ADPhysASADriverLink1.ODBCAdvanced := 'AutoStart=Yes;CharSet=Windows-1251';
ADPhysASADriverLink1.ODBCDriver := 'Sybase SQL Anywhere 5.0';


See Also

See Also
TADPhysASADriverLink Class
See Also

Configuring Drivers, Connect to Sybase SQL Anywhere


See Also

See Also
uADPhysDataSnap Namespace
See Also

Configuring Drivers, Connect to DataSnap server


uADPhysDataSnap Namespace Classes

uADPhysDataSnap Namespace Classes
uADPhysDataSnap Namespace Legend
Classes
Class | Description
TADPhysDataSnapDriverLink | Use the TADPhysDataSnapDriverLink component to link the Multi-Tier DataSnap driver to an application.


Legend

Legend
uADPhysDataSnap Namespace
Legend
Class


Topics

Topics
uADPhysDataSnap Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADPhysDataSnapDriverLink Class
See Also

Configuring Drivers, Connect to DataSnap server


Example

Example
EDB2NativeException Class
try
  ADConnection1.Connected := True;
except
  on E: EDB2NativeException do
    // perform DB2 error specific actions
end;


See Also

See Also
EDB2NativeException Class
See Also

EODBCNativeException, TADPhysDB2DriverLink, Connect to IBM DB2 Server


See Also

See Also
uADPhysDB2 Namespace
See Also

Configuring Drivers, Connect to IBM DB2 Server


uADPhysDB2 Namespace Classes

uADPhysDB2 Namespace Classes
uADPhysDB2 Namespace Legend
Classes
Class | Description
EDB2NativeException | Class representing a IBM DB2 driver exception.
TADPhysDB2DriverLink | Use the TADPhysDB2DriverLink component to link the IBM DB2 driver to an application and setup it.


Legend

Legend
uADPhysDB2 Namespace
Legend
Class


Topics

Topics
uADPhysDB2 Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


Example

Example
TADPhysDB2DriverLink Class
ADPhysDB2DriverLink1.ODBCAdvanced := 'IGNOREWARNINGS=1';
ADPhysDB2DriverLink1.ODBCDriver := 'IBM DB2 ODBC DRIVER - DB2COPY1';


See Also

See Also
TADPhysDB2DriverLink Class
See Also

Configuring Drivers, Connect to IBM DB2 Server


See Also

See Also
uADPhysDBExp Namespace
See Also

Configuring Drivers, Connect to dbExpress data source


uADPhysDBExp Namespace Classes

uADPhysDBExp Namespace Classes
uADPhysDBExp Namespace Legend
Classes
Class | Description
TADPhysDBXDriverLink | Use the TADPhysDBXDriverLink component to link the dbExpress v 1-3 bridge driver to an application.


Legend

Legend
uADPhysDBExp Namespace
Legend
Class


Topics

Topics
uADPhysDBExp Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADPhysDBXDriverLink Class
See Also

Configuring Drivers, Connect to dbExpress data source


See Also

See Also
uADPhysIB Namespace
See Also

Configuring Drivers, Connect to Interbase or Firebird


uADPhysIB Namespace Classes

uADPhysIB Namespace Classes
uADPhysIB Namespace Legend
Classes
Class | Description
TADIBBackup | The class implementing FB/IB backup database service.
TADIBNBackup | The class implementing Firebird-only backup database service.
TADIBNRestore | The class implementing Firebird-only restored database service.
TADIBRestore | The class implementing FB/IB service restoring a database from a backup.
TADIBSecurity | The class implementing FB/IB database security management service.
TADIBService | The base class for all FB/IB service classes.
TADIBTrace | The class implementing Firebird database trace service.
TADIBValidate | The class implementing FB/IB database validate and repair service.
TADPhysIBDriverLink | Use the TADPhysIBDriverLink component to link the FB/IB driver to an application and setup it.


Legend

Legend
uADPhysIB Namespace
Legend
Class


Topics

Topics
uADPhysIB Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADIBBackup.Backup Method
See Also

TADIBService.Host, TADIBService.UserName, TADIBService.Password, Database, BackupFiles


Example 1

Example 1
TADIBBackup.BackupFiles Property

Specifying multiple files with length:

with ADIBBackup1.BackupFiles do begin
  Clear;
  Add('/tmp/addemo.backup1=10000000');
  Add('/tmp/addemo.backup2=10000000');
  Add('/tmp/addemo.backup3');
end;


Example 2

Example 2
TADIBBackup.BackupFiles Property

Specifying single file:

ADIBBackup1.BackupFiles.Text := 'e:\temp\addemo.backup';


See Also

See Also
TADIBBackup.BackupFiles Property
See Also

Database, TADIBRestore


See Also

See Also
TADIBBackup.Database Property
See Also

BackupFiles


Example

Example
TADIBBackup Class
ADIBBackup1.DriverLink := ADPhysIBDriverLink1;

ADIBBackup1.UserName := 'sysdba';
ADIBBackup1.Password := 'masterkey';
ADIBBackup1.Host := 'db_srv_host';
ADIBBackup1.Protocol := ipTCPIP;

ADIBBackup1.Database := 'e:\ib\addemo.fdb';
ADIBBackup1.BackupFiles.Add('e:\ib\addemo.backup');

ADIBBackup1.Backup;


See Also

See Also
TADIBBackup Class
See Also

TADIBNBackup, TADIBRestore


See Also

See Also
TADIBBackup.Verbose Property
See Also

TADIBService.OnProgress


See Also

See Also
TADIBNBackup.Backup Method
See Also

TADIBService.Host, TADIBService.UserName, TADIBService.Password, Database, BackupFile


Example

Example
TADIBNBackup.BackupFile Property
ADIBNBackup1.BackupFile := 'e:\temp\addemo.backup';


See Also

See Also
TADIBNBackup.BackupFile Property
See Also

Database, TADIBNRestore


See Also

See Also
TADIBNBackup.Database Property
See Also

BackupFile


See Also

See Also
TADIBNBackup.Level Property
See Also

BackupFile, Database


Example

Example
TADIBNBackup Class
ADIBNBackup1.DriverLink := ADPhysIBDriverLink1;

ADIBNBackup1.UserName := 'sysdba';
ADIBNBackup1.Password := 'masterkey';
ADIBNBackup1.Host := 'db_srv_host';
ADIBNBackup1.Protocol := ipTCPIP;

ADIBNBackup1.Database := 'e:\ib\addemo.fdb';
ADIBNBackup1.BackupFile := 'e:\ib\addemo.backup';
ADIBNBackup1.Level := 0; // full backup

ADIBNBackup1.Backup;


See Also

See Also
TADIBNBackup Class
See Also

TADIBBackup, TADIBNRestore


Example

Example
TADIBNRestore.BackupFiles Property


See Also

See Also
TADIBNRestore.BackupFiles Property
See Also

List here...


See Also

See Also
TADIBNRestore.Database Property
See Also

BackupFiles


See Also

See Also
TADIBNRestore.Restore Method
See Also

TADIBService.Host, TADIBService.UserName, TADIBService.Password, Database, BackupFiles


Example

Example
TADIBNRestore Class
ADIBNRestore1.DriverLink := ADPhysIBDriverLink1;

ADIBNRestore1.UserName := 'sysdba';
ADIBNRestore1.Password := 'masterkey';
ADIBNRestore1.Host := 'db_srv_host';
ADIBNRestore1.Protocol := ipTCPIP;

ADIBNRestore1.Database := 'e:\ib\addemo.fdb';
ADIBNRestore1.BackupFile := 'e:\ib\addemo.backup';

ADIBNRestore1.Restore;


See Also

See Also
TADIBNRestore Class
See Also

TADIBNBackup, TADIBBackup


See Also

See Also
TADIBRestore.BackupFiles Property
See Also

Database


See Also

See Also
TADIBRestore.Database Property
See Also

BackupFiles


See Also

See Also
TADIBRestore.Options Property
See Also

PageSize


See Also

See Also
TADIBRestore.PageSize Property
See Also

Options


See Also

See Also
TADIBRestore.Restore Method
See Also

TADIBService.Host, TADIBService.UserName, TADIBService.Password, Database, BackupFiles


Example

Example
TADIBRestore Class
ADIBRestore1.DriverLink := ADPhysIBDriverLink1;

ADIBRestore1.UserName := 'sysdba';
ADIBRestore1.Password := 'masterkey';
ADIBRestore1.Host := 'db_srv_host';
ADIBRestore1.Protocol := ipTCPIP;

ADIBRestore1.Database := 'e:\ib\addemo.fdb';
ADIBRestore1.BackupFiles.Add('e:\ib\addemo.backup');

ADIBRestore1.Restore;


See Also

See Also
TADIBRestore Class
See Also

TADIBNRestore, TADIBBackup


See Also

See Also
TADIBRestore.Verbose Property
See Also

TADIBService.OnProgress


See Also

See Also
TADIBSecurity.AddUser Method
See Also

ModifyUser, DeleteUser


See Also

See Also
TADIBSecurity.DeleteUser Method
See Also

AddUser, ModifyUser


See Also

See Also
TADIBSecurity.DisplayUser Method
See Also

DisplayUsers


See Also

See Also
TADIBSecurity.DisplayUsers Method
See Also

DisplayUser


Example

Example
TADIBSecurity.ModifyUser Method


See Also

See Also
TADIBSecurity.ModifyUser Method
See Also

List here...


Example 1

Example 1
TADIBSecurity Class

Adding a user:

ADIBSecurity1.DriverLink := ADPhysIBDriverLink1;

ADIBSecurity1.UserName := 'sysdba';
ADIBSecurity1.Password := 'masterkey';
ADIBSecurity1.Host := 'db_srv_host';
ADIBSecurity1.Protocol := ipTCPIP;

ADIBSecurity1.AUserName := 'user1';
ADIBSecurity1.APassword := '12345';
ADIBSecurity1.AFirstName := 'Bill';
ADIBSecurity1.ALastName := 'Scott';

ADIBSecurity1.AddUser;


Example 2

Example 2
TADIBSecurity Class

Change a user password:

ADIBSecurity1.DriverLink := ADPhysIBDriverLink1;

ADIBSecurity1.UserName := 'sysdba';
ADIBSecurity1.Password := 'masterkey';
ADIBSecurity1.Host := 'db_srv_host';
ADIBSecurity1.Protocol := ipTCPIP;

ADIBSecurity1.AUserName := 'user1';
ADIBSecurity1.APassword := '12345';

ADIBSecurity1.ModifyUser;


Example 3

Example 3
TADIBSecurity Class

List all users using TADMemTable:

ADIBSecurity1.DriverLink := ADPhysIBDriverLink1;

ADIBSecurity1.UserName := 'sysdba';
ADIBSecurity1.Password := 'masterkey';
ADIBSecurity1.Host := 'db_srv_host';
ADIBSecurity1.Protocol := ipTCPIP;

ADIBSecurity1.DisplayUsers;
ADMemTable1.AttachTable(ADIBSecurity1.Users, nil);
ADMemTable1.Open;


Example

Example
TADIBSecurity.Users Property
ADIBSecurity.DisplayUsers;
ADMemTable1.AttachTable(ADIBSecurity.Users, nil);
ADMemTable1.Open;


See Also

See Also
TADIBSecurity.Users Property
See Also

DisplayUsers


See Also

See Also
TADIBService.Host Property
See Also

Protocol


Example

Example
TADIBService.OnProgress Event
ADIBBackup1.DriverLink := ADPhysIBDriverLink1;
// set host, database, etc properties
ADIBBackup1.Verbose := True;
ADIBBackup1.OnProgress := Form1Progress;

procedure TForm1.Form1Progress(ASender: TADPhysDriverService; const AMessage: String);
begin
  Memo1.Lines.Add(AMessage);
  Application.ProcessMessages;
end;


See Also

See Also
TADIBService.Password Property
See Also

UserName, SqlRoleName


See Also

See Also
TADIBService.Protocol Property
See Also

Host


Example

Example
TADIBService.QueryTimeout Property


See Also

See Also
TADIBService.QueryTimeout Property
See Also

List here...


See Also

See Also
TADIBService.SqlRoleName Property
See Also

UserName, Password


See Also

See Also
TADIBService.UserName Property
See Also

Password, SqlRoleName


See Also

See Also
TADIBTrace.List Method
See Also

OnProgress


See Also

See Also
TADIBTrace.Resume Method
See Also

Suspend, SessionID


See Also

See Also
TADIBTrace.SessionID Property
See Also

SessionName, Resume, Stop, Suspend


See Also

See Also
TADIBTrace.SessionName Property
See Also

Start, SessionID


Example

Example
TADIBTrace Class

Start trace:

ADIBTrace1.DriverLink := ADPhysIBDriverLink1;

ADIBTrace1.UserName := 'sysdba';
ADIBTrace1.Password := 'masterkey';
ADIBTrace1.Host := 'db_srv_host';
ADIBTrace1.Protocol := ipTCPIP;

ADIBTrace1.SessionName := 'trace1';

ADIBTrace1.Start;


See Also

See Also
TADIBTrace.Start Method
See Also

OnProgress, SessionName, SessionID, Stop, Suspend


See Also

See Also
TADIBTrace.Stop Method
See Also

Start, SessionID


See Also

See Also
TADIBTrace.Suspend Method
See Also

SessionID, Resume


See Also

See Also
TADIBValidate.Analyze Method
See Also

CheckOnly, Sweep


See Also

See Also
TADIBValidate.CheckOnly Method
See Also

Repair, Sweep


See Also

See Also
TADIBValidate.Options Property
See Also

CheckOnly, Repair


See Also

See Also
TADIBValidate.Repair Method
See Also

CheckOnly, Sweep


Example

Example
TADIBValidate Class
ADIBValidate1.DriverLink := ADPhysIBDriverLink1;

ADIBValidate1.UserName := 'sysdba';
ADIBValidate1.Password := 'masterkey';
ADIBValidate1.Host := 'db_srv_host';
ADIBValidate1.Protocol := ipTCPIP;

ADIBValidate1.Database := 'e:\ib\addemo.fdb';

ADIBValidate1.Repair;


See Also

See Also
TADIBValidate.Sweep Method
See Also

CheckOnly, Repair


Example

Example
TADPhysIBDriverLink Class
ADPhysIBDriverLink1.VendorLib := 'c:\fb\fb25\bin\fbclient.dll';


See Also

See Also
TADPhysIBDriverLink Class
See Also

Configuring Drivers, Connect to Interbase or Firebird


uADPhysManager Namespace Classes

uADPhysManager Namespace Classes
uADPhysManager Namespace Legend
Classes
Class | Description
TADPhysDriverLink | The TADPhysDriverLink component is a base class for all driver link components.
TADPhysDriverService | The TADPhysDriverService component is a base class for all driver service components.


Legend

Legend
uADPhysManager Namespace
Legend
Class


Topics

Topics
uADPhysManager Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADPhysDriverLink.ActualDriverID Property
See Also

BaseDriverID, DriverID


See Also

See Also
TADPhysDriverLink.BaseDriverID Property
See Also

Configuring Drivers, DriverID


Example

Example
TADPhysDriverLink.DriverID Property
ADPhysIBDriverLink1.DriverID := 'FB25';
ADPhysIBDriverLink1.VendorLib := 'c:\fb25_64\fbclient.dll';

ADConnection1.Params.Clear;
ADConnection1.Params.Add('DriverID=FB25');
ADConnection1.Params.Add('Database=c:\addemo.fdb');
ADConnection1.Params.Add('Server=127.0.0.1');
ADConnection1.Params.Add('Protocol=TCPIP');
ADConnection1.Connected := True;


See Also

See Also
TADPhysDriverLink.DriverID Property
See Also

Configuring Drivers, BaseDriverID


See Also

See Also
TADPhysDriverLink.DriverIntf Property
See Also

DriverState


See Also

See Also
TADPhysDriverLink.DriverState Property
See Also

DriverIntf


See Also

See Also
TADPhysDriverLink.OnDriverCreated Event
See Also

OnDriverDestroying


See Also

See Also
TADPhysDriverLink.OnDriverDestroying Event
See Also

OnDriverCreated


Example

Example
TADPhysDriverLink.Release Method
ADConnection1.Close;
...
ADConnectionN.Close;

ADPhysIBDriverLink.VendorLib := 'c:\fbclient.dll';
ADPhysIBDriverLink.Release;

ADConnection1.Open;
...
ADConnectionN.Open;


See Also

See Also
TADPhysDriverLink.Release Method
See Also

VendorHome, VendorLib


See Also

See Also
TADPhysDriverLink.Services Property
See Also

TADPhysDriverService


See Also

See Also
TADPhysDriverLink.ServicesCount Property
See Also

Services


See Also

See Also
TADPhysDriverLink Class
See Also

Configuring Drivers, Database Connectivity


Example

Example
TADPhysDriverLink.VendorHome Property
ADConnection1.Close;
ADPhysOracleDriverLink1.Release;
ADPhysOracleDriverLink1.VendorHome := 'OracleXE';
ADConnection1.Open;


See Also

See Also
TADPhysDriverLink.VendorHome Property
See Also

Configuring Drivers, VendorLib, Release


Example

Example
TADPhysDriverLink.VendorLib Property
ADConnection1.Close;
ADPhysIBDriverLink1.Release;
ADPhysIBDriverLink1.VendorLib := 'c:\fb25_64\fbclient.dll';
ADConnection1.Open;


See Also

See Also
TADPhysDriverLink.VendorLib Property
See Also

Configuring Drivers, VendorHome, Release


See Also

See Also
TADPhysDriverService.AfterExecute Event
See Also

BeforeExecute


See Also

See Also
TADPhysDriverService.BeforeExecute Event
See Also

AfterExecute


See Also

See Also
TADPhysDriverService.CliObj Property
See Also

DriverLink


Example

Example
EMSAccessNativeException Class
try
  ADConnection1.Connected := True;
except
  on E: EMSAccessNativeException do
    // perform Access error specific actions
end;


See Also

See Also
EMSAccessNativeException Class
See Also

EODBCNativeException, TADMSAccessService, Connect to Microsoft Access database


See Also

See Also
uADPhysMSAcc Namespace
See Also

Configuring Drivers, Connect to Microsoft Access database


uADPhysMSAcc Namespace Classes

uADPhysMSAcc Namespace Classes
uADPhysMSAcc Namespace Legend
Classes
Class | Description
EMSAccessNativeException | Class representing a Microsoft Access driver exception.
TADMSAccessService | The class implementing Microsoft Access database create, drop, compact and repair services.
TADPhysMSAccessDriverLink | Use the TADPhysMSAccessDriverLink component to link the Microsoft Access driver to an application and setup it.


Legend

Legend
uADPhysMSAcc Namespace
Legend
Class


Topics

Topics
uADPhysMSAcc Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


Example 1

Example 1
TADMSAccessService.Compact Method
// Compact non-secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.DestDatabase := 'c:\test2.mdb';
ADMSAccessService1.Compact;


Example 2

Example 2
TADMSAccessService.Compact Method
// Compact secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.Compact;


Example 3

Example 3
TADMSAccessService.Compact Method
// Reset password of secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.ResetPassword := True;
ADMSAccessService1.Compact;


See Also

See Also
TADMSAccessService.Compact Method
See Also

Database, DestDatabase, Encrypted, Password, SortOrder


Example 1

Example 1
TADMSAccessService.CreateDB Method
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.DBVersion := avDefault;
ADMSAccessService1.CreateDB;


Example 2

Example 2
TADMSAccessService.CreateDB Method
// Create encrypted database
ADMSAccessService1.Database := 'c:\test.accdb';
ADMSAccessService1.DBVersion := avAccess2007;
ADMSAccessService1.Encrypted := True;
ADMSAccessService1.CreateDB;


Example 3

Example 3
TADMSAccessService.CreateDB Method
// Specify default sort order of database
ADMSAccessService1.Database := 'c:\test.accdb';
ADMSAccessService1.DBVersion := avAccess2007;
ADMSAccessService1.SortOrder := '0x00000409';
ADMSAccessService1.CreateDB;


See Also

See Also
TADMSAccessService.CreateDB Method
See Also

Database, DBVersion, SortOrder


See Also

See Also
TADMSAccessService.Database Property
See Also

CreateDB, Drop, Compact, Repair


See Also

See Also
TADMSAccessService.DBVersion Property
See Also

CreateDB, Compact, Repair


See Also

See Also
TADMSAccessService.DestDatabase Property
See Also

Compact, Repair


See Also

See Also
TADMSAccessService.Drop Method
See Also

Database


See Also

See Also
TADMSAccessService.Encrypted Property
See Also

CreateDB, Compact, Repair


Example 1

Example 1
TADMSAccessService.Password Property
// Create database and set password
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.CreateDB;


Example 2

Example 2
TADMSAccessService.Password Property
// Set password for non-secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.Compact;


See Also

See Also
TADMSAccessService.Password Property
See Also

CreateDB, Compact, Repair, ResetPassword


See Also

See Also
TADMSAccessService.Repair Method
See Also

Database, Compact


Example

Example
TADMSAccessService.ResetPassword Property
// Reset password for secured database
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Password := 'J@^^1234pw';
ADMSAccessService1.ResetPassword := True;
ADMSAccessService1.Compact;


See Also

See Also
TADMSAccessService.ResetPassword Property
See Also

Password, Compact, Repair


Example

Example
TADMSAccessService.SortOrder Property
// Set SortOrder to German Phone Book
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.SortOrder := '0x00010407';
ADMSAccessService1.CreateDB;


See Also

See Also
TADMSAccessService.SortOrder Property
See Also

CreateDB, Compact, Repair


Example

Example
TADMSAccessService Class
ADMSAccessService1.Database := 'c:\test.mdb';
ADMSAccessService1.Repair;


Example

Example
TADPhysMSAccessDriverLink Class
ADPhysMSAccessDriverLink1.ODBCAdvanced := 'IMPLICITCOMMITSYNC=NO';
ADPhysMSAccessDriverLink1.ODBCDriver := 'Microsoft Access Driver (*.mdb)';


See Also

See Also
TADPhysMSAccessDriverLink Class
See Also

Configuring Drivers, Connect to Microsoft Access database


See Also

See Also
EMSSQLNativeException.Errors Property
See Also

TADMSSQLError, TADDBError


Example

Example
EMSSQLNativeException Class
try
  ADConnection1.Connected := True;
except
  on E: EMSSQLNativeException do
    // perform SQL Server error specific actions
end;


See Also

See Also
EMSSQLNativeException Class
See Also

EODBCNativeException, TADPhysMSSQLDriverLink, Connect to Microsoft SQL Server


See Also

See Also
uADPhysMSSQL Namespace
See Also

Configuring Drivers, Connect to Microsoft SQL Server


uADPhysMSSQL Namespace Classes

uADPhysMSSQL Namespace Classes
uADPhysMSSQL Namespace Legend
Classes
Class | Description
EMSSQLNativeException | Class representing a Microsoft SQL Server driver exception.
TADMSSQLError | TADMSSQLError represents FireDAC SQL Server errors, warnings and messages for the EMSSQLNAtiveException exception class.
TADPhysMSSQLDriverLink | Use the TADPhysMSSQLDriverLink component to link the Microsoft SQL Server driver to an application and setup it.


Legend

Legend
uADPhysMSSQL Namespace
Legend
Class


Topics

Topics
uADPhysMSSQL Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADMSSQLError Class
See Also

TADDBError


Example

Example
TADPhysMSSQLDriverLink Class
ADPhysMSSQLDriverLink1.ODBCAdvanced := 'MARS_Connection=no;Regional=yes';
ADPhysMSSQLDriverLink1.ODBCDriver := 'SQL Native Client';


See Also

See Also
TADPhysMSSQLDriverLink Class
See Also

Configuring Drivers, Connect to Microsoft SQL Server


See Also

See Also
uADPhysMySQL Namespace
See Also

Configuring Drivers, Connect to MySQL Server


uADPhysMySQL Namespace Classes

uADPhysMySQL Namespace Classes
uADPhysMySQL Namespace Legend
Classes
Class | Description
TADPhysMySQLDriverLink | Use the TADPhysMySQLDriverLink component to link the MySQL Server driver to an application and setup it.


Legend

Legend
uADPhysMySQL Namespace
Legend
Class


Topics

Topics
uADPhysMySQL Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADPhysMySQLDriverLink.EmbeddedArgs Property
See Also

EmbeddedGroups


See Also

See Also
TADPhysMySQLDriverLink.EmbeddedGroups Property
See Also

EmbeddedArgs


Example

Example
TADPhysMySQLDriverLink Class
ADPhysMySQLDriverLink1.VendorLib := 'E:\mysql\5-0-27\bin\libmySQL.dll';


See Also

See Also
TADPhysMySQLDriverLink Class
See Also

Configuring Drivers, Connect to MySQL Server


See Also

See Also
uADPhysODBC Namespace
See Also

Configuring Drivers, Connect to ODBC data source


uADPhysODBC Namespace Classes

uADPhysODBC Namespace Classes
uADPhysODBC Namespace Legend
Classes
Class | Description
TADPhysODBCDriverLink | Use the TADPhysODBCDriverLink component to link the ODBC bridge driver to an application.


Legend

Legend
uADPhysODBC Namespace
Legend
Class


Topics

Topics
uADPhysODBC Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


Example

Example
TADPhysODBCDriverLink Class
ADPhysODBCDriverLink1.DriverID := 'Informix';
ADPhysODBCDriverLink1.ODBCAdvanced := 'CLOC=en_US.CP1252;DLOC=en_US.819';
ADPhysODBCDriverLink1.ODBCDriver := 'IBM INFORMIX ODBC DRIVER';


See Also

See Also
TADPhysODBCDriverLink Class
See Also

Configuring Drivers, Connect to ODBC data source


See Also

See Also
uADPhysODBCBase Namespace
See Also

uADPhysODBC Namespace


uADPhysODBCBase Namespace Classes

uADPhysODBCBase Namespace Classes
uADPhysODBCBase Namespace Legend
Classes
Class | Description
TADPhysODBCBaseDriverLink | The TADPhysODBCBaseDriverLink component is a base class for all ODBC based driver link components.
TADPhysODBCBaseService | The TADPhysODBCBaseService component is a base class for all ODBC based driver service components.


Legend

Legend
uADPhysODBCBase Namespace
Legend
Class


Topics

Topics
uADPhysODBCBase Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


Example

Example
TADPhysODBCBaseDriverLink.GetDrivers Method
ADPhysODBCDriverLink1.GetDrivers(Memo1.Lines);


See Also

See Also
TADPhysODBCBaseDriverLink.GetDrivers Method
See Also

GetDSNs


Example

Example
TADPhysODBCBaseDriverLink.GetDSNs Method
ADPhysODBCDriverLink1.GetDSNs(Memo1.Lines, False);


See Also

See Also
TADPhysODBCBaseDriverLink.GetDSNs Method
See Also

GetDrivers


See Also

See Also
TADPhysODBCBaseDriverLink.ODBCAdvanced Property
See Also

Configuring Drivers, ODBCDriver


See Also

See Also
TADPhysODBCBaseDriverLink.ODBCDriver Property
See Also

Configuring Drivers, ODBCAdvanced, Release


See Also

See Also
uADPhysOracle Namespace
See Also

Connect to Oracle Server, Using Oracle with FireDAC, Configuring Drivers


uADPhysOracle Namespace Classes

uADPhysOracle Namespace Classes
uADPhysOracle Namespace Legend
Classes
Class | Description
TADPhysOracleDriverLink | Use the TADPhysOracleDriverLink component to link the Oracle Database driver to an application and setup it.


Legend

Legend
uADPhysOracle Namespace
Legend
Class


Topics

Topics
uADPhysOracle Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


Example

Example
TADPhysOracleDriverLink.GetOracleHomes Method
ADPhysOracleDriverLink1.GetOracleHomes(Memo1.Lines);


See Also

See Also
TADPhysOracleDriverLink.GetOracleHomes Method
See Also

GetTNSServices


Example

Example
TADPhysOracleDriverLink.GetTNSServices Method
ADPhysOracleDriverLink1.GetTNSServices(Memo1.Lines);


See Also

See Also
TADPhysOracleDriverLink.GetTNSServices Method
See Also

GetOracleHomes


Example

Example
TADPhysOracleDriverLink.NLSLang Property
ADPhysOracleDriverLink1.NLSLang := 'AMERICAN_AMERICA.UTF8';


See Also

See Also
TADPhysOracleDriverLink.NLSLang Property
See Also

TNSAdmin


Example

Example
TADPhysOracleDriverLink Class
ADPhysOracleDriverLink1.VendorHome := 'Oracle11_Home';


See Also

See Also
TADPhysOracleDriverLink Class
See Also

Configuring Drivers, Connect to Oracle Server, Using Oracle with FireDAC


Example

Example
TADPhysOracleDriverLink.TNSAdmin Property
ADPhysOracleDriverLink1.TNSAdmin := 'c:\Program Files\MyApp\Config';


See Also

See Also
TADPhysOracleDriverLink.TNSAdmin Property
See Also

NLSLang


See Also

See Also
uADPhysPG Namespace
See Also

Configuring Drivers, Connect to PostgreSQL


uADPhysPG Namespace Classes

uADPhysPG Namespace Classes
uADPhysPG Namespace Legend
Classes
Class | Description
TADPhysPgDriverLink | Use the TADPhysPgDriverLink component to link the PostgreSQL driver to an application and setup it.


Legend

Legend
uADPhysPG Namespace
Legend
Class


Topics

Topics
uADPhysPG Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


Example

Example
TADPhysPgDriverLink Class
ADPhysPgDriverLink1.VendorLib := 'E:\PostgreSQL\9.0\bin\libpq.dll';


See Also

See Also
TADPhysPgDriverLink Class
See Also

Configuring Drivers, Connect to PostgreSQL


See Also

See Also
uADPhysSQLite Namespace
See Also

Connect to SQLite database, Using SQLite with FireDAC, Configuring Drivers


uADPhysSQLite Namespace Classes

uADPhysSQLite Namespace Classes
uADPhysSQLite Namespace Legend
Classes
Class | Description
TADPhysSQLiteDriverLink | Use the TADPhysSQLiteDriverLink component to link the SQLite driver to an application and setup it.
TADSQLiteBackup | The class implementing SQLite backup, restore, copy database functionality.
TADSQLiteCollation | The class implementing custom SQLite collation.
TADSQLiteFunction | The class implementing custom SQLite function.
TADSQLiteRTree | The class implementing custom SQLite RTree module.
TADSQLiteSecurity | The class allowing to manage SQLite database encryption.
TADSQLiteService | The base class for all SQLite service classes.
TADSQLiteValidate | The class implementing SQLite database validate service.


Legend

Legend
uADPhysSQLite Namespace
Legend
Class


Topics

Topics
uADPhysSQLite Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADPhysSQLiteDriverLink Class
See Also

Configuring Drivers, Connect to SQLite database, Using SQLite with FireDAC


See Also

See Also
TADSQLiteBackup.Backup Method
See Also

Database, DestDatabase, OnProgress


See Also

See Also
TADSQLiteBackup.BusyTimeout Property
See Also

WaitForLocks


See Also

See Also
TADSQLiteBackup.Catalog Property
See Also

DestCatalog


See Also

See Also
TADSQLiteBackup.Database Property
See Also

DatabaseObj, DestDatabase


Example

Example
TADSQLiteBackup.DatabaseObj Property
ADSQLiteBackup1.DatabaseObj := ADConnection1.CliObj;
ADSQLiteBackup1.DestDatabase := 'c:\backup.sdb';
ADSQLiteBackup1.Backup;


See Also

See Also
TADSQLiteBackup.DatabaseObj Property
See Also

Database, DestDatabaseObj


See Also

See Also
TADSQLiteBackup.DestCatalog Property
See Also

Catalog, DestDatabase


See Also

See Also
TADSQLiteBackup.DestDatabase Property
See Also

DestDatabaseObj, Database, BusyTimeout, WaitForLocks


Example

Example
TADSQLiteBackup.DestDatabaseObj Property
ADSQLiteBackup1.Database := 'c:\db.sdb';
ADSQLiteBackup1.DestDatabaseObj := ADConnection1.CliObj;
ADSQLiteBackup1.Backup;


See Also

See Also
TADSQLiteBackup.DestDatabaseObj Property
See Also

DestDatabase, Database, BusyTimeout, WaitForLocks


See Also

See Also
TADSQLiteBackup.DestMode Property
See Also

DestDatabase


See Also

See Also
TADSQLiteBackup.DestPassword Property
See Also

Connect to SQLite database, Password, DestDatabase


See Also

See Also
TADSQLiteBackup.OnProgress Event
See Also

PageCount, Remaining


See Also

See Also
TADSQLiteBackup.PageCount Property
See Also

Remaining, OnProgress


See Also

See Also
TADSQLiteBackup.PagesPerStep Property
See Also

OnProgress


Example

Example
TADSQLiteBackup.Password Property
// DB is encrypted using aes-ecb-128 cipher algorithm
ADConnection1.Params.Add('Password=aes-ecb-128:12345');
ADConnection1.Connected  := True;
....
// specify aes-ecb-128 cipher algorithm for source database
ADSQLiteBackup1.Password := 'aes-ecb-128:12345';


See Also

See Also
TADSQLiteBackup.Password Property
See Also

Connect to SQLite database, Database, DestPassword


See Also

See Also
TADSQLiteBackup.Remaining Property
See Also

PageCount, OnProgress


Example 1

Example 1
TADSQLiteBackup Class
ADSQLiteBackup1.Database := 'c:\addemo.sdb';
ADSQLiteBackup1.DestDatabase := 'c:\addemo.backup';
ADSQLiteBackup1.Backup;


Example 2

Example 2
TADSQLiteBackup Class
// create SQLite in-memory database
with ADConnection1.Params do begin
  Clear;
  Add('DriverID=SQLite');
  Add('Database=:memory:');
end;
ADConnection1.Connected := True;

// populate the in-memory database
ADConnection1.ExecSQL('create table aaa (f1 integer, f2 text)');
ADConnection1.ExecSQL('insert into aaa values (1, ''qqq'')');
ADConnection1.ExecSQL('insert into aaa values (2, ''www'')');
ADConnection1.ExecSQL('insert into aaa values (3, ''eee'')');

// specify the in-memory database objects as a backup source
ADSQLiteBackup1.DatabaseObj := ADConnection1.CliObj;
// specify database file name as a backup destination
ADSQLiteBackup1.DestDatabase := 'c:\db.sdb';
// copy the in-memory database to the file
ADSQLiteBackup1.Backup;


See Also

See Also
TADSQLiteBackup.WaitForLocks Property
See Also

BusyTimeout


See Also

See Also
TADSQLiteCollation.CollationKind Property
See Also

Flags, Locale, OnCompare


See Also

See Also
TADSQLiteCollation.CollationName Property
See Also

CollationKind


See Also

See Also
TADSQLiteCollation.Flags Property
See Also

Locale


See Also

See Also
TADSQLiteCollation.Locale Property
See Also

Flags


See Also

See Also
TADSQLiteCollation.OnCompare Property
See Also

CollationKind


Example 1

Example 1
TADSQLiteCollation Class
ADSQLiteCollation1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteCollation1.CollationName := 'UTF16NoCase';
ADSQLiteCollation1.CollationKind := scCompareString;
ADSQLiteCollation1.Flags := [sfIgnoreCase];
ADSQLiteCollation1.Active := True;


Example 2

Example 2
TADSQLiteCollation Class

See <FireDAC>\Samples\DBMS Specific\SQLite\UserCollation


See Also

See Also
TADSQLiteCollation Class
See Also

Using SQLite with FireDAC


See Also

See Also
TADSQLiteFunction.ArgumentsCount Property
See Also

FunctionaName, OnCalculate


See Also

See Also
TADSQLiteFunction.FunctionName Property
See Also

ArgumentCount, OnCalculate


See Also

See Also
TADSQLiteFunction.OnCalculate Property
See Also

ArgumentsCount, OnFinalize


Example 1

Example 1
TADSQLiteFunction Class
ADSQLiteFunction1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteFunction1.FunctionName := 'MyFunc';
ADSQLiteFunction1.ArgumentsCount := 2;
ADSQLiteFunction1.Active := True;
ADSQLiteFunction1.OnCalculate := ADSQLiteFunction1Calculate;

procedure TForm1.ADSQLiteFunction1Calculate(AFunc: TSQLiteFunction;
  AInputs: TSQLiteInputs; AOutput: TSQLiteOutput; var AUserData: TObject);
begin
  AOutput.AsInteger := AInputs[0].AsInteger * AInputs[1].AsInteger;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  // demo query
  ADQuery1.Open('select RegionID, 'MyFunc'(RegionID, 10) from "Region"');
end;


Example 2

Example 2
TADSQLiteFunction Class

See <FireDAC>\Samples\DBMS Specific\SQLite\UserFunction


See Also

See Also
TADSQLiteFunction Class
See Also

Using SQLite with FireDAC


See Also

See Also
TADSQLiteRTree.OnCalculate Property
See Also

OnFinalize


See Also

See Also
TADSQLiteRTree.RTreeName Property
See Also

OnCalculate


See Also

See Also
TADSQLiteRTree Class
See Also

Using SQLite with FireDAC


See Also

See Also
TADSQLiteSecurity.ChangePassword Method
See Also

Database, Password, ToPassword, Options, SetPassword


See Also

See Also
TADSQLiteSecurity.CheckEncryption Method
See Also

Database, Password


See Also

See Also
TADSQLiteSecurity.Database Property
See Also

List here...


See Also

See Also
TADSQLiteSecurity.Options Property
See Also

SetPassword, ChangePassword, RemovePassword


See Also

See Also
TADSQLiteSecurity.Password Property
See Also

ToPassword


See Also

See Also
TADSQLiteSecurity.RemovePassword Method
See Also

Database, Password, Options, SetPassword


See Also

See Also
TADSQLiteSecurity.SetPassword Method
See Also

Database, Password, Options


Example 1

Example 1
TADSQLiteSecurity Class

Sets password and encrypts the unencrypted database:

ADSQLiteSecurity1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteSecurity1.Database := 'c:\addemo.sdb';
ADSQLiteSecurity1.Password := '12345';
ADSQLiteSecurity1.SetPassword;


Example 2

Example 2
TADSQLiteSecurity Class

Decrypts the encrypted database:

ADSQLiteSecurity1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteSecurity1.Database := 'c:\addemo.sdb';
ADSQLiteSecurity1.Password := '12345';
ADSQLiteSecurity1.RemovePassword;


Example 3

Example 3
TADSQLiteSecurity Class

Changes the encrypted database password:

ADSQLiteSecurity1.DriverLink := ADPhysSQLiteDriverLink1;
ADSQLiteSecurity1.Database := 'c:\addemo.sdb';
ADSQLiteSecurity1.Password := '12345';
ADSQLiteSecurity1.ToPassword := 'qwerty';
ADSQLiteSecurity1.ChangePassword;


See Also

See Also
TADSQLiteSecurity Class
See Also

Using SQLite with FireDAC


See Also

See Also
TADSQLiteSecurity.ToPassword Property
See Also

ChangePassword


See Also

See Also
TADSQLiteValidate.Analyze Method
See Also

CheckOnly, Sweep


See Also

See Also
TADSQLiteValidate.CheckOnly Method
See Also

Analyze, Sweep, OnProgress


See Also

See Also
TADSQLiteValidate.MaxErrors Property
See Also

CheckOnly


See Also

See Also
TADSQLiteValidate.Options Property
See Also

CheckOnly


Example

Example
TADSQLiteValidate Class

Validate database:

procedure TForm1.ADSQLiteValidate1Progress(ASender: TADPhysDriverService; const AMessage: String);
begin
  Memo1.Lines.Add(AMessage);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ADSQLiteValidate1.DriverLink := ADPhysSQLiteDriverLink1;
  ADSQLiteValidate1.Database := 'c:\addemo.sq3';
  ADSQLiteValidate1.OnProgress := Form1Progress;
  Memo1.Lines.Clear;
  if not ADSQLiteValidate1.CheckOnly then
    ShowMessage('Database has problems ! See log for details.')
  else
    ShowMessage('Database is valid');
end;


See Also

See Also
TADSQLiteValidate.Sweep Method
See Also

Analyze, CheckOnly


See Also

See Also
uADPhysSQLiteVDataSet Namespace
See Also

Local SQL


uADPhysSQLiteVDataSet Namespace Classes

uADPhysSQLiteVDataSet Namespace Classes
uADPhysSQLiteVDataSet Namespace Legend
Classes
Class | Description
TADLocalSQL | The class implementing the SQLite based Local SQL engine.


Legend

Legend
uADPhysSQLiteVDataSet Namespace
Legend
Class


Topics

Topics
uADPhysSQLiteVDataSet Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADLocalSQL.Active Property
See Also

Local SQL, Connection


See Also

See Also
TADLocalSQL.Connection Property
See Also

Local SQL, Active


Example

Example
TADLocalSQL.DataSets Property
ADLocalSQL1.DataSets.Add.DataSet := ADOQuery1;
ADLocalSQL1.DataSets.Add.DataSet := ADOQuery2;
ADQuery1.LocalSQL := ADLocalSQL1;
ADQuery2.LocalSQL := ADLocalSQL1;


See Also

See Also
TADLocalSQL.DataSets Property
See Also

Local SQL, TADAdaptedDataSet.LocalSQL, TADLocalSQLDataSets, TADLocalSQLDataSet


See Also

See Also
TADLocalSQL.OnGetDataSet Event
See Also

Local SQL, DataSets, OnReadDataSet


See Also

See Also
TADLocalSQL.OnReadDataSet Event
See Also

Local SQL, OnGetDataSet


Example

Example
TADLocalSQL Class
ADConnection1.DriverName := 'SQLite';
ADLocalSQL1.Connection := ADConnection1;
ADLocalSQL1.SchemaName := 'orders';
ADLocalSQL1.DataSets.Add.DataSet := adoQOrders;
ADLocalSQL1.DataSets.Add.DataSet := qDetails;

ADQuery1.Connection := ADConnection1;
ADQuery1.Open('select * from orders.adoQOrders o left join orders.qDetails d on o.OrderID = d.OrderID');


See Also

See Also
TADLocalSQL Class
See Also

Local SQL, Executing Command


See Also

See Also
uADPhysTDBX Namespace
See Also

Configuring Drivers, Connect to dbExpress data source


uADPhysTDBX Namespace Classes

uADPhysTDBX Namespace Classes
uADPhysTDBX Namespace Legend
Classes
Class | Description
TADPhysTDBXDriverLink | Use the TADPhysTDBXDriverLink component to link the dbExpress v 4 bridge driver to an application.


Legend

Legend
uADPhysTDBX Namespace
Legend
Class


Topics

Topics
uADPhysTDBX Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADPhysTDBXDriverLink Class
See Also

Configuring Drivers, Connect to dbExpress data source


See Also

See Also
ETDBXNativeException Class
See Also

EADDBEngineException


See Also

See Also
uADPhysTDBXBase Namespace
See Also

uADPhysTDBX Namespace, uADPhysDataSnap Namespace


uADPhysTDBXBase Namespace Classes

uADPhysTDBXBase Namespace Classes
uADPhysTDBXBase Namespace Legend
Classes
Class | Description
ETDBXNativeException | Represents exception class for all TDBX based drivers.


Legend

Legend
uADPhysTDBXBase Namespace
Legend
Class


Topics

Topics
uADPhysTDBXBase Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
EADDBEngineException.ErrorCode Property
See Also

TADDBError.Kind, TADDBError.ErrorCode


See Also

See Also
EADDBEngineException.ErrorCount Property
See Also

Errors


Example

Example
EADDBEngineException.Errors Property
try
   ADQuery1.ExecSQL;
except
  on E: EADDBEngineException do
    for i := 0 to E.ErrorCount - 1 do
      Memo1.Lines.Add(E[i].Message);
end;


See Also

See Also
EADDBEngineException.Errors Property
See Also

TADDBError, ErrorCount


Example

Example
EADDBEngineException.Kind Property
try
  ADConnection1.Connected := True;
except
  on E: EADDBEngineException do
    if E.Kind = ekUserPwdInvalid then begin
      ShowMessage('A user name or a password are invalid');
      Abort;
    end;
end;


See Also

See Also
EADDBEngineException.Kind Property
See Also

TADDBError.Kind, TADDBError.ErrorCode


See Also

See Also
EADDBEngineException.Params Property
See Also

SQL


Example

Example
EADDBEngineException.SQL Property
try
  Log('Removing records');
  ADQuery1.ExecSQL('delete from tab');
  ....
  Log('Inserting records');
  ADQuery1.ExecSQL('insert into tab ...');
except
  on E: EADDBEngineException do begin
    Log(E.Message);
    Log('Failed SQL: ' + E.SQL);
    Log('Failed params: ' + E.Params.Text);
    raise;
  end;
end;


See Also

See Also
EADDBEngineException.SQL Property
See Also

Params


Example

Example
EADDBEngineException Class
uses
  uADStanError;
......
try
  ADQuery1.ExecSQL;
except
  on E: EADDBEngineException do
    if E.Kind = ekUKViolated then begin
      ShowMessage('The record must be unique');
      Abort;
    end;
end;


See Also

See Also
EADDBEngineException Class
See Also

Handling Errors, TADDBError, EADException


See Also

See Also
EADException Class
See Also

EADDBEngineException


See Also

See Also
uADStanError Namespace
See Also

Handling Errors


uADStanError Namespace Classes

uADStanError Namespace Classes
uADStanError Namespace Legend
Classes
Class | Description
EADDBArrayExecuteError | EADDBArrayExecuteError is used as an Array DML error description item.
EADDBEngineException | EADDBEngineException is the base exception class for all FireDAC DBMS related errors.
EADException | EADException is the base exception class for all FireDAC exceptions.
TADDBError | TADDBError represents FireDAC / DBMS errors, warnings and messages for the EADDBEngineException exception class.


Legend

Legend
uADStanError Namespace
Legend
Class


Topics

Topics
uADStanError Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.


See Also

See Also
TADDBError.CommandTextOffset Property
See Also

TADCustomQuery.Text, TADCustomCommand.SQLText


See Also

See Also
TADDBError.ErrorCode Property
See Also

Kind, Message


See Also

See Also
TADDBError.Kind Property
See Also

ErrorCode, Message


See Also

See Also
TADDBError.Message Property
See Also

ObjName, ErrorCode


See Also

See Also
TADDBError.ObjName Property
See Also

Message, ErrorCode, Kind


See Also

See Also
TADDBError.RowIndex Property
See Also

Array DML


See Also

See Also
TADDBError Class
See Also

EADDBEngineException


See Also

See Also
uADStanOption Namespace
See Also

Setting Options


uADStanOption Namespace Classes

uADStanOption Namespace Classes
uADStanOption Namespace Legend
Classes
Class | Description
TADBottomResourceOptions | The set of options controlling dataset persistence.
TADBottomUpdateOptions | The set of options controlling dataset editing and updates posting.
TADCustomOptions | The base class for all option classes.
TADEventAlerterOptions | The set of options controlling event alerter behaviour.
TADFetchOptions | The set of options controlling data and metadata fetching.
TADFormatOptions | The set of options controlling representation of fetched or sending data.
TADMapRule | TADMapRule represents a maintained client view to records in an FireDAC dataset...
TADMapRules | TADMapRules is a collection of TADMapRule objects.
TADResourceOptions | The set of options controlling SQL command preprocessor, command execution and dataset persistence.
TADTopResourceOptions | The set of options controlling SQL automatic connection recover, dataset persistence and server output.
TADTxOptions | The set of options controlling transaction behaviour.
TADUpdateOptions | The set of options controlling dataset editing and updates posting.


Legend

Legend
uADStanOption Namespace
Legend
Class
Enumeration


uADStanOption Namespace Structs, Records, Enums

uADStanOption Namespace Structs, Records, Enums
uADStanOption Namespace Legend
Structs, Records, Enums
Struct, Record, Enum | Description
TADActionRequest | The enumerated type lists all possible FireDAC requests to a database.
TADAutoFetchAll | Add a short summary here...


Structs, Records, Enums (AutoDoc Folder)

Legend
Legend
Enumeration


Topics

Topics
uADStanOption Namespace
Topics
Topic | Description
Classes | The following table lists classes in this documentation.
Structs, Records, Enums | The following table lists structs, records, enums in this documentation.


Example

Example
uADStanOption.TADAutoFetchAll Enumeration


See Also

See Also
uADStanOption.TADAutoFetchAll Enumeration
See Also

List here...


Example

Example
TADBottomResourceOptions.Assign Method
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);


See Also

See Also
TADBottomResourceOptions.Assign Method
See Also

RestoreDefaults


See Also

See Also
TADBottomResourceOptions.PersistentFileName Property
See Also

TADResourceOptions.Persistent, TADTopResourceOptions.DefaultStoreExt, TADTopResourceOptions.DefaultStoreFormat, TADTopResourceOptions.DefaultStoreFolder


See Also

See Also
TADBottomResourceOptions.ResolveFileName Method
See Also

PersistentFileName, TADTopResourceOptions.DefaultStoreExt, TADTopResourceOptions.DefaultStoreFormat, TADTopResourceOptions.DefaultStoreFolder


See Also

See Also
TADBottomResourceOptions.RestoreDefaults Method
See Also

AssignedValues


See Also

See Also
TADBottomResourceOptions Class
See Also

Setting Options, TADCustomCommand.ResourceOptions, TADQuery.ResourceOptions


Example

Example
TADBottomUpdateOptions.Assign Method
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);


See Also

See Also
TADBottomUpdateOptions.Assign Method
See Also

RestoreDefaults


See Also

See Also
TADBottomUpdateOptions.AutoIncFields Property
See Also

Auto-Incremental Fields, FetchGeneratorsPoint, GeneratorName, TADAutoIncField.GeneratorName, TField.AutoGenerateValue


See Also

See Also
TADBottomUpdateOptions.KeyFields Property
See Also

Unique Identifying Fields, TField.ProviderFlags


See Also

See Also
TADBottomUpdateOptions.RestoreDefaults Method
See Also

AssignedValues


See Also

See Also
TADBottomUpdateOptions Class
See Also

Setting Options, TADDataSet.UpdateOptions


See Also

See Also
TADBottomUpdateOptions.UpdateTableName Property
See Also

Overriding Posting Updates, Object Names, Update Command Generation


Example

Example
TADCustomOptions.Assign Method
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);


See Also

See Also
TADCustomOptions.Assign Method
See Also

RestoreDefaults


Example

Example
TADCustomOptions.RestoreDefaults Method
ADQuery1.FetchOptions.RowsetSize := 1000;
ADQuery1.FetchOptions.Mode := fmAll;
ADQuery1.Open('select * from big_table');
....
ADQuery1.FetchOptions.RestoreDefaults;


See Also

See Also
TADCustomOptions Class
See Also

TADFetchOptions, TADFormatOptions, TADResourceOptions, TADUpdateOptions


See Also

See Also
TADEventAlerterOptions.Kind Property
See Also

Database Alerts, Synchronize


See Also

See Also
TADEventAlerterOptions Class
See Also

Database Alerts, TADEventAlerter


See Also

See Also
TADEventAlerterOptions.Synchronize Property
See Also

Database Alerts, Kind, Timeout


See Also

See Also
TADFetchOptions.ActualRowsetSize Property
See Also

Mode, RecsMax


Example

Example
TADFetchOptions.Assign Method
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);


See Also

See Also
TADFetchOptions.Assign Method
See Also

RestoreDefaults


See Also

See Also
TADFetchOptions.AssignedValues Property
See Also

RestoreDefaults


See Also

See Also
TADFetchOptions.AutoClose Property
See Also

Mode, TADAdaptedDataSet.NextRecordSet, IADPhysCommand.NextRecordSet


See Also

See Also
TADFetchOptions.AutoFetchAll Property
See Also

Managing Transactions, Mode, AutoClose


See Also

See Also
TADFetchOptions.Cache Property
See Also

Unique Identifying Fields, Fetching Rows, Master-Detail Relationship, Items


See Also

See Also
TADFetchOptions.CursorKind Property
See Also

Fetching Rows, Mode, Unidirectional, RowsetSize


See Also

See Also
TADFetchOptions.DetailCascade Property
See Also

Caching Updates, Master-Detail Relationship, TADRdbmsDataSet.SchemaAdapter


Example

Example
TADFetchOptions.DetailDelay Property
// allow to user to scroll through master dataset, using GUI
qDetail.FetchOptions.DetailDelay := 200;
...
// there detail dataset is in sync with master dataset
qDetail.FetchOptions.DetailDelay := 0;
qDetail.MasterLink.Synchronize(True);
while not qMaster.Eof do begin
  ...
  qMaster.Next;
end;
// again allow to user to scroll through master dataset, using GUI
qDetail.FetchOptions.DetailDelay := 200;


See Also

See Also
TADFetchOptions.DetailDelay Property
See Also

Master-Detail Relationship, MasterSource, MasterLink, TADMasterDataLink, DetailOptimize


See Also

See Also
TADFetchOptions.DetailOptimize Property
See Also

Master-Detail Relationship, DetailDelay


See Also

See Also
TADFetchOptions.Items Property
See Also

Unique Identifying Fields, Fetching Rows, Cache, TField.ProviderFlags, TADBottomUpdateOptions.KeyFields, TADDatSColumn.Options


See Also

See Also
TADFetchOptions.LiveWindowFastFirst Property
See Also

Browsing Table, LiveWindowParanoic


See Also

See Also
TADFetchOptions.LiveWindowParanoic Property
See Also

Browsing Table, CursorKind, LiveWindowFastFirst


Example

Example
TADFetchOptions.Mode Property

To check for fmExactRecsMax exception use code like that:

try
  ...
except
  on E: EADException do
    if E.ADCode = er_AD_AccExactFetchMismatch then
      ; // fetching failed
end;


See Also

See Also
TADFetchOptions.Mode Property
See Also

Fetching Rows, TADDataSet.FetchAll, TADDataSet.GetNextPacket, RecsMax, RowsetSize, Unidirectional


See Also

See Also
TADFetchOptions.RecordCountMode Property
See Also

TDataSet.RecordCount, Mode


Example

Example
TADFetchOptions.RecsMax Property
ADQuery1.FetchOptions.RecsMax := 20;
ADQuery1.FetchOptions.RecsSkip := 60;
ADQuery1.Open;
ADQuery1.FetchAll; // query will return records from 61'th to 80'th


See Also

See Also
TADFetchOptions.RecsMax Property
See Also

Fetching Rows, RecsSkip, Mode, RowsetSize, LIMIT


Example

Example
TADFetchOptions.RecsSkip Property
ADQuery1.FetchOptions.RecsMax := 20;
ADQuery1.FetchOptions.RecsSkip := 60;
ADQuery1.Open;
ADQuery1.FetchAll; // query will return records from 61'th to 80'th


See Also

See Also
TADFetchOptions.RecsSkip Property
See Also

Fetching Rows, RecsMax, Mode, LIMIT


See Also

See Also
TADFetchOptions.RestoreDefaults Method
See Also

AssignedValues


See Also

See Also
TADFetchOptions.RowsetSize Property
See Also

Fetching Rows, Mode, Unidirectional


See Also

See Also
TADFetchOptions Class
See Also

Fetching Rows, Setting Options, Unique Identifying Fields, Master-Detail Relationship, TADCustomManager.FetchOptions, TADCustomConnection.FetchOptions, TADCustomCommand.FetchOptions, TADQuery.FetchOptions, IADPhysCommand.Options


See Also

See Also
TADFetchOptions.Unidirectional Property
See Also

Fetching Rows, RowsetSize, Mode


Example

Example
TADFormatOptions.Assign Method
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);


See Also

See Also
TADFormatOptions.Assign Method
See Also

RestoreDefaults


See Also

See Also
TADFormatOptions.AssignedValues Property
See Also

RestoreDefaults


See Also

See Also
TADFormatOptions.DefaultParamDataType Property
See Also

TADParam.DataType


Example

Example
TADFormatOptions.FmtDisplayDate Property
ADQuery1.FormatOptions.FmtDisplayDate := 'yyyy.mm.dd';


See Also

See Also
TADFormatOptions.FmtDisplayDate Property
See Also

FmtDisplayDateTime, FmtDisplayTime, FmtDisplayNumeric, FmtEditNumeric


Example

Example
TADFormatOptions.FmtDisplayDateTime Property
ADQuery1.FormatOptions.FmtDisplayDateTime := 'yyyy.mm.dd hh:mm';


See Also

See Also
TADFormatOptions.FmtDisplayDateTime Property
See Also

FmtDisplayDate, FmtDisplayTime, FmtDisplayNumeric, FmtEditNumeric


Example

Example
TADFormatOptions.FmtDisplayNumeric Property
ADQuery1.FormatOptions.FmtDisplayNumeric := '#,##0.';


See Also

See Also
TADFormatOptions.FmtDisplayNumeric Property
See Also

FmtDisplayDateTime, FmtDisplayDate, FmtDisplayTime, FmtEditNumeric


Example

Example
TADFormatOptions.FmtDisplayTime Property
ADQuery1.FormatOptions.FmtDisplayTime := 'hh:mm';


See Also

See Also
TADFormatOptions.FmtDisplayTime Property
See Also

FmtDisplayDateTime, FmtDisplayDate, FmtDisplayNumeric, FmtEditNumeric


Example

Example
TADFormatOptions.FmtEditNumeric Property
ADQuery1.FormatOptions.FmtEditNumeric := '0.';


See Also

See Also
TADFormatOptions.FmtEditNumeric Property
See Also

FmtDisplayDateTime, FmtDisplayDate, FmtDisplayTime, FmtDisplayNumeric


See Also

See Also
TADFormatOptions.InlineDataSize Property
See Also

MaxStringSize


See Also

See Also
TADFormatOptions.MapRules Property
See Also

Data Type Mapping, TADMapRules, TADMapRule, OwnMapRules, MaxStringSize, MaxBcdPrecision, MaxBcdScale


See Also

See Also
TADFormatOptions.MaxBcdPrecision Property
See Also

Data Type Mapping, MaxBcdScale


See Also

See Also
TADFormatOptions.MaxBcdScale Property
See Also

Data Type Mapping, MaxBcdPrecision


See Also

See Also
TADFormatOptions.MaxStringSize Property
See Also

Data Type Mapping, InlineDataSize


See Also

See Also
TADFormatOptions.OwnMapRules Property
See Also

Data Type Mapping, MapRules


Example

Example
TADFormatOptions.QuoteIdentifiers Property
// Firebird table:
// create table "Records"(
//   "Id" int,
//   "RecId" int,
//   "RecName" varchar(15)
// )

ADTable1.FormatOptions.QuoteIdentfiers := True;
ADTable1.TableName := '"Records"';
ADTable1.IndexFieldNames := 'RecId';
ADTable1.Open;


See Also

See Also
TADFormatOptions.RestoreDefaults Method
See Also

AssignedValues


Example

Example
TADFormatOptions.SortLocale Property

Setup TADTable to query the Firebird database with ISO8859_1 character set containing German language string data:

uses
  Windows;
...
// Set locale ID to German phone book collation
ADTable1.FormatOptions.SortLocale := MAKELCID(MAKELANGID (LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
// Use the the punctuation and other symbols insensitive sorting
ADTable1.FormatOptions.SortOptions := [soNoSymbols];
ADTable1.IndexFieldNames := 'NAME';
ADTable1.TableName := 'CUSTOMERS';
ADTable1.Open;


See Also

See Also
TADFormatOptions.SortLocale Property
See Also

TADIndex.Options, TADDataSet.IndexFieldNames, TADDataSet.Indexes, SortOptions


Example 1

Example 1
TADFormatOptions.SortOptions Property

Setup TADTable to query the Firebird database with ISO8859_1 character set containing German language string data:

uses
  Windows;
...
// Set locale ID to German phone book collation
ADTable1.FormatOptions.SortLocale := MAKELCID(MAKELANGID (LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
// Use the the punctuation and other symbols insensitive sorting
ADTable1.FormatOptions.SortOptions := [soNoSymbols];
ADTable1.IndexFieldNames := 'NAME';
ADTable1.TableName := 'CUSTOMERS';
ADTable1.Open;


Example 2

Example 2
TADFormatOptions.SortOptions Property

Setup IndexFieldNames sort order properties for TADMemTable:

ADMemTable1.FormatOptions.SortOptions := [soNullFirst, soNoCase];
ADMemTable1.IndexFieldNames := 'SECOND_NAME;FIRST_NAME';


See Also

See Also
TADFormatOptions.SortOptions Property
See Also

TADIndex.Options, TADDataSet.IndexFieldNames, TADDataSet.Indexes, SortLocale


See Also

See Also
TADFormatOptions Class
See Also

Setting Options, TADCustomManager.FormatOptions, TADCustomConnection.FormatOptions, TADCustomCommand.FormatOptions, TADQuery.FormatOptions, IADPhysCommand.Options


See Also

See Also
TADFormatOptions.StrsEmpty2Null Property
See Also

StrsTrim, StrsTrim2Len


See Also

See Also
TADFormatOptions.StrsTrim2Len Property
See Also

StrsTrim, StrsEmpty2Null


See Also

See Also
TADFormatOptions.StrsTrim Property
See Also

StrsEmpty2Null, StrsTrim2Len, Using SQLite with FireDAC


Example 1

Example 1
TADMapRule.NameMask Property
// maps all columns ending with ID to dtInt32
with ADQuery1.FormatOptions.MapRules.Add do begin
  NameMask := '%ID';
  TargetDataType := dtInt32;
end;


Example 2

Example 2
TADMapRule.NameMask Property
// maps all ID columns of dtFmtBCD data type to dtInt32
with ADQuery1.FormatOptions.MapRules.Add do begin
  NameMask := 'ID';
  SourceDataType := dtFmtBCD;
  TargetDataType := dtInt32;
end;


See Also

See Also
TADMapRule.NameMask Property
See Also

TADFormatOptions.MapRules, SourceDataType, TargetDataType


See Also

See Also
TADMapRule.PrecMax Property
See Also

TADFormatOptions.MapRules, PrecMin


See Also

See Also
TADMapRule.PrecMin Property
See Also

TADFormatOptions.MapRules, PrecMax


See Also

See Also
TADMapRule.ScaleMax Property
See Also

TADFormatOptions.MapRules, ScaleMin


See Also

See Also
TADMapRule.ScaleMin Property
See Also

TADFormatOptions.MapRules, ScaleMax


See Also

See Also
TADMapRule.SizeMax Property
See Also

TADFormatOptions.MapRules, SizeMin


See Also

See Also
TADMapRule.SizeMin Property
See Also

TADFormatOptions.MapRules, SizeMax


See Also

See Also
TADMapRule.SourceDataType Property
See Also

TADFormatOptions.MapRules, TargetDataType


See Also

See Also
TADMapRule Class
See Also

TADFormatOptions.MapRules, TADMapRules


See Also

See Also
TADMapRule.TargetDataType Property
See Also

TADFormatOptions.MapRules, SourceDataType


Example

Example
TADMapRules.Add Method
with ADConnection1.FormatOptions.MapRules.Add do begin
  SourceDataType := dtWideString;
  TargetDataType := dtAnsiString;
end;


See Also

See Also
TADMapRules.Add Method
See Also

Items, TCollection.Count


See Also

See Also
TADMapRules.Items Property
See Also

TADMapRule, TCollection.Count


See Also

See Also
TADMapRules Class
See Also

TADFormatOptions.MapRules, TADMapRule


See Also

See Also
TADResourceOptions.ActualSilentMode Property
See Also

SilentMode, uADGUIxIntf.ADGUIxSilent


See Also

See Also
TADResourceOptions.ArrayDMLSize Property
See Also

Array DML, TADDataSet.Execute


Example

Example
TADResourceOptions.Assign Method
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);


See Also

See Also
TADResourceOptions.Assign Method
See Also

RestoreDefaults


See Also

See Also
TADResourceOptions.AssignedValues Property
See Also

RestoreDefaults


See Also

See Also
TADResourceOptions.Backup Property
See Also

Persistent, Backup, BackupExt, BackupFolder


See Also

See Also
TADResourceOptions.BackupExt Property
See Also

Backup, BackupFolder, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADResourceOptions.BackupFolder Property
See Also

Backup, BackupExt, TADBottomResourceOptions.PersistentFileName


Example

Example
TADResourceOptions.CmdExecMode Property

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\Async;
  • FireDAC\Samples\Phys Layer\IADPhysCommand\Async.


See Also

See Also
TADResourceOptions.CmdExecMode Property
See Also

Asynchronous Execution, CmdExecTimeout, TADDataSet.Open, TADCustomCommand.Open, IADPhysCommand.Open, TADDataSet.Execute, TADCustomCommand.Execute, IADPhysCommand.Execute, TADCustomCommand.Fetch, IADPhysCommand.Fetch


Example 1

Example 1
TADResourceOptions.CmdExecTimeout Property

See demos:

  • FireDAC\Samples\Comp Layer\TADQuery\ExecSQL\Async;
  • FireDAC\Samples\Phys Layer\IADPhysCommand\Async.


Example 2

Example 2
TADResourceOptions.CmdExecTimeout Property
// set timeout to 5 seconds
ADQuery1.ResourceOptions.CmdExecTimeout := 5000;
ADQuery1.ExecSQL;


See Also

See Also
TADResourceOptions.CmdExecTimeout Property
See Also

Asynchronous Execution, CmdExecMode, TADDataSet.Open, TADCustomCommand.Open, IADPhysCommand.Open, TADDataSet.Execute, TADCustomCommand.Execute, IADPhysCommand.Execute, TADCustomCommand.Fetch, IADPhysCommand.Fetch


See Also

See Also
TADResourceOptions.DefaultParamType Property
See Also

TADParam.ParamType


See Also

See Also
TADResourceOptions.DefaultStoreExt Property
See Also

DefaultStoreFormat, DefaultStoreFolder, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADResourceOptions.DefaultStoreFolder Property
See Also

DefaultStoreFormat, DefaultStoreExt, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADResourceOptions.DefaultStoreFormat Property
See Also

DefaultStoreExt, DefaultStoreFolder, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADResourceOptions.EscapeExpand Property
See Also

Preprocessing Command Text, PreprocessCmdText, MacroCreate, MacroExpand, ParamCreate, ParamExpand


See Also

See Also
TADResourceOptions.MacroCreate Property
See Also

Preprocessing Command Text, PreprocessCmdText, EscapeExpand, MacroExpand, ParamCreate, ParamExpand


See Also

See Also
TADResourceOptions.MacroExpand Property
See Also

Preprocessing Command Text, PreprocessCmdText, EscapeExpand, MacroCreate, ParamCreate, ParamExpand


See Also

See Also
TADResourceOptions.ParamCreate Property
See Also

Preprocessing Command Text, PreprocessCmdText, EscapeExpand, MacroExpand, ParamCreate, ParamExpand


See Also

See Also
TADResourceOptions.ParamExpand Property
See Also

Preprocessing Command Text, PreprocessCmdText, EscapeExpand, MacroCreate, MacroExpand, ParamCreate


See Also

See Also
TADResourceOptions.Persistent Property
See Also

TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADResourceOptions.PreprocessCmdText Property
See Also

EscapeExpand, MacroCreate, MacroExpand, ParamCreate, ParamExpand


See Also

See Also
TADResourceOptions.RestoreDefaults Method
See Also

AssignedValues


See Also

See Also
TADResourceOptions.SilentMode Property
See Also

uADGUIxIntf.FADGUIxSilentMode


See Also

See Also
TADResourceOptions Class
See Also

Setting Options, TADCustomManager.ResourceOptions, TADCustomConnection.ResourceOptions, TADCustomCommand.ResourceOptions, TADQuery.ResourceOptions, IADPhysCommand.Options


See Also

See Also
TADResourceOptions.StoreItems Property
See Also

StoreVersion, TADDataSet.SaveToStream, TADDataSet.SaveToFile, TADDataSet.LoadFromStream, TADDataSet.LoadFromFile


See Also

See Also
TADResourceOptions.StoreVersion Property
See Also

DefaultStoreFormat, StoreItems, TADDataSet.SaveToStream, TADDataSet.SaveToFile, TADDataSet.LoadFromStream, TADDataSet.LoadFromFile


Example

Example
TADTopResourceOptions.Assign Method
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);


See Also

See Also
TADTopResourceOptions.Assign Method
See Also

RestoreDefaults


See Also

See Also
TADTopResourceOptions.AutoConnect Property
See Also

Establishing Connection, AutoReconnect, KeepConnection, MaxCursors


See Also

See Also
TADTopResourceOptions.AutoReconnect Property
See Also

Recovering Connection, TADCustomConnection.OnLosted, TADCustomConnection.OnRecover, TADCustomConnection.OnRestored


See Also

See Also
TADTopResourceOptions.BackupExt Property
See Also

Backup, BackupFolder, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADTopResourceOptions.BackupFolder Property
See Also

Backup, BackupExt, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADTopResourceOptions.DefaultStoreExt Property
See Also

DefaultStoreFormat, DefaultStoreFolder, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADTopResourceOptions.DefaultStoreFolder Property
See Also

DefaultStoreFormat, DefaultStoreExt, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADTopResourceOptions.DefaultStoreFormat Property
See Also

DefaultStoreExt, DefaultStoreFolder, TADBottomResourceOptions.PersistentFileName


See Also

See Also
TADTopResourceOptions.KeepConnection Property
See Also

Establishing Connection

TADCustomConnection


See Also

See Also
TADTopResourceOptions.RestoreDefaults Method
See Also

AssignedValues


Example 1

Example 1
TADTopResourceOptions.ServerOutput Property
// SQL Server
procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  ADConnection1.ResourceOptions.ServerOutput := True;
  ADQuery1.ExecSQL('EXEC sp_configure ''show advanced options'', 1');
  for i := 0 to ADConnection1.ConnectionIntf.Messages.ErrorCount - 1 do
    Memo1.Lines.Add(ADConnection1.ConnectionIntf.Messages[i].Message);
end;


Example 2

Example 2
TADTopResourceOptions.ServerOutput Property
// Oracle
procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  ADConnection1.ResourceOptions.ServerOutputSize := 256 * 1024;
  ADConnection1.ResourceOptions.ServerOutput := True;
  ADQuery1.ExecSQL('begin dbms_output.put_line(''trace message''); end;');
  for i := 0 to ADConnection1.ConnectionIntf.Messages.ErrorCount - 1 do
    Memo1.Lines.Add(ADConnection1.ConnectionIntf.Messages[i].Message);
end;


See Also

See Also
TADTopResourceOptions.ServerOutput Property
See Also

TADCustomConnection.Messages, IADPhysConnectionIntf.Messages


See Also

See Also
TADTopResourceOptions.ServerOutputSize Property
See Also

ServerOutput


See Also

See Also
TADTopResourceOptions Class
See Also

Setting Options, TADCustomManager.ResourceOptions, TADCustomConnection.ResourceOptions


See Also

See Also
TADTxOptions.AutoCommit Property
See Also

TADCustomTransaction.StartTransaction, TADCustomTransaction.Commit, TADCustomTransaction.Rollback, AutoStart, AutoStop, StopOptions


See Also

See Also
TADTxOptions.AutoStart Property
See Also

AutoCommit, AutoStop


See Also

See Also
TADTxOptions.AutoStop Property
See Also

AutoCommit, AutoStart, StopOptions


See Also

See Also
TADTxOptions.Changed Property
See Also

ClearChanged


See Also

See Also
TADTxOptions.ClearChanged Method
See Also

Changed


See Also

See Also
TADTxOptions.DisconnectAction Property
See Also

TADCustomConnection.Connected


See Also

See Also
TADTxOptions.EnableNested Property
See Also

StartTransaction


See Also

See Also
TADTxOptions.Params Property
See Also

Isolation, ReadOnly, TADUpdateOptions.LockWait


See Also

See Also
TADTxOptions.ReadOnly Property
See Also

Isolation, Params


See Also

See Also
TADTxOptions Class
See Also

Managing Transactions, TADCustomConnection.TxOptions, TADCustomTransaction.Options, IADPhysTransaction.Options


See Also

See Also
TADTxOptions.StopOptions Property
See Also

AutoStart, AutoStop


Example

Example
TADUpdateOptions.Assign Method
 ADQuery2.UpdateOptions.Assign(ADQuery1.UpdateOptions);


See Also

See Also
TADUpdateOptions.Assign Method
See Also

RestoreDefaults


See Also

See Also
TADUpdateOptions.AssignedValues Property
See Also

RestoreDefaults


See Also

See Also
TADUpdateOptions.CheckReadOnly Property
See Also

Editing the Data, TField.ReadOnly, CheckRequired, CheckUpdatable, UpdateNonBaseFields


See Also

See Also
TADUpdateOptions.CheckRequired Property
See Also

Editing the Data, TField.Required, CheckUpdatable, CheckReadOnly


See Also

See Also
TADUpdateOptions.CheckUpdatable Property
See Also

Editing the Data, TField.ReadOnly, CheckReadOnly, CheckRequired


See Also

See Also
TADUpdateOptions.CountUpdatedRecords Property
See Also

Update Command Generation


See Also

See Also
TADUpdateOptions.EnableDelete Property
See Also

Editing the Data, EnableInsert, EnableUpdate, ReadOnly


See Also

See Also
TADUpdateOptions.EnableInsert Property
See Also

Editing the Data, EnableDelete, EnableUpdate, ReadOnly


See Also

See Also
TADUpdateOptions.EnableUpdate Property
See Also

Editing the Data, EnableDelete, EnableInsert, ReadOnly


See Also

See Also
TADUpdateOptions.FastUpdates Property
See Also

Update Command Generation, UpdateChangedFields, LockMode, UpdateMode, RefreshMode


See Also

See Also
TADUpdateOptions.FetchGeneratorsPoint Property
See Also

Auto-Incremental Fields, GeneratorName, TADAutoIncField.GeneratorName, AutoIncFields


See Also

See Also
TADUpdateOptions.GeneratorName Property
See Also

Auto-Incremental Fields, Object Names, FetchGeneratorsPoint, TADAutoIncField.GeneratorName


See Also

See Also
TADUpdateOptions.LockMode Property
See Also

LockPoint, LockWait


See Also

See Also
TADUpdateOptions.LockPoint Property
See Also

LockMode, LockWait


See Also

See Also
TADUpdateOptions.LockWait Property
See Also

LockMode, LockPoint


See Also

See Also
TADUpdateOptions.ReadOnly Property
See Also

Editing the Data, EnableDelete, EnableInsert, EnableUpdate


See Also

See Also
TADUpdateOptions.RefreshDelete Property
See Also

RefreshMode, TADDataSet.RefreshRecord


See Also

See Also
TADUpdateOptions.RefreshMode Property
See Also

Update Command Generation, TADDataSet.RefreshRecord, TADUpdateSQL.FetchRowSQL


See Also

See Also
TADUpdateOptions.RequestLive Property
See Also

Editing the Data, ReadOnly, TADFetchOptions.Items


See Also

See Also
TADUpdateOptions.RestoreDefaults Method
See Also

AssignedValues


See Also

See Also
TADUpdateOptions Class
See Also

Setting Options, TADCustomManager.UpdateOptions, TADCustomConnection.UpdateOptions, TADDataSet.UpdateOptions


See Also

See Also
TADUpdateOptions.UpdateChangedFields Property
See Also

Editing the Data, CacheUpdatesCommands, UpdateMode, FastUpdates


See Also

See Also
TADUpdateOptions.UpdateMode Property
See Also

Unique Identifying Fields, Update Command Generation, TField.ProviderFlags, TADBottomUpdateOptions.KeyFields


See Also

See Also
TADUpdateOptions.UpdateNonBaseFields Property
See Also

Overriding Posting Updates, UpdateChangedFields, CheckReadOnly


See Also

See Also
Unique Identifying Fields
See Also

Update Command Generation, Auto-Incremental Fields, KeyFields, Items, UpdateMode, ProviderFlags


See Also

See Also
Update Command Generation
See Also

Editing the Data, TADUpdateOptions


See Also

See Also
Using FireDAC
See Also

Known Limitations


See Also

See Also
Using Oracle with FireDAC
See Also

Connect to Oracle Server, uADPhysOracle Namespace


See Also

See Also
Using SQLite with FireDAC
See Also

Connect to SQLite database, uADPhysSQLite Namespace


Topics

Topics
Utilities
Topics
Topic | Description
ADAdministrator | All about FireDAC Administrator.
ADDFMChanger | All about automatic BDE -> FireDAC migration utility.
ADExecutor | All about FireDAC SQL Script execution utility.
ADExplorer | All about FireDAC Explorer.
ADMonitor | All about FireDAC interactive application monitoring utility.
Compile (tool name).bat | All about automatic recompiling FireDAC packages.
Create (DB name).bat | All about automatic FireDAC demo database creation.


Topics

Topics
Working with Commands
Topics
Topic | Description
Preprocessing Command Text | FireDAC offers powerful SQL command text preprocessor. Allowing to write DBMS independent SQL commands and to get more flexibility while building dynamic SQL command. The preprocessor features include substitution variables, escape sequences, escape functions and conditional escapes.
Executing Command | FireDAC offers TADQuery, TADCommand components and some TADConnection methods to execute SQL commands. The SQL commands are the main way to talk to SQL database.
Executing Stored Procedure | FireDAC offers TADStoredProc component to execute database stored procedures, as a stored procedure may be executed directly.
Browsing Table | FireDAC offers TADTable component to browse database table data, filter and sort records, and edit the table data.
Database Alerts | FireDAC offers the TADEventAlerter component to listen for database alerts, send the alerts and manage them.
Fetching Rows | When a SQL command is executed it may create a cursor returning the result set. FireDAC offers wide range of features to effectively process the cursor and fetch rows into the client records cache.
Command Batches | FireDAC supports SQL command batches. Command batches allowing to execute multiple SQL commands in a single step and to process multiple result sets in a sequence.
Array DML | FireDAC offers high performance Array DML feature. It allows to move large volumes of data to a database using standard INSERT or UPDATE SQL commands.
Asynchronous Execution | FireDAC offers multiple features for asynchronous operation execution. In addition to being ready for use in multi-threaded applications, FireDAC makes it easy for the developer to not have to worry about multi-threading in the first place by allowing you to control the timing aspects of the data access operation execution. This includes Execute, Open and Fetch operations.
Executing SQL Scripts | Most database applications have backend administration utilities, which must execute SQL script. These scripts are written using lines appropriate to the DBMS SQL script syntax. TADScript is the FireDAC SQL script processor.
Local SQL | FireDAC offers flexible Local SQL feature. It allows to execute SQL queries against TDataSet descendants as the data sources.


Topics

Topics
Working with Connections
Topics
Topic | Description
Defining Connection | Describes how to store and use FireDAC connection parameters and what is a connection definition. To specify connection parameters an application must use a connection definition. The connection definition is a set of parameters. A connection may be also pooled.
Configuring Drivers | Describes how to configure the FireDAC DBMS drivers, including how to specify a DBMS client library. To link an FireDAC driver to an application, specify DBMS client to the driver and other optional parameters, an application may use a TADPhysXXXDriverLink components and/or external configuration file.
Setting Options | Describes why the set of options makes FireDAC a flexible database framework and how to use the options. FireDAC offers the wide range of the options organized into an hierarchical options system. Most of the options may be leaved with their default values.
Establishing Connection | Describes how to open and close connection to a DBMS using FireDAC. To open a connection to a database FireDAC offers the TADConnection component.
Recovering Connection | Describes how to work in an unstable environment. FireDAC allows an application to recover from a connection failure.
Offlining Connection | Describes how to use FireDAC offline mode allows to work with data without a persistent connection to a database.
Managing Transactions | Describes how to manage DBMS transactions using FireDAC. To handle database transactions FireDAC offers the TADConnection and TADTransaction components.
Handling Errors | Describes how to handle database errors with FireDAC.
Multi Threading | Describes how to use FireDAC in multi threading environment.
DLL Development | Describes how to use FireDAC in the dynamic loading libraries.
Unicode Support | Describes how FireDAC works with Unicode data and metadata. FireDAC fully support Unicode data and metadata. Although an application may need to take the additional steps to use Unicode properly.


Topics

Topics
Working with DataSets
Topics
Topic | Description
Sorting Records | FireDAC offers few methods to sort the records. The dataset sorting allows to get the required records order without requering a DB.
Filtering Records | FireDAC offers few methods to filter the records. The dataset filtering allows to get records subsets basing on a condition.
Master-Detail Relationship | FireDAC has flexible support for master-detail relationship between datasets.
Finding a Record | FireDAC offers few methods to find a specific record in the dataset.
Calculated and Aggregated Fields | FireDAC offers few kinds of calculated fields.
Writing Expressions | FireDAC offers powerful client expressions engine, used for filtering, indexing and calculated fields.


Topics

Topics
Working with DBMS
Topics
Topic | Description
Using SQLite with FireDAC | This article describes the aspects of developing [image] SQLite database applications using FireDAC for Delphi. FireDAC is the leading DBMS access engine for Delphi providing powerful API to unique SQLite features. The SQLite is an embedded SQL database engine, [image] most widely deployed in the world.
Using Oracle with FireDAC | This article describes the aspects of developing [image] Oracle database applications using FireDAC for Delphi. FireDAC is the leading DBMS access engine for Delphi providing powerful API to unique Oracle features. The [image] Oracle is an enterprise level relational database server, #1 in worldwide RDBMS software revenue share.
Using Data Abstract with FireDAC | This article describes the power of combining the FireDAC with the [image] RemObjects Data Abstract. FireDAC is the leading Delphi DBMS access engine and RemObjects Data Abstract is a very powerful multi-tier framework.


Topics

Topics
Working with Metadata
Topics
Topic | Description
Querying Metadata | FireDAC offers TADMetaInfoQuery components and some TADConnection methods to retrieve metadata from a database.
Extended Metadata | Depending on a DBMS the metadata may include advanced data type recognition for the columns.
Metadata Structure | The chapter describes the structures of the metadata returned by FireDAC TADMetaInfoQuery.
Object Names | FireDAC supports quoted object names and full object names. The chapter describes how to work with object names.


Example

Example
Writing Expressions

See FireDAC demos for more details:

  • FireDAC\Samples\Comp Layer\TADQuery\Filter;
  • FireDAC\Samples\DatS Layer\CalcColumnWithFuncs.


Topics

Topics
x Platform Development
Topics
Topic | Description
Installing FireDAC | FireDAC requires special steps to install or deploy on Linux, Mac OS X and iOS.
Using FireDAC | FireDAC development on Linux, Mac OS X and iOS has differences comparing to Windows.
Known Limitations | The list of known FireDAC limitations related to cross platform development.
UnixODBC | FireDAC on the non-Windows platforms uses UnixODBC to access to the ODBC-based data sources.
Lazarus / FPC | FireDAC supports Lazarus / FPC. Lazarus / FPC enables application development for Windows, Linux, Mac OS, iOS and more.


Contents

Contents
FireDAC Contents
FireDAC
Overview
Getting Started
First Steps to use FireDAC
Setting up Connections
Very High Performance using the Array DML
Creating Reports with FastReport
Demo Databases
Demo Applications
Architecture
General
Components
Databases
Programming Tools
Class Hierarchy
Working with Connections
Defining Connection
Configuring Drivers
Setting Options
Data Type Mapping
Establishing Connection
Recovering Connection
Offlining Connection
Managing Transactions
Handling Errors
Multi Threading
DLL Development
Unicode Support
Working with Commands
Preprocessing Command Text
Character macro functions
Numeric macro functions
Date and time macro functions
System macro functions
Convert macro function
RETURNING unified support
Executing Command
Executing Stored Procedure
Browsing Table
Database Alerts
Fetching Rows
Command Batches
Array DML
Asynchronous Execution
Executing SQL Scripts
SQL Script Control Commands
Developing Custom Commands
Local SQL
Working with DataSets
Sorting Records
Filtering Records
Master-Detail Relationship
Finding a Record
Calculated and Aggregated Fields
Writing Expressions
Editing the Data
Changing DataSet Data
Caching Updates
Unique Identifying Fields
Auto-Incremental Fields
Update Command Generation
Overriding Posting Updates
Specifying Default Values
Working with Metadata
Querying Metadata
Extended Metadata
Metadata Structure
Object Names
Working with DBMS
Using SQLite with FireDAC
Using Oracle with FireDAC
Using Data Abstract with FireDAC
x Platform Development
Installing FireDAC
Using FireDAC
Known Limitations
UnixODBC
Lazarus / FPC
Installing on Windows
Installing on Linux
Migrating BDE applications
BDE name counterparts
BDE aliases migration
BDE application migration
Additional migration hints
Debugging
DBMS Environment Reports
Tracing and Monitoring
Deploying
Delpoying on Windows
Delpoying on Mac OS X or Linux
Utilities
ADAdministrator
ADDFMChanger
ADExecutor
ADExplorer
ADMonitor
Compile (tool name).bat
Create (DB name).bat
Database Connectivity
Common connection parameters
Connect to Advantage Database Server
Connect to Blackfish SQL Server
Connect to DataSnap server
Connect to dbExpress data source
Connect to IBM DB2 Server
Connect to Interbase or Firebird
Connect to Microsoft SQL Server
Connect to Microsoft SQL Server Compact Edition
Connect to Microsoft Access database
Connect to MySQL Server
Connect to ODBC data source
Connect to Oracle Server
Connect to PostgreSQL
Connect to SQLite database
Connect to Sybase SQL Anywhere
FAQ
Installation
General Questions
TADManager and TADConnection Questions
TADQuery, TADStoredProc and TADUpdateSQL Questions
TADTable Questions
TADMemTable Questions
Fetching and Populating Questions
Sorting, Searching, Locating, Filtering Questions
Editing Questions
GUI Questions
SQL Scripts Questions
Metadata Questions
Debugging and Reporting Environment Questions
Integration with 3d Party Products Questions
Firebird and Interbase Servers Questions
MS SQL Server Questions
Oracle Server Questions
SQLite Database Questions
MySQL Server Questions
MS Access Questions
Symbol Reference
uADCompClient Namespace
Classes
TADAdaptedDataSet Class
TADAdaptedDataSet Members
public
TADAdaptedDataSet.Adapter Property
TADAdaptedDataSet.Command Property
TADAdaptedDataSet.DatSManager Property
TADAdaptedDataSet.LocalSQL Property
TADAdaptedDataSet.OnError Event
TADAdaptedDataSet.OnExecuteError Event
TADAdaptedDataSet.PointedConnection Property
TADAdaptedDataSet.ServerEditRequest Property
TADAdaptedDataSet.AbortJob Method
TADAdaptedDataSet.AttachTable Method
TADAdaptedDataSet.Disconnect Method
TADAdaptedDataSet.GetResults Method
TADAdaptedDataSet.NextRecordSet Method
TADAdaptedDataSet.ServerAppend Method
TADAdaptedDataSet.ServerCancel Method
TADAdaptedDataSet.ServerDelete Method
TADAdaptedDataSet.ServerDeleteAll Method
TADAdaptedDataSet.ServerEdit Method
TADAdaptedDataSet.ServerGotoKey Method
TADAdaptedDataSet.ServerPerform Method
TADAdaptedDataSet.ServerSetKey Method
protected
TADAdaptedDataSet.UpdateObject Property
TADCommand Class
TADCommand Members
published
TADCommand.Active Property
TADCommand.ActiveStoredUsage Property
TADCommand.AfterClose Event
TADCommand.AfterExecute Event
TADCommand.AfterOpen Event
TADCommand.AfterPrepare Event
TADCommand.AfterUnprepare Event
TADCommand.BaseObjectName Property
TADCommand.BeforeClose Event
TADCommand.BeforeExecute Event
TADCommand.BeforeOpen Event
TADCommand.BeforePrepare Event
TADCommand.BeforeUnprepare Event
TADCommand.CatalogName Property
TADCommand.CommandKind Property
TADCommand.CommandText Property
TADCommand.Connection Property
TADCommand.ConnectionName Property
TADCommand.FetchOptions Property
TADCommand.FormatOptions Property
TADCommand.Macros Property
TADCommand.OnCommandChanged Event
TADCommand.OnError Event
TADCommand.Overload Property
TADCommand.Params Property
TADCommand.ResourceOptions Property
TADCommand.SchemaName Property
TADCommand.Transaction Property
TADCommand.UpdateOptions Property
TADConnection Class
TADConnection Members
published
TADConnection.AfterCommit Event
TADConnection.AfterRollback Event
TADConnection.AfterStartTransaction Event
TADConnection.BeforeCommit Event
TADConnection.BeforeRollback Event
TADConnection.BeforeStartTransaction Event
TADConnection.Connected Property
TADConnection.ConnectedStoredUsage Property
TADConnection.ConnectionDefName Property
TADConnection.ConnectionName Property
TADConnection.DriverName Property
TADConnection.FetchOptions Property
TADConnection.FormatOptions Property
TADConnection.LoginDialog Property
TADConnection.LoginPrompt Property
TADConnection.OnError Event
TADConnection.OnLogin Event
TADConnection.OnLosted Event
TADConnection.OnRecover Event
TADConnection.OnRestored Event
TADConnection.Params Property
TADConnection.ResourceOptions Property
TADConnection.Transaction Property
TADConnection.TxOptions Property
TADConnection.UpdateOptions Property
TADConnection.UpdateTransaction Property
TADCustomCommand Class
TADCustomCommand Members
public
TADCustomCommand.Active Property
TADCustomCommand.ActiveStoredUsage Property
TADCustomCommand.AfterClose Event
TADCustomCommand.AfterExecute Event
TADCustomCommand.AfterFetch Event
TADCustomCommand.AfterOpen Event
TADCustomCommand.AfterPrepare Event
TADCustomCommand.AfterUnprepare Event
TADCustomCommand.BaseObjectName Property
TADCustomCommand.BeforeClose Event
TADCustomCommand.BeforeExecute Event
TADCustomCommand.BeforeFetch Event
TADCustomCommand.BeforeOpen Event
TADCustomCommand.BeforePrepare Event
TADCustomCommand.BeforeUnprepare Event
TADCustomCommand.BindedBy Property
TADCustomCommand.CatalogName Property
TADCustomCommand.CommandIntf Property
TADCustomCommand.CommandKind Property
TADCustomCommand.CommandText Property
TADCustomCommand.Connection Property
TADCustomCommand.ConnectionName Property
TADCustomCommand.DataSet Property
TADCustomCommand.FetchOptions Property
TADCustomCommand.FixedCommandKind Property
TADCustomCommand.FormatOptions Property
TADCustomCommand.Macros Property
TADCustomCommand.OnCommandChanged Event
TADCustomCommand.OnError Event
TADCustomCommand.Overload Property
TADCustomCommand.ParamBindMode Property
TADCustomCommand.Params Property
TADCustomCommand.Prepared Property
TADCustomCommand.ResourceOptions Property
TADCustomCommand.RowsAffected Property
TADCustomCommand.SchemaName Property
TADCustomCommand.SQLText Property
TADCustomCommand.State Property
TADCustomCommand.Transaction Property
TADCustomCommand.UpdateOptions Property
TADCustomCommand.Values Property
TADCustomCommand.AbortJob Method
TADCustomCommand.AcquireConnection Method
TADCustomCommand.Close Method
TADCustomCommand.CloseAll Method
TADCustomCommand.Define Method (TADDatSManager, TADDatSTable, TADPhysMetaInfoMergeMode)
TADCustomCommand.Define Method (TADDatSTable, TADPhysMetaInfoMergeMode)
TADCustomCommand.Disconnect Method
TADCustomCommand.Execute Method (Integer, Integer, Boolean)
TADCustomCommand.Execute Method (String)
TADCustomCommand.Execute Method (String, array of Variant)
TADCustomCommand.Execute Method (String, array of Variant, array of TFieldType)
TADCustomCommand.Fetch Method
TADCustomCommand.FillParams Method
TADCustomCommand.FindMacro Method
TADCustomCommand.FindParam Method
TADCustomCommand.GetConnection Method
TADCustomCommand.MacroByName Method
TADCustomCommand.NextRecordSet Method
TADCustomCommand.Open Method
TADCustomCommand.OpenOrExecute Method
TADCustomCommand.ParamByName Method
TADCustomCommand.Prepare Method
TADCustomCommand.ReleaseConnection Method
TADCustomCommand.Unprepare Method
TADCustomConnection Class
TADCustomConnection Members
public
TADCustomConnection.AfterCommit Event
TADCustomConnection.AfterRollback Event
TADCustomConnection.Connected Property
TADCustomConnection.AfterStartTransaction Event
TADCustomConnection.BeforeCommit Event
TADCustomConnection.BeforeRollback Event
TADCustomConnection.BeforeStartTransaction Event
TADCustomConnection.CliHandle Property
TADCustomConnection.CliObj Property
TADCustomConnection.CommandCount Property
TADCustomConnection.Commands Property
TADCustomConnection.ConnectedStoredUsage Property
TADCustomConnection.ConnectionDefName Property
TADCustomConnection.ConnectionIntf Property
TADCustomConnection.ConnectionMetaDataIntf Property
TADCustomConnection.ConnectionName Property
TADCustomConnection.DataSets Property
TADCustomConnection.DriverName Property
TADCustomConnection.FetchOptions Property
TADCustomConnection.FormatOptions Property
TADCustomConnection.InTransaction Property
TADCustomConnection.IsSQLBased Property
TADCustomConnection.LastUsed Property
TADCustomConnection.LoginDialog Property
TADCustomConnection.LoginPrompt Property
TADCustomConnection.Messages Property
TADCustomConnection.Offlined Property
TADCustomConnection.OnError Event
TADCustomConnection.OnLogin Event
TADCustomConnection.OnLosted Event
TADCustomConnection.OnRecover Event
TADCustomConnection.OnRestored Event
TADCustomConnection.OptionsIntf Property
TADCustomConnection.Params Property
TADCustomConnection.RDBMSKind Property
TADCustomConnection.RefCount Property
TADCustomConnection.ResourceOptions Property
TADCustomConnection.ResultConnectionDef Property
TADCustomConnection.SharedCliHandle Property
TADCustomConnection.Temporary Property
TADCustomConnection.Transaction Property
TADCustomConnection.TxOptions Property
TADCustomConnection.UpdateOptions Property
TADCustomConnection.UpdateTransaction Property
TADCustomConnection.AbortJob Method
TADCustomConnection.ApplyUpdates Method
TADCustomConnection.Assign Method
TADCustomConnection.CheckActive Method
TADCustomConnection.CheckConnectionDef Method
TADCustomConnection.CheckInactive Method
TADCustomConnection.CheckOnline Method
TADCustomConnection.Commit Method
TADCustomConnection.CommitRetaining Method
TADCustomConnection.DecodeObjectName Method
TADCustomConnection.EncodeObjectName Method
TADCustomConnection.ExecSQL Method (String)
TADCustomConnection.ExecSQL Method (String, array of Variant)
TADCustomConnection.ExecSQL Method (String, array of Variant, array of TFieldType)
TADCustomConnection.ExecSQLScalar Method (String)
TADCustomConnection.ExecSQLScalar Method (String, array of Variant)
TADCustomConnection.ExecSQLScalar Method (String, array of Variant, array of TFieldType)
TADCustomConnection.GetCatalogNames Method
TADCustomConnection.GetFieldNames Method
TADCustomConnection.GetGeneratorNames Method
TADCustomConnection.GetInfoReport Method
TADCustomConnection.GetKeyFieldNames Method
TADCustomConnection.GetLastAutoGenValue Method
TADCustomConnection.GetPackageNames Method
TADCustomConnection.GetSchemaNames Method
TADCustomConnection.GetStoredProcNames Method
TADCustomConnection.GetTableNames Method
TADCustomConnection.Offline Method
TADCustomConnection.Online Method
TADCustomConnection.Open Method (String)
TADCustomConnection.Open Method (String, String)
TADCustomConnection.Open Method (String, String, String)
TADCustomConnection.Ping Method
TADCustomConnection.RefreshMetadataCache Method
TADCustomConnection.ReleaseClients Method
TADCustomConnection.Rollback Method
TADCustomConnection.RollbackRetaining Method
TADCustomConnection.StartTransaction Method
TADCustomEventAlerter Class
TADCustomEventAlerter Members
public
TADCustomEventAlerter.Active Property
TADCustomEventAlerter.Connection Property
TADCustomEventAlerter.EventAlerterIntf Property
TADCustomEventAlerter.Names Property
TADCustomEventAlerter.OnAlert Event
TADCustomEventAlerter.OnTimeout Event
TADCustomEventAlerter.Options Property
TADCustomEventAlerter.Register Method
TADCustomEventAlerter.Signal Method
TADCustomEventAlerter.Unregister Method
TADCustomLocalSQL Class
TADCustomLocalSQL Members
public
TADCustomLocalSQL.Active Property
TADCustomLocalSQL.Connection Property
TADCustomLocalSQL.DataSets Property
TADCustomLocalSQL.OnGetDataSet Event
TADCustomLocalSQL.OnReadDataSet Event
TADCustomManager Class
TADCustomManager Members
public
TADCustomManager.Active Property
TADCustomManager.ActiveStoredUsage Property
TADCustomManager.ActualConnectionDefFileName Property
TADCustomManager.ActualDriverDefFileName Property
TADCustomManager.AfterLoadConnectionDefFile Event
TADCustomManager.AfterShutdown Event
TADCustomManager.AfterStartup Event
TADCustomManager.AutoCreated Property
TADCustomManager.BeforeLoadConnectionDefFile Event
TADCustomManager.BeforeShutdown Event
TADCustomManager.BeforeStartup Event
TADCustomManager.CanRefreshConnectionDefFile Property
TADCustomManager.ConnectionCount Property
TADCustomManager.ConnectionDefFileAutoLoad Property
TADCustomManager.ConnectionDefFileLoaded Property
TADCustomManager.ConnectionDefFileName Property
TADCustomManager.ConnectionDefs Property
TADCustomManager.Connections Property
TADCustomManager.DriverDefFileAutoLoad Property
TADCustomManager.DriverDefFileName Property
TADCustomManager.DriverDefs Property
TADCustomManager.FetchOptions Property
TADCustomManager.FormatOptions Property
TADCustomManager.ResourceOptions Property
TADCustomManager.SilentMode Property
TADCustomManager.State Property
TADCustomManager.UpdateOptions Property
TADCustomManager.WaitCursor Property
TADCustomManager.AddConnectionDef Method
TADCustomManager.Close Method
TADCustomManager.CloseConnectionDef Method
TADCustomManager.DeleteConnectionDef Method
TADCustomManager.DropConnections Method
TADCustomManager.FindConnection Method
TADCustomManager.GetBaseDriverID Method
TADCustomManager.GetCatalogNames Method
TADCustomManager.GetConnectionDefNames Method
TADCustomManager.GetConnectionDefParams Method
TADCustomManager.GetConnectionNames Method
TADCustomManager.GetDriverNames Method
TADCustomManager.GetFieldNames Method
TADCustomManager.GetGeneratorNames Method
TADCustomManager.GetKeyFieldNames Method
TADCustomManager.GetPackageNames Method
TADCustomManager.GetRDBMSKind Method
TADCustomManager.GetSchemaNames Method
TADCustomManager.GetStoredProcNames Method
TADCustomManager.GetTableNames Method
TADCustomManager.IsConnectionDef Method
TADCustomManager.LoadConnectionDefFile Method
TADCustomManager.ModifyConnectionDef Method
TADCustomManager.Open Method
TADCustomManager.RefreshConnectionDefFile Method
TADCustomManager.RefreshMetadataCache Method
TADCustomManager.SaveConnectionDefFile Method
TADCustomMemTable Class
TADCustomMemTable Members
public
TADCustomMemTable.Adapter Property
TADCustomMemTable.CommandText Property
TADCustomMemTable.DisableStringTrim Property
TADCustomMemTable.FetchOnDemand Property
TADCustomMemTable.FileName Property
TADCustomMemTable.IsClone Property
TADCustomMemTable.LogChanges Property
TADCustomMemTable.PacketRecords Property
TADCustomMemTable.ProviderEOF Property
TADCustomMemTable.ReadOnly Property
TADCustomMemTable.StatusFilter Property
TADCustomMemTable.XMLData Property
TADCustomMemTable.AppendData Method
TADCustomMemTable.ConstraintsDisabled Method
TADCustomMemTable.GetOptionalParam Method
TADCustomMemTable.MergeChangeLog Method
TADCustomMemTable.SetOptionalParam Method
TADCustomQuery Class
TADCustomQuery Members
public
TADCustomQuery.DataSource Property
TADCustomQuery.ParamCount Property
TADCustomQuery.SQL Property
TADCustomQuery.Text Property
TADCustomQuery.ExecSQL Method ()
TADCustomQuery.ExecSQL Method (String)
TADCustomQuery.ExecSQL Method (String, array of Variant)
TADCustomQuery.ExecSQL Method (String, array of Variant, array of TFieldType)
TADCustomSchemaAdapter Class
TADCustomSchemaAdapter Members
public
TADCustomSchemaAdapter.Count Property
TADCustomSchemaAdapter.TableAdapters Property
TADCustomSchemaAdapter.ApplyUpdates Method
TADCustomSchemaAdapter.Reconcile Method
TADCustomStoredProc Class
TADCustomStoredProc Members
public
TADCustomStoredProc.CatalogName Property
TADCustomStoredProc.Overload Property
TADCustomStoredProc.PackageName Property
TADCustomStoredProc.ParamCount Property
TADCustomStoredProc.RowsAffected Property
TADCustomStoredProc.SchemaName Property
TADCustomStoredProc.StoredProcName Property
TADCustomStoredProc.DescriptionsAvailable Method
TADCustomStoredProc.ExecFunc Method ()
TADCustomStoredProc.ExecFunc Method (String)
TADCustomStoredProc.ExecFunc Method (String, array of Variant)
TADCustomStoredProc.ExecFunc Method (String, array of Variant, array of TFieldType)
TADCustomStoredProc.ExecProc Method ()
TADCustomStoredProc.ExecProc Method (String)
TADCustomStoredProc.ExecProc Method (String, array of Variant)
TADCustomStoredProc.ExecProc Method (String, array of Variant, array of TFieldType)
TADCustomTransaction Class
TADCustomTransaction Members
public
TADCustomTransaction.Active Property
TADCustomTransaction.AfterCommit Event
TADCustomTransaction.AfterRollback Event
TADCustomTransaction.AfterStartTransaction Event
TADCustomTransaction.BeforeCommit Event
TADCustomTransaction.BeforeRollback Event
TADCustomTransaction.BeforeStartTransaction Event
TADCustomTransaction.Connection Property
TADCustomTransaction.DataSetCount Property
TADCustomTransaction.DataSets Property
TADCustomTransaction.Options Property
TADCustomTransaction.TransactionIntf Property
TADCustomTransaction.Commit Method
TADCustomTransaction.CommitRetaining Method
TADCustomTransaction.Rollback Method
TADCustomTransaction.RollbackRetaining Method
TADCustomTransaction.StartTransaction Method
TADCustomUpdateObject Class
TADCustomUpdateObject Members
public
TADCustomUpdateObject.DataSet Property
TADCustomUpdateObject.Apply Method
TADEventAlerter Class
TADEventAlerter Members
published
TADEventAlerter.Active Property
TADEventAlerter.Connection Property
TADEventAlerter.Names Property
TADEventAlerter.OnAlert Event
TADEventAlerter.OnTimeout Event
TADEventAlerter.Options Property
TADLocalSQLDataSet Class
TADLocalSQLDataSet Members
public
TADLocalSQLDataSet.ActualName Property
TADLocalSQLDataSet.Adapter Property
TADLocalSQLDataSet.IsValid Property
published
TADLocalSQLDataSet.DataSet Property
TADLocalSQLDataSet.Name Property
TADLocalSQLDataSet.Temporary Property
TADLocalSQLDataSets Class
TADLocalSQLDataSets Members
public
TADLocalSQLDataSets.Items Property
TADLocalSQLDataSets.Add Method ()
TADLocalSQLDataSets.Add Method (TDataSet, String, IADPhysLocalQueryAdapter)
TADLocalSQLDataSets.Remove Method
TADManager Class
TADManager Members
published
TADManager.Active Property
TADManager.ActiveStoredUsage Property
TADManager.AfterLoadConnectionDefFile Event
TADManager.AfterShutdown Event
TADManager.AfterStartup Event
TADManager.BeforeLoadConnectionDefFile Event
TADManager.BeforeShutdown Event
TADManager.BeforeStartup Event
TADManager.ConnectionDefFileAutoLoad Property
TADManager.ConnectionDefFileName Property
TADManager.DriverDefFileAutoLoad Property
TADManager.DriverDefFileName Property
TADManager.FetchOptions Property
TADManager.FormatOptions Property
TADManager.ResourceOptions Property
TADManager.SilentMode Property
TADManager.UpdateOptions Property
TADManager.WaitCursor Property
TADMemTable Class
TADMemTable Members
published
TADMemTable.ActiveStoredUsage Property
TADMemTable.Adapter Property
TADMemTable.AfterApplyUpdates Event
TADMemTable.AfterExecute Event
TADMemTable.AfterGetRecord Event
TADMemTable.AfterGetRecords Event
TADMemTable.AfterRowRequest Event
TADMemTable.Aggregates Property
TADMemTable.AggregatesActive Property
TADMemTable.BeforeApplyUpdates Event
TADMemTable.BeforeExecute Event
TADMemTable.BeforeGetRecords Event
TADMemTable.BeforeRowRequest Event
TADMemTable.CachedUpdates Property
TADMemTable.Constraints Property
TADMemTable.ConstraintsEnabled Property
TADMemTable.DetailFields Property
TADMemTable.FetchOptions Property
TADMemTable.FilterChanges Property
TADMemTable.FormatOptions Property
TADMemTable.IndexDefs Property
TADMemTable.Indexes Property
TADMemTable.IndexesActive Property
TADMemTable.IndexFieldNames Property
TADMemTable.IndexName Property
TADMemTable.LocalSQL Property
TADMemTable.MasterFields Property
TADMemTable.MasterSource Property
TADMemTable.OnReconcileError Event
TADMemTable.OnUpdateError Event
TADMemTable.OnUpdateRecord Event
TADMemTable.ResourceOptions Property
TADMemTable.UpdateOptions Property
TADMetaInfoCommand Class
TADMetaInfoCommand Members
published
TADMetaInfoCommand.Active Property
TADMetaInfoCommand.AfterClose Event
TADMetaInfoCommand.AfterOpen Event
TADMetaInfoCommand.BaseObjectName Property
TADMetaInfoCommand.BeforeClose Event
TADMetaInfoCommand.BeforeOpen Event
TADMetaInfoCommand.CatalogName Property
TADMetaInfoCommand.Connection Property
TADMetaInfoCommand.ConnectionName Property
TADMetaInfoCommand.FormatOptions Property
TADMetaInfoCommand.MetaInfoKind Property
TADMetaInfoCommand.ObjectName Property
TADMetaInfoCommand.ObjectScopes Property
TADMetaInfoCommand.OnCommandChanged Event
TADMetaInfoCommand.OnError Event
TADMetaInfoCommand.Overload Property
TADMetaInfoCommand.SchemaName Property
TADMetaInfoCommand.TableKinds Property
TADMetaInfoCommand.Wildcard Property
TADMetaInfoQuery Class
TADMetaInfoQuery Members
published
TADMetaInfoQuery.ActiveStoredUsage Property
TADMetaInfoQuery.AfterGetRecord Event
TADMetaInfoQuery.AfterGetRecords Event
TADMetaInfoQuery.AfterRowRequest Event
TADMetaInfoQuery.Aggregates Property
TADMetaInfoQuery.AggregatesActive Property
TADMetaInfoQuery.BaseObjectName Property
TADMetaInfoQuery.BeforeGetRecords Event
TADMetaInfoQuery.BeforeRowRequest Event
TADMetaInfoQuery.CatalogName Property
TADMetaInfoQuery.Connection Property
TADMetaInfoQuery.ConnectionName Property
TADMetaInfoQuery.FetchOptions Property
TADMetaInfoQuery.FormatOptions Property
TADMetaInfoQuery.Indexes Property
TADMetaInfoQuery.IndexesActive Property
TADMetaInfoQuery.IndexFieldNames Property
TADMetaInfoQuery.IndexName Property
TADMetaInfoQuery.LocalSQL Property
TADMetaInfoQuery.MetaInfoKind Property
TADMetaInfoQuery.ObjectName Property
TADMetaInfoQuery.ObjectScopes Property
TADMetaInfoQuery.OnCommandChanged Event
TADMetaInfoQuery.OnError Event
TADMetaInfoQuery.ResourceOptions Property
TADMetaInfoQuery.SchemaAdapter Property
TADMetaInfoQuery.SchemaName Property
TADMetaInfoQuery.TableKinds Property
TADMetaInfoQuery.Transaction Property
TADMetaInfoQuery.UpdateTransaction Property
TADMetaInfoQuery.Wildcard Property
TADQuery Class
TADQuery Members
public
TADQuery.MacroCount Property
TADQuery.RowsAffected Property
published
TADQuery.ActiveStoredUsage Property
TADQuery.AfterApplyUpdates Event
TADQuery.AfterExecute Event
TADQuery.AfterGetRecord Event
TADQuery.AfterGetRecords Event
TADQuery.AfterRowRequest Event
TADQuery.Aggregates Property
TADQuery.AggregatesActive Property
TADQuery.BeforeApplyUpdates Event
TADQuery.BeforeExecute Event
TADQuery.BeforeGetRecords Event
TADQuery.BeforeRowRequest Event
TADQuery.CachedUpdates Property
TADQuery.Connection Property
TADQuery.ConnectionName Property
TADQuery.Constraints Property
TADQuery.ConstraintsEnabled Property
TADQuery.DetailFields Property
TADQuery.FetchOptions Property
TADQuery.FilterChanges Property
TADQuery.FormatOptions Property
TADQuery.Indexes Property
TADQuery.IndexesActive Property
TADQuery.IndexFieldNames Property
TADQuery.IndexName Property
TADQuery.LocalSQL Property
TADQuery.Macros Property
TADQuery.MasterFields Property
TADQuery.MasterSource Property
TADQuery.OnCommandChanged Event
TADQuery.OnError Event
TADQuery.OnExecuteError Event
TADQuery.OnMasterSetValues Event
TADQuery.OnReconcileError Event
TADQuery.OnUpdateError Event
TADQuery.OnUpdateRecord Event
TADQuery.Params Property
TADQuery.ResourceOptions Property
TADQuery.SchemaAdapter Property
TADQuery.SQL Property
TADQuery.Transaction Property
TADQuery.UpdateObject Property
TADQuery.UpdateOptions Property
TADQuery.UpdateTransaction Property
TADRdbmsDataSet Class
TADRdbmsDataSet Members
public
TADRdbmsDataSet.Connection Property
TADRdbmsDataSet.ConnectionName Property
TADRdbmsDataSet.FetchOptions Property
TADRdbmsDataSet.FormatOptions Property
TADRdbmsDataSet.OnCommandChanged Event
TADRdbmsDataSet.OnError Event
TADRdbmsDataSet.Prepared Property
TADRdbmsDataSet.ResourceOptions Property
TADRdbmsDataSet.SchemaAdapter Property
TADRdbmsDataSet.Transaction Property
TADRdbmsDataSet.UpdateOptions Property
TADRdbmsDataSet.UpdateTransaction Property
TADRdbmsDataSet.Disconnect Method
TADRdbmsDataSet.FindMacro Method
TADRdbmsDataSet.MacroByName Method
TADRdbmsDataSet.Open Method (String)
TADRdbmsDataSet.Open Method (String, array of Variant)
TADRdbmsDataSet.Open Method (String, array of Variant, array of TFieldType)
TADRdbmsDataSet.Prepare Method
TADRdbmsDataSet.Unprepare Method
protected
TADRdbmsDataSet.MacroCount Property
TADRdbmsDataSet.Macros Property
TADRdbmsDataSet.ParamBindMode Property
TADRdbmsDataSet.RowsAffected Property
TADSchemaAdapter Class
TADStoredProc Class
TADStoredProc Members
published
TADStoredProc.ActiveStoredUsage Property
TADStoredProc.AfterApplyUpdates Event
TADStoredProc.AfterExecute Event
TADStoredProc.AfterGetRecord Event
TADStoredProc.AfterGetRecords Event
TADStoredProc.AfterRowRequest Event
TADStoredProc.Aggregates Property
TADStoredProc.AggregatesActive Property
TADStoredProc.BeforeApplyUpdates Event
TADStoredProc.BeforeExecute Event
TADStoredProc.BeforeGetRecords Event
TADStoredProc.BeforeRowRequest Event
TADStoredProc.CachedUpdates Property
TADStoredProc.CatalogName Property
TADStoredProc.Connection Property
TADStoredProc.ConnectionName Property
TADStoredProc.Constraints Property
TADStoredProc.ConstraintsEnabled Property
TADStoredProc.DetailFields Property
TADStoredProc.FetchOptions Property
TADStoredProc.FilterChanges Property
TADStoredProc.FormatOptions Property
TADStoredProc.Indexes Property
TADStoredProc.IndexesActive Property
TADStoredProc.IndexFieldNames Property
TADStoredProc.IndexName Property
TADStoredProc.LocalSQL Property
TADStoredProc.MasterFields Property
TADStoredProc.MasterSource Property
TADStoredProc.OnCommandChanged Event
TADStoredProc.OnError Event
TADStoredProc.OnExecuteError Event
TADStoredProc.OnReconcileError Event
TADStoredProc.OnUpdateError Event
TADStoredProc.OnUpdateRecord Event
TADStoredProc.Overload Property
TADStoredProc.PackageName Property
TADStoredProc.ParamBindMode Property
TADStoredProc.Params Property
TADStoredProc.ResourceOptions Property
TADStoredProc.SchemaAdapter Property
TADStoredProc.SchemaName Property
TADStoredProc.StoredProcName Property
TADStoredProc.Transaction Property
TADStoredProc.UpdateObject Property
TADStoredProc.UpdateOptions Property
TADStoredProc.UpdateTransaction Property
TADTable Class
TADTable Members
public
TADTable.Exists Property
TADTable.Disconnect Method
TADTable.Open Method
TADTable.RefireSQL Method
protected
TADTable.GetCustomWhere Method
published
TADTable.ActiveStoredUsage Property
TADTable.AfterApplyUpdates Event
TADTable.AfterGetRecord Event
TADTable.AfterGetRecords Event
TADTable.AfterRowRequest Event
TADTable.Aggregates Property
TADTable.AggregatesActive Property
TADTable.BeforeApplyUpdates Event
TADTable.BeforeGetRecords Event
TADTable.BeforeRowRequest Event
TADTable.CachedUpdates Property
TADTable.CatalogName Property
TADTable.Connection Property
TADTable.ConnectionName Property
TADTable.Constraints Property
TADTable.ConstraintsEnabled Property
TADTable.DetailFields Property
TADTable.FetchOptions Property
TADTable.FilterChanges Property
TADTable.FormatOptions Property
TADTable.IndexFieldNames Property
TADTable.IndexName Property
TADTable.LocalSQL Property
TADTable.MasterFields Property
TADTable.MasterSource Property
TADTable.OnCommandChanged Event
TADTable.OnError Event
TADTable.OnExecuteError Event
TADTable.OnReconcileError Event
TADTable.OnUpdateError Event
TADTable.OnUpdateRecord Event
TADTable.ResourceOptions Property
TADTable.SchemaAdapter Property
TADTable.SchemaName Property
TADTable.TableName Property
TADTable.Transaction Property
TADTable.UpdateObject Property
TADTable.UpdateOptions Property
TADTable.UpdateTransaction Property
TADTransaction Class
TADTransaction Members
published
TADTransaction.AfterCommit Event
TADTransaction.AfterRollback Event
TADTransaction.AfterStartTransaction Event
TADTransaction.BeforeCommit Event
TADTransaction.BeforeRollback Event
TADTransaction.BeforeStartTransaction Event
TADTransaction.Connection Property
TADTransaction.Options Property
TADUpdateSQL Class
TADUpdateSQL Members
public
TADUpdateSQL.Commands Property
TADUpdateSQL.SQL Property
TADUpdateSQL.Apply Method
published
TADUpdateSQL.Connection Property
TADUpdateSQL.ConnectionName Property
TADUpdateSQL.DeleteSQL Property
TADUpdateSQL.FetchRowSQL Property
TADUpdateSQL.InsertSQL Property
TADUpdateSQL.LockSQL Property
TADUpdateSQL.ModifySQL Property
TADUpdateSQL.UnlockSQL Property
Functions
uADCompClient.ADManager Function
uADCompClient.ADSetConnectionClass Function
uADCompClient.ADSetManagerClass Function
uADCompDataSet Namespace
Classes
TADAggregate Class
TADAggregate Members
public
TADAggregate.ActualActive Property
TADAggregate.DataSet Property
TADAggregate.DataType Property
TADAggregate.InUse Property
TADAggregate.Value Property
published
TADAggregate.Active Property
TADAggregate.Expression Property
TADAggregate.GroupingLevel Property
TADAggregate.IndexName Property
TADAggregate.Name Property
TADAggregates Class
TADAggregates Members
public
TADAggregates.Items Property
TADAggregates.Add Method
TADAggregates.AggregateByName Method
TADAggregates.FindAggregate Method
TADAutoIncField Class
TADAutoIncField Members
published
TADAutoIncField.AutoIncrementSeed Property
TADAutoIncField.AutoIncrementStep Property
TADAutoIncField.ClientAutoIncrement Property
TADAutoIncField.GeneratorName Property
TADAutoIncField.IdentityInsert Property
TADAutoIncField.ServerAutoIncrement Property
TADBlobStream Class
TADBlobStream Members
public
TADBlobStream.Create Constructor
TADBlobStream.Truncate Method
TADDataSet Class
TADDataSet Members
public
TADDataSet.ActiveStoredUsage Property
TADDataSet.AfterApplyUpdates Event
TADDataSet.AfterExecute Event
TADDataSet.AfterGetRecord Event
TADDataSet.AfterGetRecords Event
TADDataSet.AfterRowRequest Event
TADDataSet.Aggregates Property
TADDataSet.AggregatesActive Property
TADDataSet.BeforeApplyUpdates Event
TADDataSet.BeforeExecute Event
TADDataSet.BeforeGetRecords Event
TADDataSet.BeforeRowRequest Event
TADDataSet.CachedUpdates Property
TADDataSet.ChangeCount Property
TADDataSet.CloneSource Property
TADDataSet.Constraints Property
TADDataSet.ConstraintsEnabled Property
TADDataSet.Data Property
TADDataSet.DatSManager Property
TADDataSet.Delta Property
TADDataSet.DetailFields Property
TADDataSet.FilterChanges Property
TADDataSet.FilteredData Property
TADDataSet.GroupingLevel Property
TADDataSet.IndexDefs Property
TADDataSet.Indexes Property
TADDataSet.IndexesActive Property
TADDataSet.IndexFieldCount Property
TADDataSet.IndexFieldNames Property
TADDataSet.IndexFields Property
TADDataSet.IndexName Property
TADDataSet.KeyExclusive Property
TADDataSet.KeyFieldCount Property
TADDataSet.MasterFields Property
TADDataSet.MasterLink Property
TADDataSet.MasterSource Property
TADDataSet.OnMasterSetValues Event
TADDataSet.OnReconcileError Event
TADDataSet.OnUpdateError Event
TADDataSet.OnUpdateRecord Event
TADDataSet.ParentDataSet Property
TADDataSet.RowError Property
TADDataSet.SavePoint Property
TADDataSet.SourceEOF Property
TADDataSet.SourceView Property
TADDataSet.Table Property
TADDataSet.UpdatesPending Property
TADDataSet.View Property
TADDataSet.AddIndex Method
TADDataSet.ApplyMaster Method
TADDataSet.ApplyRange Method
TADDataSet.ApplyUpdates Method
TADDataSet.AttachTable Method
TADDataSet.BeginBatch Method
TADDataSet.CancelRange Method
TADDataSet.CancelUpdates Method
TADDataSet.CloneCursor Method
TADDataSet.CommitUpdates Method
TADDataSet.CopyDataSet Method
TADDataSet.CopyRecord Method
TADDataSet.CreateDataSet Method
TADDataSet.CreateExpression Method
TADDataSet.DeleteIndex Method
TADDataSet.DeleteIndexes Method
TADDataSet.DisableConstraints Method
TADDataSet.Disconnect Method
TADDataSet.EditKey Method
TADDataSet.EditRangeEnd Method
TADDataSet.EditRangeStart Method
TADDataSet.EmptyDataSet Method
TADDataSet.EnableConstraints Method
TADDataSet.EndBatch Method
TADDataSet.Execute Method
TADDataSet.FetchAgain Method
TADDataSet.FetchAll Method
TADDataSet.FetchBlobs Method
TADDataSet.FetchDetails Method
TADDataSet.FetchNext Method
TADDataSet.FindKey Method
TADDataSet.FindNearest Method
TADDataSet.FindParam Method
TADDataSet.GetColumnField Method
TADDataSet.GetDetailLinkFields Method
TADDataSet.GetFieldColumn Method
TADDataSet.GetGroupState Method
TADDataSet.GetIndexNames Method
TADDataSet.GetNextPacket Method
TADDataSet.GetParentRow Method
TADDataSet.GetRow Method
TADDataSet.GotoCurrent Method
TADDataSet.GotoKey Method
TADDataSet.GotoNearest Method
TADDataSet.IsIndexed Method
TADDataSet.IsLinked Method
TADDataSet.IsRanged Method
TADDataSet.LoadFromFile Method
TADDataSet.LoadFromFileAtOpen Method
TADDataSet.LoadFromStream Method
TADDataSet.Locate Method
TADDataSet.LocateEx Method (string, TADDataSetLocateOptions, PInteger)
TADDataSet.LocateEx Method (string, Variant, TADDataSetLocateOptions, PInteger)
TADDataSet.Lookup Method
TADDataSet.LookupEx Method (string, Variant, string, TADDataSetLocateOptions, PInteger)
TADDataSet.LookupEx Method (string, string, TADDataSetLocateOptions, PInteger)
TADDataSet.Offline Method
TADDataSet.OpenOrExecute Method
TADDataSet.ParamByName Method
TADDataSet.Reconcile Method
TADDataSet.RefreshRecord Method
TADDataSet.RefreshUnknownRecord Method
TADDataSet.Release Method
TADDataSet.RevertRecord Method
TADDataSet.SaveToFile Method
TADDataSet.SaveToFileAtClose Method
TADDataSet.SaveToStream Method
TADDataSet.SetFieldAttributes Method
TADDataSet.SetKey Method
TADDataSet.SetRange Method
TADDataSet.SetRangeEnd Method
TADDataSet.SetRangeStart Method
TADDataSet.UndoLastChange Method
TADDataSet.UpdateAttributes Method
TADDataSet.UpdateConstraints Method
TADDataSet.UpdateStatus Method
protected
TADDataSet.FetchOptions Property
TADDataSet.FormatOptions Property
TADDataSet.ParamCount Property
TADDataSet.Params Property
TADDataSet.ResourceOptions Property
TADDataSet.UpdateOptions Property
TADDataSet.Updates Property
TADIndex Class
TADIndex Members
public
TADIndex.ActualActive Property
TADIndex.DataSet Property
published
TADIndex.Active Property
TADIndex.CaseInsFields Property
TADIndex.DescFields Property
TADIndex.Distinct Property
TADIndex.Expression Property
TADIndex.Fields Property
TADIndex.Filter Property
TADIndex.FilterOptions Property
TADIndex.Name Property
TADIndex.Options Property
TADIndex.Selected Property
TADIndexes Class
TADIndexes Members
public
TADIndexes.Items Property
TADIndexes.Add Method
TADIndexes.FindIndex Method
TADIndexes.FindIndexForFields Method
TADIndexes.IndexByName Method
TADMasterDataLink Class
TADMasterDataLink Members
public
TADMasterDataLink.ActualDelayedScrollEnabled Property
TADMasterDataLink.DelayedScrollEnabled Property
TADMasterDataLink.CancelSync Method
TADMasterDataLink.DisableDelayedScroll Method
TADMasterDataLink.DisableScroll Method
TADMasterDataLink.EnableDelayedScroll Method
TADMasterDataLink.EnableScroll Method
TADMasterDataLink.Synchronize Method
TADSQLTimeIntervalField Class
TADSQLTimeIntervalField Members
public
TADSQLTimeIntervalField.AsSQLTimeInterval Property
TADSQLTimeIntervalField.IntervalKind Property
TADWideMemoField Class
TADWideMemoField Members
public
TADWideMemoField.Value Property
TADXMLField Class
TADXMLField Members
public
TADXMLField.SchemaName Property
uADCompGUIx Namespace
Classes
TADGUIxAsyncExecuteDialog Class
TADGUIxAsyncExecuteDialog Members
public
TADGUIxAsyncExecuteDialog.AsyncDialog Property
published
TADGUIxAsyncExecuteDialog.Caption Property
TADGUIxAsyncExecuteDialog.HideDelay Property
TADGUIxAsyncExecuteDialog.OnHide Event
TADGUIxAsyncExecuteDialog.OnShow Event
TADGUIxAsyncExecuteDialog.Prompt Property
TADGUIxAsyncExecuteDialog.ShowDelay Property
TADGUIxComponent Class
TADGUIxComponent Members
published
TADGUIxComponent.Provider Property
TADGUIxErrorDialog Class
TADGUIxErrorDialog Members
public
TADGUIxErrorDialog.ErrorDialog Property
TADGUIxErrorDialog.Execute Method
published
TADGUIxErrorDialog.Caption Property
TADGUIxErrorDialog.Enabled Property
TADGUIxErrorDialog.OnHide Property
TADGUIxErrorDialog.OnShow Property
TADGUIxErrorDialog.StayOnTop Property
TADGUIxLoginDialog Class
TADGUIxLoginDialog Members
public
TADGUIxLoginDialog.ConnectionDef Property
TADGUIxLoginDialog.LoginDialog Property
TADGUIxLoginDialog.Execute Method
TADGUIxLoginDialog.GetAllLoginParams Method
published
TADGUIxLoginDialog.Caption Property
TADGUIxLoginDialog.ChangeExpiredPassword Property
TADGUIxLoginDialog.HistoryEnabled Property
TADGUIxLoginDialog.HistoryKey Property
TADGUIxLoginDialog.HistoryStorage Property
TADGUIxLoginDialog.HistoryWithPassword Property
TADGUIxLoginDialog.LoginRetries Property
TADGUIxLoginDialog.OnChangePassword Property
TADGUIxLoginDialog.OnHide Event
TADGUIxLoginDialog.OnLogin Property
TADGUIxLoginDialog.OnShow Event
TADGUIxLoginDialog.VisibleItems Property
TADGUIxScriptDialog Class
TADGUIxScriptDialog Members
public
TADGUIxScriptDialog.ScriptDialog Property
published
TADGUIxScriptDialog.Caption Property
TADGUIxScriptDialog.OnHide Event
TADGUIxScriptDialog.OnInput Property
TADGUIxScriptDialog.OnOutput Property
TADGUIxScriptDialog.OnPause Property
TADGUIxScriptDialog.OnProgress Property
TADGUIxScriptDialog.OnShow Event
TADGUIxScriptDialog.Options Property
TADGUIxWaitCursor Class
TADGUIxWaitCursor Members
public
TADGUIxWaitCursor.WaitCursor Property
published
TADGUIxWaitCursor.OnHide Event
TADGUIxWaitCursor.OnShow Event
TADGUIxWaitCursor.ScreenCursor Property
uADCompScript Namespace
Classes
TADScript Class
TADScript Members
public
TADScript.AllSpools Property
TADScript.CallStack Property
TADScript.CurrentCommand Property
TADScript.EOF Property
TADScript.Finished Property
TADScript.LastSpoolFileName Property
TADScript.Position Property
TADScript.ProcessedAfterCommit Property
TADScript.Status Property
TADScript.TotalErrors Property
TADScript.TotalJobDone Property
TADScript.TotalJobSize Property
TADScript.TotalPct10Done Property
TADScript.AbortJob Method
TADScript.ExecuteAll Method
TADScript.ExecuteFile Method (String)
TADScript.ExecuteFile Method (String, array of String)
TADScript.ExecuteScript Method (TStrings)
TADScript.ExecuteScript Method (TStrings, array of String)
TADScript.ExecuteStep Method
TADScript.ValidateAll Method
TADScript.ValidateStep Method
published
TADScript.AfterExecute Event
TADScript.AfterScript Event
TADScript.Arguments Property
TADScript.BeforeExecute Event
TADScript.BeforeScript Event
TADScript.Connection Property
TADScript.FetchOptions Property
TADScript.FormatOptions Property
TADScript.Macros Property
TADScript.OnConsoleGet Event
TADScript.OnConsoleLockUpdate Event
TADScript.OnConsolePut Event
TADScript.OnError Event
TADScript.OnGetText Event
TADScript.OnHostCommand Event
TADScript.OnPause Event
TADScript.OnProgress Event
TADScript.OnReleaseText Event
TADScript.OnSpoolPut Event
TADScript.Params Property
TADScript.ResourceOptions Property
TADScript.ScriptDialog Property
TADScript.ScriptOptions Property
TADScript.SQLScriptFileName Property
TADScript.SQLScripts Property
TADScript.Transaction Property
TADScriptCommand Class
TADScriptCommand Members
public
TADScriptCommand.Engine Property
TADScriptCommand.EngineIntf Property
TADScriptCommand.Parser Property
TADScriptCommand.Position Property
TADScriptCommand.AbortJob Method
TADScriptCommand.Execute Method
TADScriptCommand.Help Method
TADScriptCommand.Keywords Method
TADScriptCommand.Parse Method
TADScriptCommand.Validate Method
TADScriptCommandRegistry Class
TADScriptCommandRegistry Members
public
TADScriptCommandRegistry.Commands Property
TADScriptCommandRegistry.Count Property
TADScriptCommandRegistry.AddCommand Method
TADScriptCommandRegistry.LookupCommand Method
TADScriptOptions Class
TADScriptOptions Members
published
TADScriptOptions.AutoPrintParams Property
TADScriptOptions.BreakOnError Property
TADScriptOptions.CharacterSet Property
TADScriptOptions.ClientLib Property
TADScriptOptions.ColumnHeadings Property
TADScriptOptions.CommandSeparator Property
TADScriptOptions.CommitEachNCommands Property
TADScriptOptions.ConsoleOutput Property
TADScriptOptions.DefaultDataPath Property
TADScriptOptions.DefaultScriptPath Property
TADScriptOptions.DriverID Property
TADScriptOptions.DropNonexistObj Property
TADScriptOptions.EchoCommands Property
TADScriptOptions.EchoCommandTrim Property
TADScriptOptions.FeedbackCommands Property
TADScriptOptions.FeedbackScript Property
TADScriptOptions.FileEncoding Property
TADScriptOptions.FileEndOfLine Property
TADScriptOptions.IgnoreError Property
TADScriptOptions.LineSize Property
TADScriptOptions.MacroExpand Property
TADScriptOptions.MaxStringWidth Property
TADScriptOptions.PageSize Property
TADScriptOptions.ParamArraySize Property
TADScriptOptions.RaisePLSQLErrors Property
TADScriptOptions.SpoolFileName Property
TADScriptOptions.SpoolOutput Property
TADScriptOptions.SQLDialect Property
TADScriptOptions.Timing Property
TADScriptOptions.TrimConsole Property
TADScriptOptions.TrimSpool Property
TADScriptOptions.Verify Property
TADScriptOptions.Assign Method
TADScriptOptions.Reset Method
TADSQLScript Class
TADSQLScript Members
published
TADSQLScript.Name Property
TADSQLScript.SQL Property
TADSQLScripts Class
TADSQLScripts Members
public
TADSQLScripts.Items Property
TADSQLScripts.Add Method
TADSQLScripts.FindScript Method
uADMoniRemoteClient Namespace
Classes
TADMoniRemoteClientLink Class
TADMoniRemoteClientLink Members
published
TADMoniRemoteClientLink.Host Property
TADMoniRemoteClientLink.Port Property
TADMoniRemoteClientLink.Timeout Property
TADMoniRemoteClientLink.Tracing Property
uADPhysADS Namespace
Classes
TADADSBackup Class
TADADSBackup Members
public
TADADSBackup.Backup Method
published
TADADSBackup.BackupPath Property
TADADSBackup.Options Property
TADADSBackupRestore Class
TADADSBackupRestore Members
public
TADADSBackupRestore.Results Property
published
TADADSBackupRestore.Exclude Property
TADADSBackupRestore.Include Property
TADADSBackupRestore.TableTypeMap Property
TADADSRestore Class
TADADSRestore Members
public
TADADSRestore.Restore Method
published
TADADSRestore.DDPassword Property
TADADSRestore.DestinationPath Property
TADADSRestore.Options Property
TADADSRestore.SourcePassword Property
TADADSRestore.SourcePath Property
TADADSService Class
TADADSService Members
published
TADADSService.Database Property
TADADSService.DriverLink Property
TADADSService.Password Property
TADADSService.UserName Property
TADADSUtility Class
TADADSUtility Members
public
TADADSUtility.Decrypt Method
TADADSUtility.Encrypt Method
TADADSUtility.Pack Method
TADADSUtility.Recall Method
TADADSUtility.Reindex Method
TADADSUtility.Zap Method
published
TADADSUtility.OnProgress Event
TADADSUtility.TablePassword Property
TADADSUtility.Tables Property
TADADSUtility.TableType Property
TADPhysADSDriverLink Class
TADPhysADSDriverLink Members
published
TADPhysADSDriverLink.DateFormat Property
TADPhysADSDriverLink.Decimals Property
TADPhysADSDriverLink.DefaultPath Property
TADPhysADSDriverLink.Epoch Property
TADPhysADSDriverLink.Exact Property
TADPhysADSDriverLink.SearchPath Property
TADPhysADSDriverLink.ShowDeleted Property
uADPhysASA Namespace
Classes
TADASABackup Class
TADASABackup Members
public
TADASABackup.Backup Method
published
TADASABackup.CheckpointLogType Property
TADASABackup.ConnectParams Property
TADASABackup.Flags Property
TADASABackup.HotlogFilename Property
TADASABackup.OutputDir Property
TADASABackup.PageBlocksize Property
TADASABackup.StartLine Property
TADASAService Class
TADASAService Members
public
TADASAService.ToolLib Property
published
TADASAService.DriverLink Property
TADASAService.OnProgress Property
TADASAValidate Class
TADASAValidate Members
public
TADASAValidate.Validate Method
published
TADASAValidate.ConnectParams Property
TADASAValidate.Flags Property
TADASAValidate.StartLine Property
TADASAValidate.Tables Property
TADASAValidate.ValidateType Property
TADPhysASADriverLink Class
TADPhysASADriverLink Members
published
TADPhysASADriverLink.ToolLib Property
uADPhysDataSnap Namespace
Classes
TADPhysDataSnapDriverLink Class
uADPhysDB2 Namespace
Classes
EDB2NativeException Class
TADPhysDB2DriverLink Class
uADPhysDBExp Namespace
Classes
TADPhysDBXDriverLink Class
uADPhysIB Namespace
Classes
TADIBBackup Class
TADIBBackup Members
public
TADIBBackup.Backup Method
published
TADIBBackup.BackupFiles Property
TADIBBackup.Database Property
TADIBBackup.Options Property
TADIBBackup.Verbose Property
TADIBNBackup Class
TADIBNBackup Members
public
TADIBNBackup.Backup Method
published
TADIBNBackup.BackupFile Property
TADIBNBackup.Database Property
TADIBNBackup.Level Property
TADIBNBackup.Options Property
TADIBNRestore Class
TADIBNRestore Members
public
TADIBNRestore.Restore Method
published
TADIBNRestore.BackupFiles Property
TADIBNRestore.Database Property
TADIBNRestore.Options Property
TADIBRestore Class
TADIBRestore Members
public
TADIBRestore.Restore Method
published
TADIBRestore.BackupFiles Property
TADIBRestore.Database Property
TADIBRestore.Options Property
TADIBRestore.PageSize Property
TADIBRestore.Verbose Property
TADIBSecurity Class
TADIBSecurity Members
public
TADIBSecurity.Users Property
TADIBSecurity.AddUser Method
TADIBSecurity.DeleteUser Method
TADIBSecurity.DisplayUser Method
TADIBSecurity.DisplayUsers Method
TADIBSecurity.ModifyUser Method
published
TADIBSecurity.AFirstName Property
TADIBSecurity.AGroupID Property
TADIBSecurity.AGroupName Property
TADIBSecurity.ALastName Property
TADIBSecurity.AMiddleName Property
TADIBSecurity.APassword Property
TADIBSecurity.ARoleName Property
TADIBSecurity.AUserID Property
TADIBSecurity.AUserName Property
TADIBSecurity.Modified Property
TADIBService Class
TADIBService Members
published
TADIBService.DriverLink Property
TADIBService.Host Property
TADIBService.OnProgress Event
TADIBService.Password Property
TADIBService.Protocol Property
TADIBService.QueryTimeout Property
TADIBService.SqlRoleName Property
TADIBService.UserName Property
TADIBTrace Class
TADIBTrace Members
public
TADIBTrace.List Method
TADIBTrace.Resume Method
TADIBTrace.Start Method
TADIBTrace.Stop Method
TADIBTrace.Suspend Method
published
TADIBTrace.Config Property
TADIBTrace.SessionID Property
TADIBTrace.SessionName Property
TADIBValidate Class
TADIBValidate Members
public
TADIBValidate.Analyze Method
TADIBValidate.CheckOnly Method
TADIBValidate.Repair Method
TADIBValidate.Sweep Method
published
TADIBValidate.Database Property
TADIBValidate.Options Property
TADPhysIBDriverLink Class
uADPhysManager Namespace
Classes
TADPhysDriverLink Class
TADPhysDriverLink Members
public
TADPhysDriverLink.ActualDriverID Property
TADPhysDriverLink.DriverIntf Property
TADPhysDriverLink.DriverState Property
TADPhysDriverLink.Services Property
TADPhysDriverLink.ServicesCount Property
TADPhysDriverLink.Release Method
published
TADPhysDriverLink.BaseDriverID Property
TADPhysDriverLink.DriverID Property
TADPhysDriverLink.OnDriverCreated Event
TADPhysDriverLink.OnDriverDestroying Event
TADPhysDriverLink.VendorHome Property
TADPhysDriverLink.VendorLib Property
TADPhysDriverService Class
TADPhysDriverService Members
public
TADPhysDriverService.CliObj Property
published
TADPhysDriverService.AfterExecute Event
TADPhysDriverService.BeforeExecute Event
TADPhysDriverService.OnError Event
uADPhysMSAcc Namespace
Classes
EMSAccessNativeException Class
TADMSAccessService Class
TADMSAccessService Members
public
TADMSAccessService.Compact Method
TADMSAccessService.CreateDB Method
TADMSAccessService.Drop Method
TADMSAccessService.Repair Method
published
TADMSAccessService.Database Property
TADMSAccessService.DBVersion Property
TADMSAccessService.DestDatabase Property
TADMSAccessService.DriverLink Property
TADMSAccessService.Encrypted Property
TADMSAccessService.Password Property
TADMSAccessService.ResetPassword Property
TADMSAccessService.SortOrder Property
TADPhysMSAccessDriverLink Class
uADPhysMSSQL Namespace
Classes
EMSSQLNativeException Class
EMSSQLNativeException Members
public
EMSSQLNativeException.Errors Property
TADMSSQLError Class
TADPhysMSSQLDriverLink Class
uADPhysMySQL Namespace
Classes
TADPhysMySQLDriverLink Class
TADPhysMySQLDriverLink Members
published
TADPhysMySQLDriverLink.EmbeddedArgs Property
TADPhysMySQLDriverLink.EmbeddedGroups Property
uADPhysODBC Namespace
Classes
TADPhysODBCDriverLink Class
uADPhysODBCBase Namespace
Classes
TADPhysODBCBaseDriverLink Class
TADPhysODBCBaseDriverLink Members
public
TADPhysODBCBaseDriverLink.GetDrivers Method
TADPhysODBCBaseDriverLink.GetDSNs Method
published
TADPhysODBCBaseDriverLink.ODBCAdvanced Property
TADPhysODBCBaseDriverLink.ODBCDriver Property
TADPhysODBCBaseService Class
uADPhysOracle Namespace
Classes
TADPhysOracleDriverLink Class
TADPhysOracleDriverLink Members
public
TADPhysOracleDriverLink.GetOracleHomes Method
TADPhysOracleDriverLink.GetTNSServices Method
published
TADPhysOracleDriverLink.NLSLang Property
TADPhysOracleDriverLink.Threaded Property
TADPhysOracleDriverLink.TNSAdmin Property
uADPhysPG Namespace
Classes
TADPhysPgDriverLink Class
uADPhysSQLite Namespace
Classes
TADPhysSQLiteDriverLink Class
TADSQLiteBackup Class
TADSQLiteBackup Members
public
TADSQLiteBackup.DatabaseObj Property
TADSQLiteBackup.DestDatabaseObj Property
TADSQLiteBackup.PageCount Property
TADSQLiteBackup.Remaining Property
TADSQLiteBackup.Backup Method
published
TADSQLiteBackup.BusyTimeout Property
TADSQLiteBackup.Catalog Property
TADSQLiteBackup.Database Property
TADSQLiteBackup.DestCatalog Property
TADSQLiteBackup.DestDatabase Property
TADSQLiteBackup.DestMode Property
TADSQLiteBackup.DestPassword Property
TADSQLiteBackup.OnProgress Event
TADSQLiteBackup.PagesPerStep Property
TADSQLiteBackup.Password Property
TADSQLiteBackup.WaitForLocks Property
TADSQLiteCollation Class
TADSQLiteCollation Members
published
TADSQLiteCollation.Active Property
TADSQLiteCollation.CollationKind Property
TADSQLiteCollation.CollationName Property
TADSQLiteCollation.Flags Property
TADSQLiteCollation.Locale Property
TADSQLiteCollation.OnCompare Property
TADSQLiteFunction Class
TADSQLiteFunction Members
published
TADSQLiteFunction.Active Property
TADSQLiteFunction.Aggregated Property
TADSQLiteFunction.ArgumentsCount Property
TADSQLiteFunction.FunctionName Property
TADSQLiteFunction.OnCalculate Property
TADSQLiteRTree Class
TADSQLiteRTree Members
published
TADSQLiteRTree.Active Property
TADSQLiteRTree.OnCalculate Property
TADSQLiteRTree.RTreeName Property
TADSQLiteSecurity Class
TADSQLiteSecurity Members
public
TADSQLiteSecurity.ChangePassword Method
TADSQLiteSecurity.CheckEncryption Method
TADSQLiteSecurity.RemovePassword Method
TADSQLiteSecurity.SetPassword Method
published
TADSQLiteSecurity.Database Property
TADSQLiteSecurity.Options Property
TADSQLiteSecurity.Password Property
TADSQLiteSecurity.ToPassword Property
TADSQLiteService Class
TADSQLiteService Members
published
TADSQLiteService.DriverLink Property
TADSQLiteValidate Class
TADSQLiteValidate Members
public
TADSQLiteValidate.Analyze Method
TADSQLiteValidate.CheckOnly Method
TADSQLiteValidate.Sweep Method
published
TADSQLiteValidate.Database Property
TADSQLiteValidate.MaxErrors Property
TADSQLiteValidate.OnProgress Event
TADSQLiteValidate.Options Property
TADSQLiteValidate.Password Property
uADPhysSQLiteVDataSet Namespace
Classes
TADLocalSQL Class
TADLocalSQL Members
published
TADLocalSQL.Active Property
TADLocalSQL.Connection Property
TADLocalSQL.DataSets Property
TADLocalSQL.DisableControls Property
TADLocalSQL.IncludeHiddenFields Property
TADLocalSQL.MultipleCursors Property
TADLocalSQL.OnGetDataSet Event
TADLocalSQL.OnReadDataSet Event
TADLocalSQL.SchemaName Property
uADPhysTDBX Namespace
Classes
TADPhysTDBXDriverLink Class
uADPhysTDBXBase Namespace
Classes
ETDBXNativeException Class
uADStanError Namespace
Classes
EADDBArrayExecuteError Class
EADDBArrayExecuteError Members
public
EADDBArrayExecuteError.Action Property
EADDBArrayExecuteError.Exception Property
EADDBArrayExecuteError.Offset Property
EADDBArrayExecuteError.RetryLevel Property
EADDBArrayExecuteError.Times Property
EADDBEngineException Class
EADDBEngineException Members
public
EADDBEngineException.ErrorCode Property
EADDBEngineException.ErrorCount Property
EADDBEngineException.Errors Property
EADDBEngineException.Kind Property
EADDBEngineException.Params Property
EADDBEngineException.SQL Property
EADException Class
EADException Members
public
EADException.ADCode Property
EADException.ADObjName Property
TADDBError Class
TADDBError Members
public
TADDBError.CommandTextOffset Property
TADDBError.ErrorCode Property
TADDBError.Kind Property
TADDBError.Level Property
TADDBError.Message Property
TADDBError.ObjName Property
TADDBError.RowIndex Property
uADStanOption Namespace
Classes
TADBottomResourceOptions Class
TADBottomResourceOptions Members
public
TADBottomResourceOptions.Assign Method
TADBottomResourceOptions.ResolveFileName Method
TADBottomResourceOptions.RestoreDefaults Method
published
TADBottomResourceOptions.PersistentFileName Property
TADBottomUpdateOptions Class
TADBottomUpdateOptions Members
public
TADBottomUpdateOptions.Assign Method
TADBottomUpdateOptions.RestoreDefaults Method
published
TADBottomUpdateOptions.AutoIncFields Property
TADBottomUpdateOptions.KeyFields Property
TADBottomUpdateOptions.UpdateTableName Property
TADCustomOptions Class
TADCustomOptions Members
public
TADCustomOptions.Version Property
TADCustomOptions.Assign Method
TADCustomOptions.RestoreDefaults Method
TADEventAlerterOptions Class
TADEventAlerterOptions Members
published
TADEventAlerterOptions.AutoRegister Property
TADEventAlerterOptions.Kind Property
TADEventAlerterOptions.Synchronize Property
TADEventAlerterOptions.Timeout Property
TADFetchOptions Class
TADFetchOptions Members
public
TADFetchOptions.ActualRowsetSize Property
TADFetchOptions.Assign Method
TADFetchOptions.RestoreDefaults Method
published
TADFetchOptions.AssignedValues Property
TADFetchOptions.AutoClose Property
TADFetchOptions.AutoFetchAll Property
TADFetchOptions.Cache Property
TADFetchOptions.CursorKind Property
TADFetchOptions.DetailCascade Property
TADFetchOptions.DetailDelay Property
TADFetchOptions.DetailOptimize Property
TADFetchOptions.Items Property
TADFetchOptions.LiveWindowFastFirst Property
TADFetchOptions.LiveWindowParanoic Property
TADFetchOptions.Mode Property
TADFetchOptions.RecordCountMode Property
TADFetchOptions.RecsMax Property
TADFetchOptions.RecsSkip Property
TADFetchOptions.RowsetSize Property
TADFetchOptions.Unidirectional Property
TADFormatOptions Class
TADFormatOptions Members
public
TADFormatOptions.StrsDivLen2 Property
TADFormatOptions.Assign Method
TADFormatOptions.RestoreDefaults Method
published
TADFormatOptions.AssignedValues Property
TADFormatOptions.DataSnapCompatibility Property
TADFormatOptions.DefaultParamDataType Property
TADFormatOptions.FmtDisplayDate Property
TADFormatOptions.FmtDisplayDateTime Property
TADFormatOptions.FmtDisplayNumeric Property
TADFormatOptions.FmtDisplayTime Property
TADFormatOptions.FmtEditNumeric Property
TADFormatOptions.InlineDataSize Property
TADFormatOptions.MapRules Property
TADFormatOptions.MaxBcdPrecision Property
TADFormatOptions.MaxBcdScale Property
TADFormatOptions.MaxStringSize Property
TADFormatOptions.OwnMapRules Property
TADFormatOptions.QuoteIdentifiers Property
TADFormatOptions.Round2Scale Property
TADFormatOptions.SortLocale Property
TADFormatOptions.SortOptions Property
TADFormatOptions.StrsEmpty2Null Property
TADFormatOptions.StrsTrim Property
TADFormatOptions.StrsTrim2Len Property
TADMapRule Class
TADMapRule Members
published
TADMapRule.NameMask Property
TADMapRule.PrecMax Property
TADMapRule.PrecMin Property
TADMapRule.ScaleMax Property
TADMapRule.ScaleMin Property
TADMapRule.SizeMax Property
TADMapRule.SizeMin Property
TADMapRule.SourceDataType Property
TADMapRule.TargetDataType Property
TADMapRules Class
TADMapRules Members
public
TADMapRules.Items Property
TADMapRules.Add Method
TADResourceOptions Class
TADResourceOptions Members
public
TADResourceOptions.ActualSilentMode Property
TADResourceOptions.BackupExt Property
TADResourceOptions.BackupFolder Property
TADResourceOptions.DefaultStoreExt Property
TADResourceOptions.DefaultStoreFolder Property
TADResourceOptions.DefaultStoreFormat Property
TADResourceOptions.PreprocessCmdText Property
TADResourceOptions.Assign Method
TADResourceOptions.RestoreDefaults Method
published
TADResourceOptions.ArrayDMLSize Property
TADResourceOptions.AssignedValues Property
TADResourceOptions.Backup Property
TADResourceOptions.CmdExecMode Property
TADResourceOptions.CmdExecTimeout Property
TADResourceOptions.DefaultParamType Property
TADResourceOptions.DirectExecute Property
TADResourceOptions.EscapeExpand Property
TADResourceOptions.MacroCreate Property
TADResourceOptions.MacroExpand Property
TADResourceOptions.ParamCreate Property
TADResourceOptions.ParamExpand Property
TADResourceOptions.Persistent Property
TADResourceOptions.SilentMode Property
TADResourceOptions.StoreItems Property
TADResourceOptions.StoreVersion Property
TADResourceOptions.UnifyParams Property
TADTopResourceOptions Class
TADTopResourceOptions Members
public
TADTopResourceOptions.Assign Method
TADTopResourceOptions.RestoreDefaults Method
published
TADTopResourceOptions.AutoConnect Property
TADTopResourceOptions.AutoReconnect Property
TADTopResourceOptions.BackupExt Property
TADTopResourceOptions.BackupFolder Property
TADTopResourceOptions.DefaultStoreExt Property
TADTopResourceOptions.DefaultStoreFolder Property
TADTopResourceOptions.DefaultStoreFormat Property
TADTopResourceOptions.KeepConnection Property
TADTopResourceOptions.MaxCursors Property
TADTopResourceOptions.ServerOutput Property
TADTopResourceOptions.ServerOutputSize Property
TADTxOptions Class
TADTxOptions Members
public
TADTxOptions.Changed Property
TADTxOptions.ClearChanged Method
published
TADTxOptions.AutoCommit Property
TADTxOptions.AutoStart Property
TADTxOptions.AutoStop Property
TADTxOptions.DisconnectAction Property
TADTxOptions.EnableNested Property
TADTxOptions.Isolation Property
TADTxOptions.Params Property
TADTxOptions.ReadOnly Property
TADTxOptions.StopOptions Property
TADUpdateOptions Class
TADUpdateOptions Members
public
TADUpdateOptions.Assign Method
TADUpdateOptions.RestoreDefaults Method
published
TADUpdateOptions.AssignedValues Property
TADUpdateOptions.CheckReadOnly Property
TADUpdateOptions.CheckRequired Property
TADUpdateOptions.CheckUpdatable Property
TADUpdateOptions.CountUpdatedRecords Property
TADUpdateOptions.EnableDelete Property
TADUpdateOptions.EnableInsert Property
TADUpdateOptions.EnableUpdate Property
TADUpdateOptions.FastUpdates Property
TADUpdateOptions.FetchGeneratorsPoint Property
TADUpdateOptions.GeneratorName Property
TADUpdateOptions.LockMode Property
TADUpdateOptions.LockPoint Property
TADUpdateOptions.LockWait Property
TADUpdateOptions.ReadOnly Property
TADUpdateOptions.RefreshDelete Property
TADUpdateOptions.RefreshMode Property
TADUpdateOptions.RequestLive Property
TADUpdateOptions.UpdateChangedFields Property
TADUpdateOptions.UpdateMode Property
TADUpdateOptions.UpdateNonBaseFields Property
Structs, Records, Enums
uADStanOption.TADActionRequest Enumeration
uADStanOption.TADAutoFetchAll Enumeration


Index

Index
FireDAC Index
A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | Q | R | S | T | U | V | W | X
A
ADAdministrator
ADDFMChanger
Additional migration hints
ADExecutor
ADExplorer
ADMonitor
Architecture
Array DML
Asynchronous Execution
Auto-Incremental Fields
B
BDE aliases migration
BDE application migration
BDE name counterparts
Browsing Table
C
Caching Updates
Calculated and Aggregated Fields
Changing DataSet Data
Character macro functions
Class Hierarchy
Command Batches
Common connection parameters
Compile (tool name).bat
Components
Configuring Drivers
Connect to Advantage Database Server
Connect to Blackfish SQL Server
Connect to DataSnap server
Connect to dbExpress data source
Connect to IBM DB2 Server
Connect to Interbase or Firebird
Connect to Microsoft Access database
Connect to Microsoft SQL Server
Connect to Microsoft SQL Server Compact Edition
Connect to MySQL Server
Connect to ODBC data source
Connect to Oracle Server
Connect to PostgreSQL
Connect to SQLite database
Connect to Sybase SQL Anywhere
Convert macro function
Create (DB name).bat
Creating Reports with FastReport
D
Data Type Mapping
Database Alerts
Database Connectivity
Databases
Date and time macro functions
DBMS Environment Reports
Debugging
Debugging and Reporting Environment Questions
Defining Connection
Delpoying on Mac OS X or Linux
Delpoying on Windows
Demo Applications
Demo Databases
Deploying
Developing Custom Commands
DLL Development
E
EADDBArrayExecuteError class
Action
Exception
Offset
RetryLevel
Times
EADDBArrayExecuteError.Action property
EADDBArrayExecuteError.Exception property
EADDBArrayExecuteError.Offset property
EADDBArrayExecuteError.RetryLevel property
EADDBArrayExecuteError.Times property
EADDBEngineException class
ErrorCode
ErrorCount
Errors
Kind
Params
SQL
EADDBEngineException.ErrorCode property
EADDBEngineException.ErrorCount property
EADDBEngineException.Errors property
EADDBEngineException.Kind property
EADDBEngineException.Params property
EADDBEngineException.SQL property
EADException class
ADCode
ADObjName
EADException.ADCode property
EADException.ADObjName property
EDB2NativeException class
Editing Questions
Editing the Data
EMSAccessNativeException class
EMSSQLNativeException class
Errors
EMSSQLNativeException.Errors property
Establishing Connection
ETDBXNativeException class
Executing Command
Executing SQL Scripts
Executing Stored Procedure
Extended Metadata
F
FAQ
Fetching and Populating Questions
Fetching Rows
Filtering Records
Finding a Record
Firebird and Interbase Servers Questions
FireDAC
First Steps to use FireDAC
G
General
General Questions
Getting Started
GUI Questions
H
Handling Errors
I
Installation
Installing FireDAC
Installing on Linux
Installing on Windows
Integration with 3d Party Products Questions
K
Known Limitations
L
Lazarus / FPC
Local SQL
M
Managing Transactions
Master-Detail Relationship
Metadata Questions
Metadata Structure
Migrating BDE applications
MS Access Questions
MS SQL Server Questions
Multi Threading
MySQL Server Questions
N
Numeric macro functions
O
Object Names
Offlining Connection
Oracle Server Questions
Overriding Posting Updates
Overview
P
Preprocessing Command Text
Programming Tools
Q
Querying Metadata
R
Recovering Connection
RETURNING unified support
S
Setting Options
Setting up Connections
Sorting Records
Sorting, Searching, Locating, Filtering Questions
Specifying Default Values
SQL Script Control Commands
SQL Scripts Questions
SQLite Database Questions
System macro functions
T
TADAdaptedDataSet class
AbortJob
Adapter
AttachTable
Command
DatSManager
Disconnect
GetResults
LocalSQL
NextRecordSet
OnError
OnExecuteError
PointedConnection
ServerAppend
ServerCancel
ServerDelete
ServerDeleteAll
ServerEdit
ServerEditRequest
ServerGotoKey
ServerPerform
ServerSetKey
UpdateObject
TADAdaptedDataSet.AbortJob method
TADAdaptedDataSet.Adapter property
TADAdaptedDataSet.AttachTable method
TADAdaptedDataSet.Command property
TADAdaptedDataSet.DatSManager property
TADAdaptedDataSet.Disconnect method
TADAdaptedDataSet.GetResults method
TADAdaptedDataSet.LocalSQL property
TADAdaptedDataSet.NextRecordSet method
TADAdaptedDataSet.OnError event
TADAdaptedDataSet.OnExecuteError event
TADAdaptedDataSet.PointedConnection property
TADAdaptedDataSet.ServerAppend method
TADAdaptedDataSet.ServerCancel method
TADAdaptedDataSet.ServerDelete method
TADAdaptedDataSet.ServerDeleteAll method
TADAdaptedDataSet.ServerEdit method
TADAdaptedDataSet.ServerEditRequest property
TADAdaptedDataSet.ServerGotoKey method
TADAdaptedDataSet.ServerPerform method
TADAdaptedDataSet.ServerSetKey method
TADAdaptedDataSet.UpdateObject property
TADADSBackup class
Backup
BackupPath
Options
TADADSBackup.Backup method
TADADSBackup.BackupPath property
TADADSBackup.Options property
TADADSBackupRestore class
Exclude
Include
Results
TableTypeMap
TADADSBackupRestore.Exclude property
TADADSBackupRestore.Include property
TADADSBackupRestore.Results property
TADADSBackupRestore.TableTypeMap property
TADADSRestore class
DDPassword
DestinationPath
Options
Restore
SourcePassword
SourcePath
TADADSRestore.DDPassword property
TADADSRestore.DestinationPath property
TADADSRestore.Options property
TADADSRestore.Restore method
TADADSRestore.SourcePassword property
TADADSRestore.SourcePath property
TADADSService class
Database
DriverLink
Password
UserName
TADADSService.Database property
TADADSService.DriverLink property
TADADSService.Password property
TADADSService.UserName property
TADADSUtility class
Decrypt
Encrypt
OnProgress
Pack
Recall
Reindex
TablePassword
Tables
TableType
Zap
TADADSUtility.Decrypt method
TADADSUtility.Encrypt method
TADADSUtility.OnProgress event
TADADSUtility.Pack method
TADADSUtility.Recall method
TADADSUtility.Reindex method
TADADSUtility.TablePassword property
TADADSUtility.Tables property
TADADSUtility.TableType property
TADADSUtility.Zap method
TADAggregate class
Active
ActualActive
DataSet
DataType
Expression
GroupingLevel
IndexName
InUse
Name
Value
TADAggregate.Active property
TADAggregate.ActualActive property
TADAggregate.DataSet property
TADAggregate.DataType property
TADAggregate.Expression property
TADAggregate.GroupingLevel property
TADAggregate.IndexName property
TADAggregate.InUse property
TADAggregate.Name property
TADAggregate.Value property
TADAggregates class
Add
AggregateByName
FindAggregate
Items
TADAggregates.Add method
TADAggregates.AggregateByName method
TADAggregates.FindAggregate method
TADAggregates.Items property
TADASABackup class
Backup
CheckpointLogType
ConnectParams
Flags
HotlogFilename
OutputDir
PageBlocksize
StartLine
TADASABackup.Backup method
TADASABackup.CheckpointLogType property
TADASABackup.ConnectParams property
TADASABackup.Flags property
TADASABackup.HotlogFilename property
TADASABackup.OutputDir property
TADASABackup.PageBlocksize property
TADASABackup.StartLine property
TADASAService class
DriverLink
OnProgress
ToolLib
TADASAService.DriverLink property
TADASAService.OnProgress property
TADASAService.ToolLib property
TADASAValidate class
ConnectParams
Flags
StartLine
Tables
Validate
ValidateType
TADASAValidate.ConnectParams property
TADASAValidate.Flags property
TADASAValidate.StartLine property
TADASAValidate.Tables property
TADASAValidate.Validate method
TADASAValidate.ValidateType property
TADAutoIncField class
AutoIncrementSeed
AutoIncrementStep
ClientAutoIncrement
GeneratorName
IdentityInsert
ServerAutoIncrement
TADAutoIncField.AutoIncrementSeed property
TADAutoIncField.AutoIncrementStep property
TADAutoIncField.ClientAutoIncrement property
TADAutoIncField.GeneratorName property
TADAutoIncField.IdentityInsert property
TADAutoIncField.ServerAutoIncrement property
TADBlobStream class
Create
Truncate
TADBlobStream.Create constructor
TADBlobStream.Truncate method
TADBottomResourceOptions class
Assign
PersistentFileName
ResolveFileName
RestoreDefaults
TADBottomResourceOptions.Assign method
TADBottomResourceOptions.PersistentFileName property
TADBottomResourceOptions.ResolveFileName method
TADBottomResourceOptions.RestoreDefaults method
TADBottomUpdateOptions class
Assign
AutoIncFields
KeyFields
RestoreDefaults
UpdateTableName
TADBottomUpdateOptions.Assign method
TADBottomUpdateOptions.AutoIncFields property
TADBottomUpdateOptions.KeyFields property
TADBottomUpdateOptions.RestoreDefaults method
TADBottomUpdateOptions.UpdateTableName property
TADCommand class
Active
ActiveStoredUsage
AfterClose
AfterExecute
AfterOpen
AfterPrepare
AfterUnprepare
BaseObjectName
BeforeClose
BeforeExecute
BeforeOpen
BeforePrepare
BeforeUnprepare
CatalogName
CommandKind
CommandText
Connection
ConnectionName
FetchOptions
FormatOptions
Macros
OnCommandChanged
OnError
Overload
Params
ResourceOptions
SchemaName
Transaction
UpdateOptions
TADCommand.Active property
TADCommand.ActiveStoredUsage property
TADCommand.AfterClose event
TADCommand.AfterExecute event
TADCommand.AfterOpen event
TADCommand.AfterPrepare event
TADCommand.AfterUnprepare event
TADCommand.BaseObjectName property
TADCommand.BeforeClose event
TADCommand.BeforeExecute event
TADCommand.BeforeOpen event
TADCommand.BeforePrepare event
TADCommand.BeforeUnprepare event
TADCommand.CatalogName property
TADCommand.CommandKind property
TADCommand.CommandText property
TADCommand.Connection property
TADCommand.ConnectionName property
TADCommand.FetchOptions property
TADCommand.FormatOptions property
TADCommand.Macros property
TADCommand.OnCommandChanged event
TADCommand.OnError event
TADCommand.Overload property
TADCommand.Params property
TADCommand.ResourceOptions property
TADCommand.SchemaName property
TADCommand.Transaction property
TADCommand.UpdateOptions property
TADConnection class
AfterCommit
AfterRollback
AfterStartTransaction
BeforeCommit
BeforeRollback
BeforeStartTransaction
Connected
ConnectedStoredUsage
ConnectionDefName
ConnectionName
DriverName
FetchOptions
FormatOptions
LoginDialog
LoginPrompt
OnError
OnLogin
OnLosted
OnRecover
OnRestored
Params
ResourceOptions
Transaction
TxOptions
UpdateOptions
UpdateTransaction
TADConnection.AfterCommit event
TADConnection.AfterRollback event
TADConnection.AfterStartTransaction event
TADConnection.BeforeCommit event
TADConnection.BeforeRollback event
TADConnection.BeforeStartTransaction event
TADConnection.Connected property
TADConnection.ConnectedStoredUsage property
TADConnection.ConnectionDefName property
TADConnection.ConnectionName property
TADConnection.DriverName property
TADConnection.FetchOptions property
TADConnection.FormatOptions property
TADConnection.LoginDialog property
TADConnection.LoginPrompt property
TADConnection.OnError event
TADConnection.OnLogin event
TADConnection.OnLosted event
TADConnection.OnRecover event
TADConnection.OnRestored event
TADConnection.Params property
TADConnection.ResourceOptions property
TADConnection.Transaction property
TADConnection.TxOptions property
TADConnection.UpdateOptions property
TADConnection.UpdateTransaction property
TADCustomCommand class
AbortJob
AcquireConnection
Active
ActiveStoredUsage
AfterClose
AfterExecute
AfterFetch
AfterOpen
AfterPrepare
AfterUnprepare
BaseObjectName
BeforeClose
BeforeExecute
BeforeFetch
BeforeOpen
BeforePrepare
BeforeUnprepare
BindedBy
CatalogName
Close
CloseAll
CommandIntf
CommandKind
CommandText
Connection
ConnectionName
DataSet
Define
Define
Disconnect
Execute
Execute
Execute
Execute
Fetch
FetchOptions
FillParams
FindMacro
FindParam
FixedCommandKind
FormatOptions
GetConnection
MacroByName
Macros
NextRecordSet
OnCommandChanged
OnError
Open
OpenOrExecute
Overload
ParamBindMode
ParamByName
Params
Prepare
Prepared
ReleaseConnection
ResourceOptions
RowsAffected
SchemaName
SQLText
State
Transaction
Unprepare
UpdateOptions
Values
TADCustomCommand.AbortJob method
TADCustomCommand.AcquireConnection method
TADCustomCommand.Active property
TADCustomCommand.ActiveStoredUsage property
TADCustomCommand.AfterClose event
TADCustomCommand.AfterExecute event
TADCustomCommand.AfterFetch event
TADCustomCommand.AfterOpen event
TADCustomCommand.AfterPrepare event
TADCustomCommand.AfterUnprepare event
TADCustomCommand.BaseObjectName property
TADCustomCommand.BeforeClose event
TADCustomCommand.BeforeExecute event
TADCustomCommand.BeforeFetch event
TADCustomCommand.BeforeOpen event
TADCustomCommand.BeforePrepare event
TADCustomCommand.BeforeUnprepare event
TADCustomCommand.BindedBy property
TADCustomCommand.CatalogName property
TADCustomCommand.Close method
TADCustomCommand.CloseAll method
TADCustomCommand.CommandIntf property
TADCustomCommand.CommandKind property
TADCustomCommand.CommandText property
TADCustomCommand.Connection property
TADCustomCommand.ConnectionName property
TADCustomCommand.DataSet property
TADCustomCommand.Define method
TADCustomCommand.Disconnect method
TADCustomCommand.Execute method
TADCustomCommand.Fetch method
TADCustomCommand.FetchOptions property
TADCustomCommand.FillParams method
TADCustomCommand.FindMacro method
TADCustomCommand.FindParam method
TADCustomCommand.FixedCommandKind property
TADCustomCommand.FormatOptions property
TADCustomCommand.GetConnection method
TADCustomCommand.MacroByName method
TADCustomCommand.Macros property
TADCustomCommand.NextRecordSet method
TADCustomCommand.OnCommandChanged event
TADCustomCommand.OnError event
TADCustomCommand.Open method
TADCustomCommand.OpenOrExecute method
TADCustomCommand.Overload property
TADCustomCommand.ParamBindMode property
TADCustomCommand.ParamByName method
TADCustomCommand.Params property
TADCustomCommand.Prepare method
TADCustomCommand.Prepared property
TADCustomCommand.ReleaseConnection method
TADCustomCommand.ResourceOptions property
TADCustomCommand.RowsAffected property
TADCustomCommand.SchemaName property
TADCustomCommand.SQLText property
TADCustomCommand.State property
TADCustomCommand.Transaction property
TADCustomCommand.Unprepare method
TADCustomCommand.UpdateOptions property
TADCustomCommand.Values property
TADCustomConnection class
AbortJob
AfterCommit
AfterRollback
AfterStartTransaction
ApplyUpdates
Assign
BeforeCommit
BeforeRollback
BeforeStartTransaction
CheckActive
CheckConnectionDef
CheckInactive
CheckOnline
CliHandle
CliObj
CommandCount
Commands
Commit
CommitRetaining
Connected
ConnectedStoredUsage
ConnectionDefName
ConnectionIntf
ConnectionMetaDataIntf
ConnectionName
DataSets
DecodeObjectName
DriverName
EncodeObjectName
ExecSQL
ExecSQL
ExecSQL
ExecSQLScalar
ExecSQLScalar
ExecSQLScalar
FetchOptions
FormatOptions
GetCatalogNames
GetFieldNames
GetGeneratorNames
GetInfoReport
GetKeyFieldNames
GetLastAutoGenValue
GetPackageNames
GetSchemaNames
GetStoredProcNames
GetTableNames
InTransaction
IsSQLBased
LastUsed
LoginDialog
LoginPrompt
Messages
Offline
Offlined
OnError
Online
OnLogin
OnLosted
OnRecover
OnRestored
Open
Open
Open
OptionsIntf
Params
Ping
RDBMSKind
RefCount
RefreshMetadataCache
ReleaseClients
ResourceOptions
ResultConnectionDef
Rollback
RollbackRetaining
SharedCliHandle
StartTransaction
Temporary
Transaction
TxOptions
UpdateOptions
UpdateTransaction
TADCustomConnection.AbortJob method
TADCustomConnection.AfterCommit event
TADCustomConnection.AfterRollback event
TADCustomConnection.AfterStartTransaction event
TADCustomConnection.ApplyUpdates method
TADCustomConnection.Assign method
TADCustomConnection.BeforeCommit event
TADCustomConnection.BeforeRollback event
TADCustomConnection.BeforeStartTransaction event
TADCustomConnection.CheckActive method
TADCustomConnection.CheckConnectionDef method
TADCustomConnection.CheckInactive method
TADCustomConnection.CheckOnline method
TADCustomConnection.CliHandle property
TADCustomConnection.CliObj property
TADCustomConnection.CommandCount property
TADCustomConnection.Commands property
TADCustomConnection.Commit method
TADCustomConnection.CommitRetaining method
TADCustomConnection.Connected property
TADCustomConnection.ConnectedStoredUsage property
TADCustomConnection.ConnectionDefName property
TADCustomConnection.ConnectionIntf property
TADCustomConnection.ConnectionMetaDataIntf property
TADCustomConnection.ConnectionName property
TADCustomConnection.DataSets property
TADCustomConnection.DecodeObjectName method
TADCustomConnection.DriverName property
TADCustomConnection.EncodeObjectName method
TADCustomConnection.ExecSQL method
TADCustomConnection.ExecSQLScalar method
TADCustomConnection.FetchOptions property
TADCustomConnection.FormatOptions property
TADCustomConnection.GetCatalogNames method
TADCustomConnection.GetFieldNames method
TADCustomConnection.GetGeneratorNames method
TADCustomConnection.GetInfoReport method
TADCustomConnection.GetKeyFieldNames method
TADCustomConnection.GetLastAutoGenValue method
TADCustomConnection.GetPackageNames method
TADCustomConnection.GetSchemaNames method
TADCustomConnection.GetStoredProcNames method
TADCustomConnection.GetTableNames method
TADCustomConnection.InTransaction property
TADCustomConnection.IsSQLBased property
TADCustomConnection.LastUsed property
TADCustomConnection.LoginDialog property
TADCustomConnection.LoginPrompt property
TADCustomConnection.Messages property
TADCustomConnection.Offline method
TADCustomConnection.Offlined property
TADCustomConnection.OnError event
TADCustomConnection.Online method
TADCustomConnection.OnLogin event
TADCustomConnection.OnLosted event
TADCustomConnection.OnRecover event
TADCustomConnection.OnRestored event
TADCustomConnection.Open method
TADCustomConnection.OptionsIntf property
TADCustomConnection.Params property
TADCustomConnection.Ping method
TADCustomConnection.RDBMSKind property
TADCustomConnection.RefCount property
TADCustomConnection.RefreshMetadataCache method
TADCustomConnection.ReleaseClients method
TADCustomConnection.ResourceOptions property
TADCustomConnection.ResultConnectionDef property
TADCustomConnection.Rollback method
TADCustomConnection.RollbackRetaining method
TADCustomConnection.SharedCliHandle property
TADCustomConnection.StartTransaction method
TADCustomConnection.Temporary property
TADCustomConnection.Transaction property
TADCustomConnection.TxOptions property
TADCustomConnection.UpdateOptions property
TADCustomConnection.UpdateTransaction property
TADCustomEventAlerter class
Active
Connection
EventAlerterIntf
Names
OnAlert
OnTimeout
Options
Register
Signal
Unregister
TADCustomEventAlerter.Active property
TADCustomEventAlerter.Connection property
TADCustomEventAlerter.EventAlerterIntf property
TADCustomEventAlerter.Names property
TADCustomEventAlerter.OnAlert event
TADCustomEventAlerter.OnTimeout event
TADCustomEventAlerter.Options property
TADCustomEventAlerter.Register method
TADCustomEventAlerter.Signal method
TADCustomEventAlerter.Unregister method
TADCustomLocalSQL class
Active
Connection
DataSets
OnGetDataSet
OnReadDataSet
TADCustomLocalSQL.Active property
TADCustomLocalSQL.Connection property
TADCustomLocalSQL.DataSets property
TADCustomLocalSQL.OnGetDataSet event
TADCustomLocalSQL.OnReadDataSet event
TADCustomManager class
Active
ActiveStoredUsage
ActualConnectionDefFileName
ActualDriverDefFileName
AddConnectionDef
AfterLoadConnectionDefFile
AfterShutdown
AfterStartup
AutoCreated
BeforeLoadConnectionDefFile
BeforeShutdown
BeforeStartup
CanRefreshConnectionDefFile
Close
CloseConnectionDef
ConnectionCount
ConnectionDefFileAutoLoad
ConnectionDefFileLoaded
ConnectionDefFileName
ConnectionDefs
Connections
DeleteConnectionDef
DriverDefFileAutoLoad
DriverDefFileName
DriverDefs
DropConnections
FetchOptions
FindConnection
FormatOptions
GetBaseDriverID
GetCatalogNames
GetConnectionDefNames
GetConnectionDefParams
GetConnectionNames
GetDriverNames
GetFieldNames
GetGeneratorNames
GetKeyFieldNames
GetPackageNames
GetRDBMSKind
GetSchemaNames
GetStoredProcNames
GetTableNames
IsConnectionDef
LoadConnectionDefFile
ModifyConnectionDef
Open
RefreshConnectionDefFile
RefreshMetadataCache
ResourceOptions
SaveConnectionDefFile
SilentMode
State
UpdateOptions
WaitCursor
TADCustomManager.Active property
TADCustomManager.ActiveStoredUsage property
TADCustomManager.ActualConnectionDefFileName property
TADCustomManager.ActualDriverDefFileName property
TADCustomManager.AddConnectionDef method
TADCustomManager.AfterLoadConnectionDefFile event
TADCustomManager.AfterShutdown event
TADCustomManager.AfterStartup event
TADCustomManager.AutoCreated property
TADCustomManager.BeforeLoadConnectionDefFile event
TADCustomManager.BeforeShutdown event
TADCustomManager.BeforeStartup event
TADCustomManager.CanRefreshConnectionDefFile property
TADCustomManager.Close method
TADCustomManager.CloseConnectionDef method
TADCustomManager.ConnectionCount property
TADCustomManager.ConnectionDefFileAutoLoad property
TADCustomManager.ConnectionDefFileLoaded property
TADCustomManager.ConnectionDefFileName property
TADCustomManager.ConnectionDefs property
TADCustomManager.Connections property
TADCustomManager.DeleteConnectionDef method
TADCustomManager.DriverDefFileAutoLoad property
TADCustomManager.DriverDefFileName property
TADCustomManager.DriverDefs property
TADCustomManager.DropConnections method
TADCustomManager.FetchOptions property
TADCustomManager.FindConnection method
TADCustomManager.FormatOptions property
TADCustomManager.GetBaseDriverID method
TADCustomManager.GetCatalogNames method
TADCustomManager.GetConnectionDefNames method
TADCustomManager.GetConnectionDefParams method
TADCustomManager.GetConnectionNames method
TADCustomManager.GetDriverNames method
TADCustomManager.GetFieldNames method
TADCustomManager.GetGeneratorNames method
TADCustomManager.GetKeyFieldNames method
TADCustomManager.GetPackageNames method
TADCustomManager.GetRDBMSKind method
TADCustomManager.GetSchemaNames method
TADCustomManager.GetStoredProcNames method
TADCustomManager.GetTableNames method
TADCustomManager.IsConnectionDef method
TADCustomManager.LoadConnectionDefFile method
TADCustomManager.ModifyConnectionDef method
TADCustomManager.Open method
TADCustomManager.RefreshConnectionDefFile method
TADCustomManager.RefreshMetadataCache method
TADCustomManager.ResourceOptions property
TADCustomManager.SaveConnectionDefFile method
TADCustomManager.SilentMode property
TADCustomManager.State property
TADCustomManager.UpdateOptions property
TADCustomManager.WaitCursor property
TADCustomMemTable class
Adapter
AppendData
CommandText
ConstraintsDisabled
DisableStringTrim
FetchOnDemand
FileName
GetOptionalParam
IsClone
LogChanges
MergeChangeLog
PacketRecords
ProviderEOF
ReadOnly
SetOptionalParam
StatusFilter
XMLData
TADCustomMemTable.Adapter property
TADCustomMemTable.AppendData method
TADCustomMemTable.CommandText property
TADCustomMemTable.ConstraintsDisabled method
TADCustomMemTable.DisableStringTrim property
TADCustomMemTable.FetchOnDemand property
TADCustomMemTable.FileName property
TADCustomMemTable.GetOptionalParam method
TADCustomMemTable.IsClone property
TADCustomMemTable.LogChanges property
TADCustomMemTable.MergeChangeLog method
TADCustomMemTable.PacketRecords property
TADCustomMemTable.ProviderEOF property
TADCustomMemTable.ReadOnly property
TADCustomMemTable.SetOptionalParam method
TADCustomMemTable.StatusFilter property
TADCustomMemTable.XMLData property
TADCustomOptions class
Assign
RestoreDefaults
Version
TADCustomOptions.Assign method
TADCustomOptions.RestoreDefaults method
TADCustomOptions.Version property
TADCustomQuery class
DataSource
ExecSQL
ExecSQL
ExecSQL
ExecSQL
ParamCount
SQL
Text
TADCustomQuery.DataSource property
TADCustomQuery.ExecSQL method
TADCustomQuery.ParamCount property
TADCustomQuery.SQL property
TADCustomQuery.Text property
TADCustomSchemaAdapter class
ApplyUpdates
Count
Reconcile
TableAdapters
TADCustomSchemaAdapter.ApplyUpdates method
TADCustomSchemaAdapter.Count property
TADCustomSchemaAdapter.Reconcile method
TADCustomSchemaAdapter.TableAdapters property
TADCustomStoredProc class
CatalogName
DescriptionsAvailable
ExecFunc
ExecFunc
ExecFunc
ExecFunc
ExecProc
ExecProc
ExecProc
ExecProc
Overload
PackageName
ParamCount
RowsAffected
SchemaName
StoredProcName
TADCustomStoredProc.CatalogName property
TADCustomStoredProc.DescriptionsAvailable method
TADCustomStoredProc.ExecFunc method
TADCustomStoredProc.ExecProc method
TADCustomStoredProc.Overload property
TADCustomStoredProc.PackageName property
TADCustomStoredProc.ParamCount property
TADCustomStoredProc.RowsAffected property
TADCustomStoredProc.SchemaName property
TADCustomStoredProc.StoredProcName property
TADCustomTransaction class
Active
AfterCommit
AfterRollback
AfterStartTransaction
BeforeCommit
BeforeRollback
BeforeStartTransaction
Commit
CommitRetaining
Connection
DataSetCount
DataSets
Options
Rollback
RollbackRetaining
StartTransaction
TransactionIntf
TADCustomTransaction.Active property
TADCustomTransaction.AfterCommit event
TADCustomTransaction.AfterRollback event
TADCustomTransaction.AfterStartTransaction event
TADCustomTransaction.BeforeCommit event
TADCustomTransaction.BeforeRollback event
TADCustomTransaction.BeforeStartTransaction event
TADCustomTransaction.Commit method
TADCustomTransaction.CommitRetaining method
TADCustomTransaction.Connection property
TADCustomTransaction.DataSetCount property
TADCustomTransaction.DataSets property
TADCustomTransaction.Options property
TADCustomTransaction.Rollback method
TADCustomTransaction.RollbackRetaining method
TADCustomTransaction.StartTransaction method
TADCustomTransaction.TransactionIntf property
TADCustomUpdateObject class
Apply
DataSet
TADCustomUpdateObject.Apply method
TADCustomUpdateObject.DataSet property
TADDataSet class
ActiveStoredUsage
AddIndex
AfterApplyUpdates
AfterExecute
AfterGetRecord
AfterGetRecords
AfterRowRequest
Aggregates
AggregatesActive
ApplyMaster
ApplyRange
ApplyUpdates
AttachTable
BeforeApplyUpdates
BeforeExecute
BeforeGetRecords
BeforeRowRequest
BeginBatch
CachedUpdates
CancelRange
CancelUpdates
ChangeCount
CloneCursor
CloneSource
CommitUpdates
Constraints
ConstraintsEnabled
CopyDataSet
CopyRecord
CreateDataSet
CreateExpression
Data
DatSManager
DeleteIndex
DeleteIndexes
Delta
DetailFields
DisableConstraints
Disconnect
EditKey
EditRangeEnd
EditRangeStart
EmptyDataSet
EnableConstraints
EndBatch
Execute
FetchAgain
FetchAll
FetchBlobs
FetchDetails
FetchNext
FetchOptions
FilterChanges
FilteredData
FindKey
FindNearest
FindParam
FormatOptions
GetColumnField
GetDetailLinkFields
GetFieldColumn
GetGroupState
GetIndexNames
GetNextPacket
GetParentRow
GetRow
GotoCurrent
GotoKey
GotoNearest
GroupingLevel
IndexDefs
Indexes
IndexesActive
IndexFieldCount
IndexFieldNames
IndexFields
IndexName
IsIndexed
IsLinked
IsRanged
KeyExclusive
KeyFieldCount
LoadFromFile
LoadFromFileAtOpen
LoadFromStream
Locate
LocateEx
LocateEx
Lookup
LookupEx
LookupEx
MasterFields
MasterLink
MasterSource
Offline
OnMasterSetValues
OnReconcileError
OnUpdateError
OnUpdateRecord
OpenOrExecute
ParamByName
ParamCount
Params
ParentDataSet
Reconcile
RefreshRecord
RefreshUnknownRecord
Release
ResourceOptions
RevertRecord
RowError
SavePoint
SaveToFile
SaveToFileAtClose
SaveToStream
SetFieldAttributes
SetKey
SetRange
SetRangeEnd
SetRangeStart
SourceEOF
SourceView
Table
UndoLastChange
UpdateAttributes
UpdateConstraints
UpdateOptions
Updates
UpdatesPending
UpdateStatus
View
TADDataSet.ActiveStoredUsage property
TADDataSet.AddIndex method
TADDataSet.AfterApplyUpdates event
TADDataSet.AfterExecute event
TADDataSet.AfterGetRecord event
TADDataSet.AfterGetRecords event
TADDataSet.AfterRowRequest event
TADDataSet.Aggregates property
TADDataSet.AggregatesActive property
TADDataSet.ApplyMaster method
TADDataSet.ApplyRange method
TADDataSet.ApplyUpdates method
TADDataSet.AttachTable method
TADDataSet.BeforeApplyUpdates event
TADDataSet.BeforeExecute event
TADDataSet.BeforeGetRecords event
TADDataSet.BeforeRowRequest event
TADDataSet.BeginBatch method
TADDataSet.CachedUpdates property
TADDataSet.CancelRange method
TADDataSet.CancelUpdates method
TADDataSet.ChangeCount property
TADDataSet.CloneCursor method
TADDataSet.CloneSource property
TADDataSet.CommitUpdates method
TADDataSet.Constraints property
TADDataSet.ConstraintsEnabled property
TADDataSet.CopyDataSet method
TADDataSet.CopyRecord method
TADDataSet.CreateDataSet method
TADDataSet.CreateExpression method
TADDataSet.Data property
TADDataSet.DatSManager property
TADDataSet.DeleteIndex method
TADDataSet.DeleteIndexes method
TADDataSet.Delta property
TADDataSet.DetailFields property
TADDataSet.DisableConstraints method
TADDataSet.Disconnect method
TADDataSet.EditKey method
TADDataSet.EditRangeEnd method
TADDataSet.EditRangeStart method
TADDataSet.EmptyDataSet method
TADDataSet.EnableConstraints method
TADDataSet.EndBatch method
TADDataSet.Execute method
TADDataSet.FetchAgain method
TADDataSet.FetchAll method
TADDataSet.FetchBlobs method
TADDataSet.FetchDetails method
TADDataSet.FetchNext method
TADDataSet.FetchOptions property
TADDataSet.FilterChanges property
TADDataSet.FilteredData property
TADDataSet.FindKey method
TADDataSet.FindNearest method
TADDataSet.FindParam method
TADDataSet.FormatOptions property
TADDataSet.GetColumnField method
TADDataSet.GetDetailLinkFields method
TADDataSet.GetFieldColumn method
TADDataSet.GetGroupState method
TADDataSet.GetIndexNames method
TADDataSet.GetNextPacket method
TADDataSet.GetParentRow method
TADDataSet.GetRow method
TADDataSet.GotoCurrent method
TADDataSet.GotoKey method
TADDataSet.GotoNearest method
TADDataSet.GroupingLevel property
TADDataSet.IndexDefs property
TADDataSet.Indexes property
TADDataSet.IndexesActive property
TADDataSet.IndexFieldCount property
TADDataSet.IndexFieldNames property
TADDataSet.IndexFields property
TADDataSet.IndexName property
TADDataSet.IsIndexed method
TADDataSet.IsLinked method
TADDataSet.IsRanged method
TADDataSet.KeyExclusive property
TADDataSet.KeyFieldCount property
TADDataSet.LoadFromFile method
TADDataSet.LoadFromFileAtOpen method
TADDataSet.LoadFromStream method
TADDataSet.Locate method
TADDataSet.LocateEx method
TADDataSet.Lookup method
TADDataSet.LookupEx method
TADDataSet.MasterFields property
TADDataSet.MasterLink property
TADDataSet.MasterSource property
TADDataSet.Offline method
TADDataSet.OnMasterSetValues event
TADDataSet.OnReconcileError event
TADDataSet.OnUpdateError event
TADDataSet.OnUpdateRecord event
TADDataSet.OpenOrExecute method
TADDataSet.ParamByName method
TADDataSet.ParamCount property
TADDataSet.Params property
TADDataSet.ParentDataSet property
TADDataSet.Reconcile method
TADDataSet.RefreshRecord method
TADDataSet.RefreshUnknownRecord method
TADDataSet.Release method
TADDataSet.ResourceOptions property
TADDataSet.RevertRecord method
TADDataSet.RowError property
TADDataSet.SavePoint property
TADDataSet.SaveToFile method
TADDataSet.SaveToFileAtClose method
TADDataSet.SaveToStream method
TADDataSet.SetFieldAttributes method
TADDataSet.SetKey method
TADDataSet.SetRange method
TADDataSet.SetRangeEnd method
TADDataSet.SetRangeStart method
TADDataSet.SourceEOF property
TADDataSet.SourceView property
TADDataSet.Table property
TADDataSet.UndoLastChange method
TADDataSet.UpdateAttributes method
TADDataSet.UpdateConstraints method
TADDataSet.UpdateOptions property
TADDataSet.Updates property
TADDataSet.UpdatesPending property
TADDataSet.UpdateStatus method
TADDataSet.View property
TADDBError class
CommandTextOffset
ErrorCode
Kind
Level
Message
ObjName
RowIndex
TADDBError.CommandTextOffset property
TADDBError.ErrorCode property
TADDBError.Kind property
TADDBError.Level property
TADDBError.Message property
TADDBError.ObjName property
TADDBError.RowIndex property
TADEventAlerter class
Active
Connection
Names
OnAlert
OnTimeout
Options
TADEventAlerter.Active property
TADEventAlerter.Connection property
TADEventAlerter.Names property
TADEventAlerter.OnAlert event
TADEventAlerter.OnTimeout event
TADEventAlerter.Options property
TADEventAlerterOptions class
AutoRegister
Kind
Synchronize
Timeout
TADEventAlerterOptions.AutoRegister property
TADEventAlerterOptions.Kind property
TADEventAlerterOptions.Synchronize property
TADEventAlerterOptions.Timeout property
TADFetchOptions class
ActualRowsetSize
Assign
AssignedValues
AutoClose
AutoFetchAll
Cache
CursorKind
DetailCascade
DetailDelay
DetailOptimize
Items
LiveWindowFastFirst
LiveWindowParanoic
Mode
RecordCountMode
RecsMax
RecsSkip
RestoreDefaults
RowsetSize
Unidirectional
TADFetchOptions.ActualRowsetSize property
TADFetchOptions.Assign method
TADFetchOptions.AssignedValues property
TADFetchOptions.AutoClose property
TADFetchOptions.AutoFetchAll property
TADFetchOptions.Cache property
TADFetchOptions.CursorKind property
TADFetchOptions.DetailCascade property
TADFetchOptions.DetailDelay property
TADFetchOptions.DetailOptimize property
TADFetchOptions.Items property
TADFetchOptions.LiveWindowFastFirst property
TADFetchOptions.LiveWindowParanoic property
TADFetchOptions.Mode property
TADFetchOptions.RecordCountMode property
TADFetchOptions.RecsMax property
TADFetchOptions.RecsSkip property
TADFetchOptions.RestoreDefaults method
TADFetchOptions.RowsetSize property
TADFetchOptions.Unidirectional property
TADFormatOptions class
Assign
AssignedValues
DataSnapCompatibility
DefaultParamDataType
FmtDisplayDate
FmtDisplayDateTime
FmtDisplayNumeric
FmtDisplayTime
FmtEditNumeric
InlineDataSize
MapRules
MaxBcdPrecision
MaxBcdScale
MaxStringSize
OwnMapRules
QuoteIdentifiers
RestoreDefaults
Round2Scale
SortLocale
SortOptions
StrsDivLen2
StrsEmpty2Null
StrsTrim
StrsTrim2Len
TADFormatOptions.Assign method
TADFormatOptions.AssignedValues property
TADFormatOptions.DataSnapCompatibility property
TADFormatOptions.DefaultParamDataType property
TADFormatOptions.FmtDisplayDate property
TADFormatOptions.FmtDisplayDateTime property
TADFormatOptions.FmtDisplayNumeric property
TADFormatOptions.FmtDisplayTime property
TADFormatOptions.FmtEditNumeric property
TADFormatOptions.InlineDataSize property
TADFormatOptions.MapRules property
TADFormatOptions.MaxBcdPrecision property
TADFormatOptions.MaxBcdScale property
TADFormatOptions.MaxStringSize property
TADFormatOptions.OwnMapRules property
TADFormatOptions.QuoteIdentifiers property
TADFormatOptions.RestoreDefaults method
TADFormatOptions.Round2Scale property
TADFormatOptions.SortLocale property
TADFormatOptions.SortOptions property
TADFormatOptions.StrsDivLen2 property
TADFormatOptions.StrsEmpty2Null property
TADFormatOptions.StrsTrim property
TADFormatOptions.StrsTrim2Len property
TADGUIxAsyncExecuteDialog class
AsyncDialog
Caption
HideDelay
OnHide
OnShow
Prompt
ShowDelay
TADGUIxAsyncExecuteDialog.AsyncDialog property
TADGUIxAsyncExecuteDialog.Caption property
TADGUIxAsyncExecuteDialog.HideDelay property
TADGUIxAsyncExecuteDialog.OnHide event
TADGUIxAsyncExecuteDialog.OnShow event
TADGUIxAsyncExecuteDialog.Prompt property
TADGUIxAsyncExecuteDialog.ShowDelay property
TADGUIxComponent class
Provider
TADGUIxComponent.Provider property
TADGUIxErrorDialog class
Caption
Enabled
ErrorDialog
Execute
OnHide
OnShow
StayOnTop
TADGUIxErrorDialog.Caption property
TADGUIxErrorDialog.Enabled property
TADGUIxErrorDialog.ErrorDialog property
TADGUIxErrorDialog.Execute method
TADGUIxErrorDialog.OnHide property
TADGUIxErrorDialog.OnShow property
TADGUIxErrorDialog.StayOnTop property
TADGUIxLoginDialog class
Caption
ChangeExpiredPassword
ConnectionDef
Execute
GetAllLoginParams
HistoryEnabled
HistoryKey
HistoryStorage
HistoryWithPassword
LoginDialog
LoginRetries
OnChangePassword
OnHide
OnLogin
OnShow
VisibleItems
TADGUIxLoginDialog.Caption property
TADGUIxLoginDialog.ChangeExpiredPassword property
TADGUIxLoginDialog.ConnectionDef property
TADGUIxLoginDialog.Execute method
TADGUIxLoginDialog.GetAllLoginParams method
TADGUIxLoginDialog.HistoryEnabled property
TADGUIxLoginDialog.HistoryKey property
TADGUIxLoginDialog.HistoryStorage property
TADGUIxLoginDialog.HistoryWithPassword property
TADGUIxLoginDialog.LoginDialog property
TADGUIxLoginDialog.LoginRetries property
TADGUIxLoginDialog.OnChangePassword property
TADGUIxLoginDialog.OnHide event
TADGUIxLoginDialog.OnLogin property
TADGUIxLoginDialog.OnShow event
TADGUIxLoginDialog.VisibleItems property
TADGUIxScriptDialog class
Caption
OnHide
OnInput
OnOutput
OnPause
OnProgress
OnShow
Options
ScriptDialog
TADGUIxScriptDialog.Caption property
TADGUIxScriptDialog.OnHide event
TADGUIxScriptDialog.OnInput property
TADGUIxScriptDialog.OnOutput property
TADGUIxScriptDialog.OnPause property
TADGUIxScriptDialog.OnProgress property
TADGUIxScriptDialog.OnShow event
TADGUIxScriptDialog.Options property
TADGUIxScriptDialog.ScriptDialog property
TADGUIxWaitCursor class
OnHide
OnShow
ScreenCursor
WaitCursor
TADGUIxWaitCursor.OnHide event
TADGUIxWaitCursor.OnShow event
TADGUIxWaitCursor.ScreenCursor property
TADGUIxWaitCursor.WaitCursor property
TADIBBackup class
Backup
BackupFiles
Database
Options
Verbose
TADIBBackup.Backup method
TADIBBackup.BackupFiles property
TADIBBackup.Database property
TADIBBackup.Options property
TADIBBackup.Verbose property
TADIBNBackup class
Backup
BackupFile
Database
Level
Options
TADIBNBackup.Backup method
TADIBNBackup.BackupFile property
TADIBNBackup.Database property
TADIBNBackup.Level property
TADIBNBackup.Options property
TADIBNRestore class
BackupFiles
Database
Options
Restore
TADIBNRestore.BackupFiles property
TADIBNRestore.Database property
TADIBNRestore.Options property
TADIBNRestore.Restore method
TADIBRestore class
BackupFiles
Database
Options
PageSize
Restore
Verbose
TADIBRestore.BackupFiles property
TADIBRestore.Database property
TADIBRestore.Options property
TADIBRestore.PageSize property
TADIBRestore.Restore method
TADIBRestore.Verbose property
TADIBSecurity class
AddUser
AFirstName
AGroupID
AGroupName
ALastName
AMiddleName
APassword
ARoleName
AUserID
AUserName
DeleteUser
DisplayUser
DisplayUsers
Modified
ModifyUser
Users
TADIBSecurity.AddUser method
TADIBSecurity.AFirstName property
TADIBSecurity.AGroupID property
TADIBSecurity.AGroupName property
TADIBSecurity.ALastName property
TADIBSecurity.AMiddleName property
TADIBSecurity.APassword property
TADIBSecurity.ARoleName property
TADIBSecurity.AUserID property
TADIBSecurity.AUserName property
TADIBSecurity.DeleteUser method
TADIBSecurity.DisplayUser method
TADIBSecurity.DisplayUsers method
TADIBSecurity.Modified property
TADIBSecurity.ModifyUser method
TADIBSecurity.Users property
TADIBService class
DriverLink
Host
OnProgress
Password
Protocol
QueryTimeout
SqlRoleName
UserName
TADIBService.DriverLink property
TADIBService.Host property
TADIBService.OnProgress event
TADIBService.Password property
TADIBService.Protocol property
TADIBService.QueryTimeout property
TADIBService.SqlRoleName property
TADIBService.UserName property
TADIBTrace class
Config
List
Resume
SessionID
SessionName
Start
Stop
Suspend
TADIBTrace.Config property
TADIBTrace.List method
TADIBTrace.Resume method
TADIBTrace.SessionID property
TADIBTrace.SessionName property
TADIBTrace.Start method
TADIBTrace.Stop method
TADIBTrace.Suspend method
TADIBValidate class
Analyze
CheckOnly
Database
Options
Repair
Sweep
TADIBValidate.Analyze method
TADIBValidate.CheckOnly method
TADIBValidate.Database property
TADIBValidate.Options property
TADIBValidate.Repair method
TADIBValidate.Sweep method
TADIndex class
Active
ActualActive
CaseInsFields
DataSet
DescFields
Distinct
Expression
Fields
Filter
FilterOptions
Name
Options
Selected
TADIndex.Active property
TADIndex.ActualActive property
TADIndex.CaseInsFields property
TADIndex.DataSet property
TADIndex.DescFields property
TADIndex.Distinct property
TADIndex.Expression property
TADIndex.Fields property
TADIndex.Filter property
TADIndex.FilterOptions property
TADIndex.Name property
TADIndex.Options property
TADIndex.Selected property
TADIndexes class
Add
FindIndex
FindIndexForFields
IndexByName
Items
TADIndexes.Add method
TADIndexes.FindIndex method
TADIndexes.FindIndexForFields method
TADIndexes.IndexByName method
TADIndexes.Items property
TADLocalSQL class
Active
Connection
DataSets
DisableControls
IncludeHiddenFields
MultipleCursors
OnGetDataSet
OnReadDataSet
SchemaName
TADLocalSQL.Active property
TADLocalSQL.Connection property
TADLocalSQL.DataSets property
TADLocalSQL.DisableControls property
TADLocalSQL.IncludeHiddenFields property
TADLocalSQL.MultipleCursors property
TADLocalSQL.OnGetDataSet event
TADLocalSQL.OnReadDataSet event
TADLocalSQL.SchemaName property
TADLocalSQLDataSet class
ActualName
Adapter
DataSet
IsValid
Name
Temporary
TADLocalSQLDataSet.ActualName property
TADLocalSQLDataSet.Adapter property
TADLocalSQLDataSet.DataSet property
TADLocalSQLDataSet.IsValid property
TADLocalSQLDataSet.Name property
TADLocalSQLDataSet.Temporary property
TADLocalSQLDataSets class
Add
Add
Items
Remove
TADLocalSQLDataSets.Add method
TADLocalSQLDataSets.Items property
TADLocalSQLDataSets.Remove method
TADManager and TADConnection Questions
TADManager class
Active
ActiveStoredUsage
AfterLoadConnectionDefFile
AfterShutdown
AfterStartup
BeforeLoadConnectionDefFile
BeforeShutdown
BeforeStartup
ConnectionDefFileAutoLoad
ConnectionDefFileName
DriverDefFileAutoLoad
DriverDefFileName
FetchOptions
FormatOptions
ResourceOptions
SilentMode
UpdateOptions
WaitCursor
TADManager.Active property
TADManager.ActiveStoredUsage property
TADManager.AfterLoadConnectionDefFile event
TADManager.AfterShutdown event
TADManager.AfterStartup event
TADManager.BeforeLoadConnectionDefFile event
TADManager.BeforeShutdown event
TADManager.BeforeStartup event
TADManager.ConnectionDefFileAutoLoad property
TADManager.ConnectionDefFileName property
TADManager.DriverDefFileAutoLoad property
TADManager.DriverDefFileName property
TADManager.FetchOptions property
TADManager.FormatOptions property
TADManager.ResourceOptions property
TADManager.SilentMode property
TADManager.UpdateOptions property
TADManager.WaitCursor property
TADMapRule class
NameMask
PrecMax
PrecMin
ScaleMax
ScaleMin
SizeMax
SizeMin
SourceDataType
TargetDataType
TADMapRule.NameMask property
TADMapRule.PrecMax property
TADMapRule.PrecMin property
TADMapRule.ScaleMax property
TADMapRule.ScaleMin property
TADMapRule.SizeMax property
TADMapRule.SizeMin property
TADMapRule.SourceDataType property
TADMapRule.TargetDataType property
TADMapRules class
Add
Items
TADMapRules.Add method
TADMapRules.Items property
TADMasterDataLink class
ActualDelayedScrollEnabled
CancelSync
DelayedScrollEnabled
DisableDelayedScroll
DisableScroll
EnableDelayedScroll
EnableScroll
Synchronize
TADMasterDataLink.ActualDelayedScrollEnabled property
TADMasterDataLink.CancelSync method
TADMasterDataLink.DelayedScrollEnabled property
TADMasterDataLink.DisableDelayedScroll method
TADMasterDataLink.DisableScroll method
TADMasterDataLink.EnableDelayedScroll method
TADMasterDataLink.EnableScroll method
TADMasterDataLink.Synchronize method
TADMemTable class
ActiveStoredUsage
Adapter
AfterApplyUpdates
AfterExecute
AfterGetRecord
AfterGetRecords
AfterRowRequest
Aggregates
AggregatesActive
BeforeApplyUpdates
BeforeExecute
BeforeGetRecords
BeforeRowRequest
CachedUpdates
Constraints
ConstraintsEnabled
DetailFields
FetchOptions
FilterChanges
FormatOptions
IndexDefs
Indexes
IndexesActive
IndexFieldNames
IndexName
LocalSQL
MasterFields
MasterSource
OnReconcileError
OnUpdateError
OnUpdateRecord
ResourceOptions
UpdateOptions
TADMemTable Questions
TADMemTable.ActiveStoredUsage property
TADMemTable.Adapter property
TADMemTable.AfterApplyUpdates event
TADMemTable.AfterExecute event
TADMemTable.AfterGetRecord event
TADMemTable.AfterGetRecords event
TADMemTable.AfterRowRequest event
TADMemTable.Aggregates property
TADMemTable.AggregatesActive property
TADMemTable.BeforeApplyUpdates event
TADMemTable.BeforeExecute event
TADMemTable.BeforeGetRecords event
TADMemTable.BeforeRowRequest event
TADMemTable.CachedUpdates property
TADMemTable.Constraints property
TADMemTable.ConstraintsEnabled property
TADMemTable.DetailFields property
TADMemTable.FetchOptions property
TADMemTable.FilterChanges property
TADMemTable.FormatOptions property
TADMemTable.IndexDefs property
TADMemTable.Indexes property
TADMemTable.IndexesActive property
TADMemTable.IndexFieldNames property
TADMemTable.IndexName property
TADMemTable.LocalSQL property
TADMemTable.MasterFields property
TADMemTable.MasterSource property
TADMemTable.OnReconcileError event
TADMemTable.OnUpdateError event
TADMemTable.OnUpdateRecord event
TADMemTable.ResourceOptions property
TADMemTable.UpdateOptions property
TADMetaInfoCommand class
Active
AfterClose
AfterOpen
BaseObjectName
BeforeClose
BeforeOpen
CatalogName
Connection
ConnectionName
FormatOptions
MetaInfoKind
ObjectName
ObjectScopes
OnCommandChanged
OnError
Overload
SchemaName
TableKinds
Wildcard
TADMetaInfoCommand.Active property
TADMetaInfoCommand.AfterClose event
TADMetaInfoCommand.AfterOpen event
TADMetaInfoCommand.BaseObjectName property
TADMetaInfoCommand.BeforeClose event
TADMetaInfoCommand.BeforeOpen event
TADMetaInfoCommand.CatalogName property
TADMetaInfoCommand.Connection property
TADMetaInfoCommand.ConnectionName property
TADMetaInfoCommand.FormatOptions property
TADMetaInfoCommand.MetaInfoKind property
TADMetaInfoCommand.ObjectName property
TADMetaInfoCommand.ObjectScopes property
TADMetaInfoCommand.OnCommandChanged event
TADMetaInfoCommand.OnError event
TADMetaInfoCommand.Overload property
TADMetaInfoCommand.SchemaName property
TADMetaInfoCommand.TableKinds property
TADMetaInfoCommand.Wildcard property
TADMetaInfoQuery class
ActiveStoredUsage
AfterGetRecord
AfterGetRecords
AfterRowRequest
Aggregates
AggregatesActive
BaseObjectName
BeforeGetRecords
BeforeRowRequest
CatalogName
Connection
ConnectionName
FetchOptions
FormatOptions
Indexes
IndexesActive
IndexFieldNames
IndexName
LocalSQL
MetaInfoKind
ObjectName
ObjectScopes
OnCommandChanged
OnError
ResourceOptions
SchemaAdapter
SchemaName
TableKinds
Transaction
UpdateTransaction
Wildcard
TADMetaInfoQuery.ActiveStoredUsage property
TADMetaInfoQuery.AfterGetRecord event
TADMetaInfoQuery.AfterGetRecords event
TADMetaInfoQuery.AfterRowRequest event
TADMetaInfoQuery.Aggregates property
TADMetaInfoQuery.AggregatesActive property
TADMetaInfoQuery.BaseObjectName property
TADMetaInfoQuery.BeforeGetRecords event
TADMetaInfoQuery.BeforeRowRequest event
TADMetaInfoQuery.CatalogName property
TADMetaInfoQuery.Connection property
TADMetaInfoQuery.ConnectionName property
TADMetaInfoQuery.FetchOptions property
TADMetaInfoQuery.FormatOptions property
TADMetaInfoQuery.Indexes property
TADMetaInfoQuery.IndexesActive property
TADMetaInfoQuery.IndexFieldNames property
TADMetaInfoQuery.IndexName property
TADMetaInfoQuery.LocalSQL property
TADMetaInfoQuery.MetaInfoKind property
TADMetaInfoQuery.ObjectName property
TADMetaInfoQuery.ObjectScopes property
TADMetaInfoQuery.OnCommandChanged event
TADMetaInfoQuery.OnError event
TADMetaInfoQuery.ResourceOptions property
TADMetaInfoQuery.SchemaAdapter property
TADMetaInfoQuery.SchemaName property
TADMetaInfoQuery.TableKinds property
TADMetaInfoQuery.Transaction property
TADMetaInfoQuery.UpdateTransaction property
TADMetaInfoQuery.Wildcard property
TADMoniRemoteClientLink class
Host
Port
Timeout
Tracing
TADMoniRemoteClientLink.Host property
TADMoniRemoteClientLink.Port property
TADMoniRemoteClientLink.Timeout property
TADMoniRemoteClientLink.Tracing property
TADMSAccessService class
Compact
CreateDB
Database
DBVersion
DestDatabase
DriverLink
Drop
Encrypted
Password
Repair
ResetPassword
SortOrder
TADMSAccessService.Compact method
TADMSAccessService.CreateDB method
TADMSAccessService.Database property
TADMSAccessService.DBVersion property
TADMSAccessService.DestDatabase property
TADMSAccessService.DriverLink property
TADMSAccessService.Drop method
TADMSAccessService.Encrypted property
TADMSAccessService.Password property
TADMSAccessService.Repair method
TADMSAccessService.ResetPassword property
TADMSAccessService.SortOrder property
TADMSSQLError class
TADPhysADSDriverLink class
DateFormat
Decimals
DefaultPath
Epoch
Exact
SearchPath
ShowDeleted
TADPhysADSDriverLink.DateFormat property
TADPhysADSDriverLink.Decimals property
TADPhysADSDriverLink.DefaultPath property
TADPhysADSDriverLink.Epoch property
TADPhysADSDriverLink.Exact property
TADPhysADSDriverLink.SearchPath property
TADPhysADSDriverLink.ShowDeleted property
TADPhysASADriverLink class
ToolLib
TADPhysASADriverLink.ToolLib property
TADPhysDataSnapDriverLink class
TADPhysDB2DriverLink class
TADPhysDBXDriverLink class
TADPhysDriverLink class
ActualDriverID
BaseDriverID
DriverID
DriverIntf
DriverState
OnDriverCreated
OnDriverDestroying
Release
Services
ServicesCount
VendorHome
VendorLib
TADPhysDriverLink.ActualDriverID property
TADPhysDriverLink.BaseDriverID property
TADPhysDriverLink.DriverID property
TADPhysDriverLink.DriverIntf property
TADPhysDriverLink.DriverState property
TADPhysDriverLink.OnDriverCreated event
TADPhysDriverLink.OnDriverDestroying event
TADPhysDriverLink.Release method
TADPhysDriverLink.Services property
TADPhysDriverLink.ServicesCount property
TADPhysDriverLink.VendorHome property
TADPhysDriverLink.VendorLib property
TADPhysDriverService class
AfterExecute
BeforeExecute
CliObj
OnError
TADPhysDriverService.AfterExecute event
TADPhysDriverService.BeforeExecute event
TADPhysDriverService.CliObj property
TADPhysDriverService.OnError event
TADPhysIBDriverLink class
TADPhysMSAccessDriverLink class
TADPhysMSSQLDriverLink class
TADPhysMySQLDriverLink class
EmbeddedArgs
EmbeddedGroups
TADPhysMySQLDriverLink.EmbeddedArgs property
TADPhysMySQLDriverLink.EmbeddedGroups property
TADPhysODBCBaseDriverLink class
GetDrivers
GetDSNs
ODBCAdvanced
ODBCDriver
TADPhysODBCBaseDriverLink.GetDrivers method
TADPhysODBCBaseDriverLink.GetDSNs method
TADPhysODBCBaseDriverLink.ODBCAdvanced property
TADPhysODBCBaseDriverLink.ODBCDriver property
TADPhysODBCBaseService class
TADPhysODBCDriverLink class
TADPhysOracleDriverLink class
GetOracleHomes
GetTNSServices
NLSLang
Threaded
TNSAdmin
TADPhysOracleDriverLink.GetOracleHomes method
TADPhysOracleDriverLink.GetTNSServices method
TADPhysOracleDriverLink.NLSLang property
TADPhysOracleDriverLink.Threaded property
TADPhysOracleDriverLink.TNSAdmin property
TADPhysPgDriverLink class
TADPhysSQLiteDriverLink class
TADPhysTDBXDriverLink class
TADQuery class
ActiveStoredUsage
AfterApplyUpdates
AfterExecute
AfterGetRecord
AfterGetRecords
AfterRowRequest
Aggregates
AggregatesActive
BeforeApplyUpdates
BeforeExecute
BeforeGetRecords
BeforeRowRequest
CachedUpdates
Connection
ConnectionName
Constraints
ConstraintsEnabled
DetailFields
FetchOptions
FilterChanges
FormatOptions
Indexes
IndexesActive
IndexFieldNames
IndexName
LocalSQL
MacroCount
Macros
MasterFields
MasterSource
OnCommandChanged
OnError
OnExecuteError
OnMasterSetValues
OnReconcileError
OnUpdateError
OnUpdateRecord
Params
ResourceOptions
RowsAffected
SchemaAdapter
SQL
Transaction
UpdateObject
UpdateOptions
UpdateTransaction
TADQuery, TADStoredProc and TADUpdateSQL Questions
TADQuery.ActiveStoredUsage property
TADQuery.AfterApplyUpdates event
TADQuery.AfterExecute event
TADQuery.AfterGetRecord event
TADQuery.AfterGetRecords event
TADQuery.AfterRowRequest event
TADQuery.Aggregates property
TADQuery.AggregatesActive property
TADQuery.BeforeApplyUpdates event
TADQuery.BeforeExecute event
TADQuery.BeforeGetRecords event
TADQuery.BeforeRowRequest event
TADQuery.CachedUpdates property
TADQuery.Connection property
TADQuery.ConnectionName property
TADQuery.Constraints property
TADQuery.ConstraintsEnabled property
TADQuery.DetailFields property
TADQuery.FetchOptions property
TADQuery.FilterChanges property
TADQuery.FormatOptions property
TADQuery.Indexes property
TADQuery.IndexesActive property
TADQuery.IndexFieldNames property
TADQuery.IndexName property
TADQuery.LocalSQL property
TADQuery.MacroCount property
TADQuery.Macros property
TADQuery.MasterFields property
TADQuery.MasterSource property
TADQuery.OnCommandChanged event
TADQuery.OnError event
TADQuery.OnExecuteError event
TADQuery.OnMasterSetValues event
TADQuery.OnReconcileError event
TADQuery.OnUpdateError event
TADQuery.OnUpdateRecord event
TADQuery.Params property
TADQuery.ResourceOptions property
TADQuery.RowsAffected property
TADQuery.SchemaAdapter property
TADQuery.SQL property
TADQuery.Transaction property
TADQuery.UpdateObject property
TADQuery.UpdateOptions property
TADQuery.UpdateTransaction property
TADRdbmsDataSet class
Connection
ConnectionName
Disconnect
FetchOptions
FindMacro
FormatOptions
MacroByName
MacroCount
Macros
OnCommandChanged
OnError
Open
Open
Open
ParamBindMode
Prepare
Prepared
ResourceOptions
RowsAffected
SchemaAdapter
Transaction
Unprepare
UpdateOptions
UpdateTransaction
TADRdbmsDataSet.Connection property
TADRdbmsDataSet.ConnectionName property
TADRdbmsDataSet.Disconnect method
TADRdbmsDataSet.FetchOptions property
TADRdbmsDataSet.FindMacro method
TADRdbmsDataSet.FormatOptions property
TADRdbmsDataSet.MacroByName method
TADRdbmsDataSet.MacroCount property
TADRdbmsDataSet.Macros property
TADRdbmsDataSet.OnCommandChanged event
TADRdbmsDataSet.OnError event
TADRdbmsDataSet.Open method
TADRdbmsDataSet.ParamBindMode property
TADRdbmsDataSet.Prepare method
TADRdbmsDataSet.Prepared property
TADRdbmsDataSet.ResourceOptions property
TADRdbmsDataSet.RowsAffected property
TADRdbmsDataSet.SchemaAdapter property
TADRdbmsDataSet.Transaction property
TADRdbmsDataSet.Unprepare method
TADRdbmsDataSet.UpdateOptions property
TADRdbmsDataSet.UpdateTransaction property
TADResourceOptions class
ActualSilentMode
ArrayDMLSize
Assign
AssignedValues
Backup
BackupExt
BackupFolder
CmdExecMode
CmdExecTimeout
DefaultParamType
DefaultStoreExt
DefaultStoreFolder
DefaultStoreFormat
DirectExecute
EscapeExpand
MacroCreate
MacroExpand
ParamCreate
ParamExpand
Persistent
PreprocessCmdText
RestoreDefaults
SilentMode
StoreItems
StoreVersion
UnifyParams
TADResourceOptions.ActualSilentMode property
TADResourceOptions.ArrayDMLSize property
TADResourceOptions.Assign method
TADResourceOptions.AssignedValues property
TADResourceOptions.Backup property
TADResourceOptions.BackupExt property
TADResourceOptions.BackupFolder property
TADResourceOptions.CmdExecMode property
TADResourceOptions.CmdExecTimeout property
TADResourceOptions.DefaultParamType property
TADResourceOptions.DefaultStoreExt property
TADResourceOptions.DefaultStoreFolder property
TADResourceOptions.DefaultStoreFormat property
TADResourceOptions.DirectExecute property
TADResourceOptions.EscapeExpand property
TADResourceOptions.MacroCreate property
TADResourceOptions.MacroExpand property
TADResourceOptions.ParamCreate property
TADResourceOptions.ParamExpand property
TADResourceOptions.Persistent property
TADResourceOptions.PreprocessCmdText property
TADResourceOptions.RestoreDefaults method
TADResourceOptions.SilentMode property
TADResourceOptions.StoreItems property
TADResourceOptions.StoreVersion property
TADResourceOptions.UnifyParams property
TADSchemaAdapter class
TADScript class
AbortJob
AfterExecute
AfterScript
AllSpools
Arguments
BeforeExecute
BeforeScript
CallStack
Connection
CurrentCommand
EOF
ExecuteAll
ExecuteFile
ExecuteFile
ExecuteScript
ExecuteScript
ExecuteStep
FetchOptions
Finished
FormatOptions
LastSpoolFileName
Macros
OnConsoleGet
OnConsoleLockUpdate
OnConsolePut
OnError
OnGetText
OnHostCommand
OnPause
OnProgress
OnReleaseText
OnSpoolPut
Params
Position
ProcessedAfterCommit
ResourceOptions
ScriptDialog
ScriptOptions
SQLScriptFileName
SQLScripts
Status
TotalErrors
TotalJobDone
TotalJobSize
TotalPct10Done
Transaction
ValidateAll
ValidateStep
TADScript.AbortJob method
TADScript.AfterExecute event
TADScript.AfterScript event
TADScript.AllSpools property
TADScript.Arguments property
TADScript.BeforeExecute event
TADScript.BeforeScript event
TADScript.CallStack property
TADScript.Connection property
TADScript.CurrentCommand property
TADScript.EOF property
TADScript.ExecuteAll method
TADScript.ExecuteFile method
TADScript.ExecuteScript method
TADScript.ExecuteStep method
TADScript.FetchOptions property
TADScript.Finished property
TADScript.FormatOptions property
TADScript.LastSpoolFileName property
TADScript.Macros property
TADScript.OnConsoleGet event
TADScript.OnConsoleLockUpdate event
TADScript.OnConsolePut event
TADScript.OnError event
TADScript.OnGetText event
TADScript.OnHostCommand event
TADScript.OnPause event
TADScript.OnProgress event
TADScript.OnReleaseText event
TADScript.OnSpoolPut event
TADScript.Params property
TADScript.Position property
TADScript.ProcessedAfterCommit property
TADScript.ResourceOptions property
TADScript.ScriptDialog property
TADScript.ScriptOptions property
TADScript.SQLScriptFileName property
TADScript.SQLScripts property
TADScript.Status property
TADScript.TotalErrors property
TADScript.TotalJobDone property
TADScript.TotalJobSize property
TADScript.TotalPct10Done property
TADScript.Transaction property
TADScript.ValidateAll method
TADScript.ValidateStep method
TADScriptCommand class
AbortJob
Engine
EngineIntf
Execute
Help
Keywords
Parse
Parser
Position
Validate
TADScriptCommand.AbortJob method
TADScriptCommand.Engine property
TADScriptCommand.EngineIntf property
TADScriptCommand.Execute method
TADScriptCommand.Help method
TADScriptCommand.Keywords method
TADScriptCommand.Parse method
TADScriptCommand.Parser property
TADScriptCommand.Position property
TADScriptCommand.Validate method
TADScriptCommandRegistry class
AddCommand
Commands
Count
LookupCommand
TADScriptCommandRegistry.AddCommand method
TADScriptCommandRegistry.Commands property
TADScriptCommandRegistry.Count property
TADScriptCommandRegistry.LookupCommand method
TADScriptOptions class
Assign
AutoPrintParams
BreakOnError
CharacterSet
ClientLib
ColumnHeadings
CommandSeparator
CommitEachNCommands
ConsoleOutput
DefaultDataPath
DefaultScriptPath
DriverID
DropNonexistObj
EchoCommands
EchoCommandTrim
FeedbackCommands
FeedbackScript
FileEncoding
FileEndOfLine
IgnoreError
LineSize
MacroExpand
MaxStringWidth
PageSize
ParamArraySize
RaisePLSQLErrors
Reset
SpoolFileName
SpoolOutput
SQLDialect
Timing
TrimConsole
TrimSpool
Verify
TADScriptOptions.Assign method
TADScriptOptions.AutoPrintParams property
TADScriptOptions.BreakOnError property
TADScriptOptions.CharacterSet property
TADScriptOptions.ClientLib property
TADScriptOptions.ColumnHeadings property
TADScriptOptions.CommandSeparator property
TADScriptOptions.CommitEachNCommands property
TADScriptOptions.ConsoleOutput property
TADScriptOptions.DefaultDataPath property
TADScriptOptions.DefaultScriptPath property
TADScriptOptions.DriverID property
TADScriptOptions.DropNonexistObj property
TADScriptOptions.EchoCommands property
TADScriptOptions.EchoCommandTrim property
TADScriptOptions.FeedbackCommands property
TADScriptOptions.FeedbackScript property
TADScriptOptions.FileEncoding property
TADScriptOptions.FileEndOfLine property
TADScriptOptions.IgnoreError property
TADScriptOptions.LineSize property
TADScriptOptions.MacroExpand property
TADScriptOptions.MaxStringWidth property
TADScriptOptions.PageSize property
TADScriptOptions.ParamArraySize property
TADScriptOptions.RaisePLSQLErrors property
TADScriptOptions.Reset method
TADScriptOptions.SpoolFileName property
TADScriptOptions.SpoolOutput property
TADScriptOptions.SQLDialect property
TADScriptOptions.Timing property
TADScriptOptions.TrimConsole property
TADScriptOptions.TrimSpool property
TADScriptOptions.Verify property
TADSQLiteBackup class
Backup
BusyTimeout
Catalog
Database
DatabaseObj
DestCatalog
DestDatabase
DestDatabaseObj
DestMode
DestPassword
OnProgress
PageCount
PagesPerStep
Password
Remaining
WaitForLocks
TADSQLiteBackup.Backup method
TADSQLiteBackup.BusyTimeout property
TADSQLiteBackup.Catalog property
TADSQLiteBackup.Database property
TADSQLiteBackup.DatabaseObj property
TADSQLiteBackup.DestCatalog property
TADSQLiteBackup.DestDatabase property
TADSQLiteBackup.DestDatabaseObj property
TADSQLiteBackup.DestMode property
TADSQLiteBackup.DestPassword property
TADSQLiteBackup.OnProgress event
TADSQLiteBackup.PageCount property
TADSQLiteBackup.PagesPerStep property
TADSQLiteBackup.Password property
TADSQLiteBackup.Remaining property
TADSQLiteBackup.WaitForLocks property
TADSQLiteCollation class
Active
CollationKind
CollationName
Flags
Locale
OnCompare
TADSQLiteCollation.Active property
TADSQLiteCollation.CollationKind property
TADSQLiteCollation.CollationName property
TADSQLiteCollation.Flags property
TADSQLiteCollation.Locale property
TADSQLiteCollation.OnCompare property
TADSQLiteFunction class
Active
Aggregated
ArgumentsCount
FunctionName
OnCalculate
TADSQLiteFunction.Active property
TADSQLiteFunction.Aggregated property
TADSQLiteFunction.ArgumentsCount property
TADSQLiteFunction.FunctionName property
TADSQLiteFunction.OnCalculate property
TADSQLiteRTree class
Active
OnCalculate
RTreeName
TADSQLiteRTree.Active property
TADSQLiteRTree.OnCalculate property
TADSQLiteRTree.RTreeName property
TADSQLiteSecurity class
ChangePassword
CheckEncryption
Database
Options
Password
RemovePassword
SetPassword
ToPassword
TADSQLiteSecurity.ChangePassword method
TADSQLiteSecurity.CheckEncryption method
TADSQLiteSecurity.Database property
TADSQLiteSecurity.Options property
TADSQLiteSecurity.Password property
TADSQLiteSecurity.RemovePassword method
TADSQLiteSecurity.SetPassword method
TADSQLiteSecurity.ToPassword property
TADSQLiteService class
DriverLink
TADSQLiteService.DriverLink property
TADSQLiteValidate class
Analyze
CheckOnly
Database
MaxErrors
OnProgress
Options
Password
Sweep
TADSQLiteValidate.Analyze method
TADSQLiteValidate.CheckOnly method
TADSQLiteValidate.Database property
TADSQLiteValidate.MaxErrors property
TADSQLiteValidate.OnProgress event
TADSQLiteValidate.Options property
TADSQLiteValidate.Password property
TADSQLiteValidate.Sweep method
TADSQLScript class
Name
SQL
TADSQLScript.Name property
TADSQLScript.SQL property
TADSQLScripts class
Add
FindScript
Items
TADSQLScripts.Add method
TADSQLScripts.FindScript method
TADSQLScripts.Items property
TADSQLTimeIntervalField class
AsSQLTimeInterval
IntervalKind
TADSQLTimeIntervalField.AsSQLTimeInterval property
TADSQLTimeIntervalField.IntervalKind property
TADStoredProc class
ActiveStoredUsage
AfterApplyUpdates
AfterExecute
AfterGetRecord
AfterGetRecords
AfterRowRequest
Aggregates
AggregatesActive
BeforeApplyUpdates
BeforeExecute
BeforeGetRecords
BeforeRowRequest
CachedUpdates
CatalogName
Connection
ConnectionName
Constraints
ConstraintsEnabled
DetailFields
FetchOptions
FilterChanges
FormatOptions
Indexes
IndexesActive
IndexFieldNames
IndexName
LocalSQL
MasterFields
MasterSource
OnCommandChanged
OnError
OnExecuteError
OnReconcileError
OnUpdateError
OnUpdateRecord
Overload
PackageName
ParamBindMode
Params
ResourceOptions
SchemaAdapter
SchemaName
StoredProcName
Transaction
UpdateObject
UpdateOptions
UpdateTransaction
TADStoredProc.ActiveStoredUsage property
TADStoredProc.AfterApplyUpdates event
TADStoredProc.AfterExecute event
TADStoredProc.AfterGetRecord event
TADStoredProc.AfterGetRecords event
TADStoredProc.AfterRowRequest event
TADStoredProc.Aggregates property
TADStoredProc.AggregatesActive property
TADStoredProc.BeforeApplyUpdates event
TADStoredProc.BeforeExecute event
TADStoredProc.BeforeGetRecords event
TADStoredProc.BeforeRowRequest event
TADStoredProc.CachedUpdates property
TADStoredProc.CatalogName property
TADStoredProc.Connection property
TADStoredProc.ConnectionName property
TADStoredProc.Constraints property
TADStoredProc.ConstraintsEnabled property
TADStoredProc.DetailFields property
TADStoredProc.FetchOptions property
TADStoredProc.FilterChanges property
TADStoredProc.FormatOptions property
TADStoredProc.Indexes property
TADStoredProc.IndexesActive property
TADStoredProc.IndexFieldNames property
TADStoredProc.IndexName property
TADStoredProc.LocalSQL property
TADStoredProc.MasterFields property
TADStoredProc.MasterSource property
TADStoredProc.OnCommandChanged event
TADStoredProc.OnError event
TADStoredProc.OnExecuteError event
TADStoredProc.OnReconcileError event
TADStoredProc.OnUpdateError event
TADStoredProc.OnUpdateRecord event
TADStoredProc.Overload property
TADStoredProc.PackageName property
TADStoredProc.ParamBindMode property
TADStoredProc.Params property
TADStoredProc.ResourceOptions property
TADStoredProc.SchemaAdapter property
TADStoredProc.SchemaName property
TADStoredProc.StoredProcName property
TADStoredProc.Transaction property
TADStoredProc.UpdateObject property
TADStoredProc.UpdateOptions property
TADStoredProc.UpdateTransaction property
TADTable class
ActiveStoredUsage
AfterApplyUpdates
AfterGetRecord
AfterGetRecords
AfterRowRequest
Aggregates
AggregatesActive
BeforeApplyUpdates
BeforeGetRecords
BeforeRowRequest
CachedUpdates
CatalogName
Connection
ConnectionName
Constraints
ConstraintsEnabled
DetailFields
Disconnect
Exists
FetchOptions
FilterChanges
FormatOptions
GetCustomWhere
IndexFieldNames
IndexName
LocalSQL
MasterFields
MasterSource
OnCommandChanged
OnError
OnExecuteError
OnReconcileError
OnUpdateError
OnUpdateRecord
Open
RefireSQL
ResourceOptions
SchemaAdapter
SchemaName
TableName
Transaction
UpdateObject
UpdateOptions
UpdateTransaction
TADTable Questions
TADTable.ActiveStoredUsage property
TADTable.AfterApplyUpdates event
TADTable.AfterGetRecord event
TADTable.AfterGetRecords event
TADTable.AfterRowRequest event
TADTable.Aggregates property
TADTable.AggregatesActive property
TADTable.BeforeApplyUpdates event
TADTable.BeforeGetRecords event
TADTable.BeforeRowRequest event
TADTable.CachedUpdates property
TADTable.CatalogName property
TADTable.Connection property
TADTable.ConnectionName property
TADTable.Constraints property
TADTable.ConstraintsEnabled property
TADTable.DetailFields property
TADTable.Disconnect method
TADTable.Exists property
TADTable.FetchOptions property
TADTable.FilterChanges property
TADTable.FormatOptions property
TADTable.GetCustomWhere method
TADTable.IndexFieldNames property
TADTable.IndexName property
TADTable.LocalSQL property
TADTable.MasterFields property
TADTable.MasterSource property
TADTable.OnCommandChanged event
TADTable.OnError event
TADTable.OnExecuteError event
TADTable.OnReconcileError event
TADTable.OnUpdateError event
TADTable.OnUpdateRecord event
TADTable.Open method
TADTable.RefireSQL method
TADTable.ResourceOptions property
TADTable.SchemaAdapter property
TADTable.SchemaName property
TADTable.TableName property
TADTable.Transaction property
TADTable.UpdateObject property
TADTable.UpdateOptions property
TADTable.UpdateTransaction property
TADTopResourceOptions class
Assign
AutoConnect
AutoReconnect
BackupExt
BackupFolder
DefaultStoreExt
DefaultStoreFolder
DefaultStoreFormat
KeepConnection
MaxCursors
RestoreDefaults
ServerOutput
ServerOutputSize
TADTopResourceOptions.Assign method
TADTopResourceOptions.AutoConnect property
TADTopResourceOptions.AutoReconnect property
TADTopResourceOptions.BackupExt property
TADTopResourceOptions.BackupFolder property
TADTopResourceOptions.DefaultStoreExt property
TADTopResourceOptions.DefaultStoreFolder property
TADTopResourceOptions.DefaultStoreFormat property
TADTopResourceOptions.KeepConnection property
TADTopResourceOptions.MaxCursors property
TADTopResourceOptions.RestoreDefaults method
TADTopResourceOptions.ServerOutput property
TADTopResourceOptions.ServerOutputSize property
TADTransaction class
AfterCommit
AfterRollback
AfterStartTransaction
BeforeCommit
BeforeRollback
BeforeStartTransaction
Connection
Options
TADTransaction.AfterCommit event
TADTransaction.AfterRollback event
TADTransaction.AfterStartTransaction event
TADTransaction.BeforeCommit event
TADTransaction.BeforeRollback event
TADTransaction.BeforeStartTransaction event
TADTransaction.Connection property
TADTransaction.Options property
TADTxOptions class
AutoCommit
AutoStart
AutoStop
Changed
ClearChanged
DisconnectAction
EnableNested
Isolation
Params
ReadOnly
StopOptions
TADTxOptions.AutoCommit property
TADTxOptions.AutoStart property
TADTxOptions.AutoStop property
TADTxOptions.Changed property
TADTxOptions.ClearChanged method
TADTxOptions.DisconnectAction property
TADTxOptions.EnableNested property
TADTxOptions.Isolation property
TADTxOptions.Params property
TADTxOptions.ReadOnly property
TADTxOptions.StopOptions property
TADUpdateOptions class
Assign
AssignedValues
CheckReadOnly
CheckRequired
CheckUpdatable
CountUpdatedRecords
EnableDelete
EnableInsert
EnableUpdate
FastUpdates
FetchGeneratorsPoint
GeneratorName
LockMode
LockPoint
LockWait
ReadOnly
RefreshDelete
RefreshMode
RequestLive
RestoreDefaults
UpdateChangedFields
UpdateMode
UpdateNonBaseFields
TADUpdateOptions.Assign method
TADUpdateOptions.AssignedValues property
TADUpdateOptions.CheckReadOnly property
TADUpdateOptions.CheckRequired property
TADUpdateOptions.CheckUpdatable property
TADUpdateOptions.CountUpdatedRecords property
TADUpdateOptions.EnableDelete property
TADUpdateOptions.EnableInsert property
TADUpdateOptions.EnableUpdate property
TADUpdateOptions.FastUpdates property
TADUpdateOptions.FetchGeneratorsPoint property
TADUpdateOptions.GeneratorName property
TADUpdateOptions.LockMode property
TADUpdateOptions.LockPoint property
TADUpdateOptions.LockWait property
TADUpdateOptions.ReadOnly property
TADUpdateOptions.RefreshDelete property
TADUpdateOptions.RefreshMode property
TADUpdateOptions.RequestLive property
TADUpdateOptions.RestoreDefaults method
TADUpdateOptions.UpdateChangedFields property
TADUpdateOptions.UpdateMode property
TADUpdateOptions.UpdateNonBaseFields property
TADUpdateSQL class
Apply
Commands
Connection
ConnectionName
DeleteSQL
FetchRowSQL
InsertSQL
LockSQL
ModifySQL
SQL
UnlockSQL
TADUpdateSQL.Apply method
TADUpdateSQL.Commands property
TADUpdateSQL.Connection property
TADUpdateSQL.ConnectionName property
TADUpdateSQL.DeleteSQL property
TADUpdateSQL.FetchRowSQL property
TADUpdateSQL.InsertSQL property
TADUpdateSQL.LockSQL property
TADUpdateSQL.ModifySQL property
TADUpdateSQL.SQL property
TADUpdateSQL.UnlockSQL property
TADWideMemoField class
Value
TADWideMemoField.Value property
TADXMLField class
SchemaName
TADXMLField.SchemaName property
Tracing and Monitoring
U
uADCompClient namespace
uADCompClient.ADManager function
uADCompClient.ADSetConnectionClass function
uADCompClient.ADSetManagerClass function
uADCompDataSet namespace
uADCompGUIx namespace
uADCompScript namespace
uADMoniRemoteClient namespace
uADPhysADS namespace
uADPhysASA namespace
uADPhysDataSnap namespace
uADPhysDB2 namespace
uADPhysDBExp namespace
uADPhysIB namespace
uADPhysManager namespace
uADPhysMSAcc namespace
uADPhysMSSQL namespace
uADPhysMySQL namespace
uADPhysODBC namespace
uADPhysODBCBase namespace
uADPhysOracle namespace
uADPhysPG namespace
uADPhysSQLite namespace
uADPhysSQLiteVDataSet namespace
uADPhysTDBX namespace
uADPhysTDBXBase namespace
uADStanError namespace
uADStanOption namespace
uADStanOption.TADActionRequest enumeration
uADStanOption.TADAutoFetchAll enumeration
Unicode Support
Unique Identifying Fields
UnixODBC
Update Command Generation
Using Data Abstract with FireDAC
Using FireDAC
Using Oracle with FireDAC
Using SQLite with FireDAC
Utilities
V
Very High Performance using the Array DML
W
Working with Commands
Working with Connections
Working with DataSets
Working with DBMS
Working with Metadata
Writing Expressions
X
x Platform Development