Connect to Firebird (FireDAC)

From Appmethod Topics
Jump to: navigation, search

Go Up to Database Connectivity (FireDAC)

This topic describes how to connect to Firebird database.

Supported Versions

The FireDAC native driver supports the Firebird server and the embedded editions version 1.5 and later. It does not officially support Jaffil.

To connect to InterBase, use the FireDAC InterBase driver.

Windows Client Software

FireDAC requires the following x86 or x64 client software to be installed on the workstation:

  • The FBCLIENT.DLL library to connect to the Firebird server. You can take it from a server (download) installation Bin folder.
  • The FBEMBED.DLL library to work with the database using the Firebird Embedded server (details).

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 in:

  • a folder listed in your PATH environment variable (for example, <Windows>\SYSTEM32).
  • your application EXE folder.
  • any other folder and specify in FDDrivers.ini:

If the Firebird client library has not been installed properly, an exception is raised when you try to connect:

[FireDAC][Phys][FB]-314. Cannot load vendor library [fbclient.dll]. The specified module could not be found.
Check [fbclient.dll], which is located in one of the PATH directories or in the application EXE directory.

Linux Client Software

FireDAC requires:

  • the 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/ /usr/lib/

Mac OS X Client Software

FireDAC requires:

  • the libfbclient.dylib x86 client library to connect to the Firebird server. You can take it from a server (download) installation /Library/Frameworks/Firebird.framework/Libraries folder.

Driver Linkage

To link the driver:

Connection Definition Parameters

To connect to the Firebird DBMS, most applications require you to specify DriverID, Protocol, Server, Database, User_Name, Password, and CharacterSet.

We strongly recommend you to explicitly set the CharacterSet to:

  • UTF8, if your application needs to support Unicode. For details, see Unicode Usage (FireDAC).
  • WIN1250 for Central Europe.
  • WIN1251 for Cyrillic.
  • WIN1252 for Western Europe, America.
  • and so on.


Parameter Description Example value

The database name to attach. The value can be:

  • database file path.
  • full database path, including server address.

For an embedded database, a path can include path variables.

  • C:\ib\ADDEMO_IB2007.IB
  • \\MySrv\C:\ib\ADDEMO_IB2007.IB

Controls authentication mode:

  • Yes -- use Windows authentication.
  • No -- use DBMS authentication. It is the default value.

For details, see the doc\README.trusted_authentication.txt.

User_Name The user name. sysdba
Password The user password. masterkey
CharacterSet The character set to use. WIN1252

Controls the extended description of the query result sets:

  • True -- FireDAC is getting column domain names additional to the other column attributes. If a column belongs to a domain with a name such as %BOOL%, it is described as dtBoolean. Also, if a table has an INSERT trigger that reads a single sequence and assigns its value to a single column, then this column is described as an auto-incrementing one. Setting this option to True slightly slows down a dataset opening.
  • False -- FireDAC uses the restricted information about the query columns. It is the default value.

The protocol used to connect to the DB server. It can 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 the Microsoft NetBIOS protocol.
  • SPX -- connect using the Novel SPX protocol.
  • TCPIP -- connect using the TCP/IP protocol.

If the Protocol parameter is specified, FireDAC builds full database paths, using the appropriate Protocol format and Server and Database parameter values.


The TCP/IP port on which the Interbase server is listening. By default, it is equal to gds_db defined in services. Normally it is equal to 3050. When gds_db is not defined, then set "Port" parameter to the required value.

Server Server address to connect to. The Server parameter value is used only if the Protocol parameter is specified. To specify a TCP/IP port number use the <host>/<port> notation.
  • my_host/3055
SQLDialect The SQL Dialect to use for connecting. Three is the default value. 1
RoleName The default role name. Admin

Controls the creation of a new database:

  • Yes -- create a new database file specified in the Database parameter, immediately after connecting to the server.
  • No -- do not create. It is the default value.

Controls the deletion of an existing database:

  • Yes -- drop the database file specified in the Database parameter, immediately after disconnecting from the server.
  • No -- do not drop. It is the default value.
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:
  • Connect to a database running on a remote server via TCP/IP protocol:
  • Connect to a local database:
  • Connect to a Firebird Embedded database:

Drop the TFDPhysFBDriverLink component to the form and set its VendorLib to <your path<\fbembed.dll or use a virtual driver definition.


See Also