Skip to main content
All docs
V25.2
  • VCL Backend: How to Use Firebird

    • 5 minutes to read

    Firebird is an open-source SQL relational database management system. You can connect TdxReport and TdxDashboardControl components to Firebird databases using the TdxBackendDatabaseSQLConnection component.

    Tip

    This guide uses the following sample Firebird database that ships with Firebird Server Components (Prerequisites):

    C:\Program Files\Firebird\Firebird_5_0\examples\empbuild\EMPLOYEE.FDB

    Prerequisites — Download & Install Firebird Server Components
    1. Download a supported Firebird server package (5.0.3, for example): https://firebirdsql.org/en/firebird-5-0
    2. Install all Firebird components:

      VCL Backend: Firebird Server Components

    Tip

    The Firebird component installer adds a set of examples to the following folder:

    C:\Program Files\Firebird\Firebird_5_0\examples\

    Configure & Build a RAD Studio App Project

    Create a new project and place TdxDashboardControl and TdxBackendDataConnectionManager components on a form.

    VCL Backend: Create a New ExpressDashboards-Powered Project

    Double-click the TdxBackendDataConnectionManager component on the form to open the Collection Editor dialog, click the Add button, and select the Database (SQL) option to create a TdxBackendDatabaseSQLConnection component:

    VCL Backend: Create an SQL Data Connection Component

    Configure the SQL Connection Component

    The previously added TdxBackendDatabaseSQLConnection component connects to the source Firebird database using a connection string. To configure this component and specify a valid connection string, add a TcxButton component to a form and handle the component’s OnClick event as demonstrated in the following code example: Specify a Firebird Connection String.

    Tip

    Alternatively, you can select the created TdxBackendDatabaseSQLConnection component in the Collection Editor and specify all required settings using the Object Inspector.

    Code Example: Specify a Firebird Connection String

    The following code example demonstrates an OnClick event handler that configures a TdxBackendDatabaseSQLConnection component used to access the EMPLOYEE.FDB test Firebird database and to display the Dashboard Designer dialog:

    uses
      dxDashboard.Control,  // Declares the TdxDashboardControl component
      dxBackend.ConnectionString.SQL;  // Declares the TdxBackendDatabaseSQLConnection component
    // ...
    
    procedure TMyForm.cxButton1Click(Sender: TObject);
    begin
      dxBackendDatabaseSQLConnection1.Active := False;  // Terminates the current connection (if one exists)
      // Specify a user-friendly data connection name (for end-user dialogs) and a valid connection string
      dxBackendDatabaseSQLConnection1.DisplayName := 'Firebird Database Connection';
      dxBackendDatabaseSQLConnection1.ConnectionString :=
    
        'XpoProvider=Firebird;' +  // Specifies the database engine type
        'Datasource=localhost;' +  // Specifies the database location (IP 127.0.0.1)
        'User=SYSDBA;' +  // Specifies a valid user name
        'Password=password;' +  // Specifies the corresponding password for the user names
        'Database=C:\Program Files\Firebird\Firebird_5_0\examples\empbuild\EMPLOYEE.FDB;' +
        'ServerType=0;Charset=NONE';  // Specifies additional parameters
    
      dxBackendDatabaseSQLConnection1.Active := True;  // Connects to the EMPLOYEE.FDB database
      dxDashboardControl1.ShowDesigner;  // Displays the Dashboard Designer dialog
    end;
    

    Deploy & Run the Test App

    Obtain & Deploy Dependencies

    1. Open the Firebird client NuGet package page and click Download package.
    2. Rename the downloaded firebirdsql.data.firebirdclient.10.3.4.nupkg file to firebirdsql.data.firebirdclient.10.3.4.zip and extract the archive.
    3. Navigate to the following folder: \firebirdsql.data.firebirdclient.10.3.4\lib et8.0\. Copy FirebirdSql.Data.FirebirdClient.dll.
    4. Create a dotnet_libraries folder in the project folder containing the built executable file and paste the copied file into dotnet_libraries.
    5. Place the WebView2Loader.dll file from the EdgeView2 SDK GetIt package into the project folder containing the built executable file.

    Run App & Test Database Connection

    Run the built executable file and click the previously added button to display the DevExpress Dashboard Designer dialog. Click the hamburger button, select the Data Sources item, and click the Add link in the DATA SOURCES pane:

    VCL Backend: Dashboard Designer - Data Sources Pane

    Click the Create data source… link in the Add Data Source modal dialog:

    VCL Backend: Dashboard Designer - Add Data Source

    Select Database in the Dashboard Data Source Wizard modal dialog and click Next:

    VCL Backend: Dashboard Designer - Data Source Wizard

    The wizard displays the created data connection component using its display name defined in the following code example: Specify a Firebird Connection String.

    VCL Backend: Dashboard Designer - The Created "Firebird Database Connection" Component

    Click Next and use the Run Query Builder… option:

    VCL Backend: Dashboard Designer - The Run Query Builder Option

    Expand the AVAILABLE TABLES AND VIEWS node to browse tables from the connected database:

    VCL Backend: Dashboard Designer - The Query Builder Populated with Firebird Database Tables

    If the AVAILABLE TABLES AND VIEWS node contains a list of tables from the sample EMPLOYEE.FDB database, the created Firebird connection is successful.

    Troubleshooting

    The Firebird Server service may conflict with Embarcadero InterBase services usually installed with a RAD Studio IDE. If the Query Builder dialog does not display any content from a Firebird database, do the following:

    1. Run the InterBase Server Manager tool (installed with InterBase Server components).
    2. Enable Manual startup mode and stop the InterBase server:

      VCL Backend: Stop Services in the Interbase Manager

    3. Open the Microsoft Windows Services manager and make certain that InterBase Server and InterBase Guardian services are stopped.

    4. Restart your test app and repeat all steps described in the following help topic section: Run App & Test Database Connection.

    Important

    Depending on Firebird and InterBase server versions, you may also need to reinstall Firebird server components from scratch once InterBase server services are stopped.

    See Also