3.3. Path to the Client Library
We will place the necessary library in the fbclient
folder located in the application folder and use the following code for the OnCreate event of the data module:
xAppPath := ExtractFileDir(Application.ExeName) + PathDelim;
FDPhysFBDriverLink.VendorLib := xAppPath + 'fbclient' + PathDelim + 'fbclient.dll';
Important notes about “bitness” If you compile a 32-bit application, you should use the 32-bit Along with the file For the application to show internal firebird errors correctly, it is necessary to copy the file
|
3.3.1. Developing for Embedded Applications
If you need your application to run without the installed Firebird server, i.e. in the Embedded mode, for Firebird 2.5 you should replace fbclient.dll
with fbembed.dll
. Make sure the width of the CPU register (64-bit or 32-bit) matches the application. If necessary, the name of the library can be placed in the configuration file of your application.
It is not necessary to change anything for Firebird 3.0, in which the working mode depends on the connection string and the value of the Providers
parameter in the file firebird.conf/databases.conf
.
TIP Even if your application is intended to work with Firebird in the Embedded mode, it is advisable to attach to the full server during development. The reason is that embedded Firebird runs in the same address space as the application and any application connecting to a database in embedded mode must be able to obtain exclusive access to that database. Once that connection succeeds, no other embedded connections are possible. When you are connected to your database in the Delphi IDE, the established connection is in Delphi’s application space, thus preventing your application from being run successfully from the IDE. Note, Firebird 3 embedded still requires exclusive access if the installed full server is in Super (Superserver) mode. |