Preparing a FireDAC Application for Run Time

From RAD Studio
Jump to: navigation, search

Go Up to FireDAC


This topic explains the use of the TFDGUIxWaitCursor component and the TFDPhys*DriverLink family of components in a FireDAC application.

General

FireDAC has a loosely-coupled multilayered architecture, where layers provide services. A service API is defined as a COM interface that other layers can request using the interface factory.

To properly operate FireDAC, you must link the implementation of some interfaces to the application.

IFDGUIxWaitCursor Interface

FireDAC is using the IFDGUIxWaitCursor interface to provide feedback to the end-user (using an hourglass cursor).

Use the TFDGUIxWaitCursor component to add the IFDGUIxWaitCursor interface implementation to your application. This implementation is required for FireDAC applications.

The TFDGUIxWaitCursor Provider property allows the user to select the GUIx component implementation.

Value

Description

Forms

VCL-based implementation for Delphi / C++Builder in FireDAC.VCLUI.Wait unit.

FMX

FireMonkey-based implementation for Delphi / C++Builder XE2 and higher in FireDAC.FMXUI.Wait unit.

Console

Console-based implementation in FireDAC.ConsoleUI.Wait unit.


After you set the Provider property at design time and save the form, the corresponding implementation unit is automatically added to the uses section of the form. At run time, you need to manually add the corresponding implementation unit to the uses section. If the corresponding implementation is not linked to the application, an exception is raised.

FDGUIxWaitCursor.png

Note: The exception message specifies the unit that must be included into your project in order to link the standard interface implementation.

If the Provider property changes its value, then the user needs to delete the implementation units for the old Provider value from the uses sections. For example, switching from Forms to FMX requires to delete the FireDAC.FMXUI.Wait unit.

The default value for the Provider property is FMX for FireMonkey-based applications, Console for Windows console applications, and Forms otherwise.

IFDPhysDriver interface

FireDAC drivers implement the IFDPhysDriver interface. These drivers are identified by the DriverID parameter.

Use the various TFDPhys*DriverLink components to add the IFDPhysDriver interface implementation to your application. This implementation is required for FireDAC applications.

The TFDPhysDriverLink component is a base class for all driver link components. TFDPhysDriverLink implements the ability to:

An application should not use the TFDPhysDriverLink component directly. But you can use one of the many descendants of TFDPhysDriverLink, such as:

If you add the TFDPhysIBDriverLink component to your application and save the changes, FireDAC.Phys.IBBase and FireDAC.Phys.IB units are automatically added to the uses section of the form. These units are mandatory for the IB driver and must always be linked to the application. Otherwise, the following exception is raised:

PhysIBDriverLink.png

Note: The exception message specifies the unit that must be included into your project in order to link the standard interface implementation.

See Also