Friday, 9 May 2014

How to create database connection with Firebird in Delphi using FIBPLUS components?

How to create database connection with Firebird in Delphi using FIBPLUS components?

I am using Firebird 2.5.2 with Delphi XE4. I will show you how to create a database connection with Firebird database in Delphi XE4 using FIBPLUS component? Just go into the Tool Palette and search for TpFIBDatabase component under FIBPLUS. Drag it into the form and name it. I have given "dbMyDatabase" name to TpFIBDatabase database component. If you see your pas file, a declaration for TpFIBDatabase will look like this:

dbMyDatabase: TpFIBDatabase;

Now create a function "ConnectToDatabae" with return type boolean. This function will return true if Firebird database connection is established successfully otherwise false.

function TMyForm.ConnectToDatabase : boolean; 
  result := False;
      with dbMyDatabase do
        DBName := 'C:\MyProject\MyDB.FDB';
ConnectParams.UserName := 'SYSDBA';
ConnectParams.Password := 'masterkey';
LibraryName := 'C:\Program Files(86)\Firebird\Firebird_2_5\bin\fbclient.dll'; 
Connected := True;
     result := True;
`     result := False;
    dbMyDatabase.Connected := False;

In the above function, I have set different properties of TpFIBDatabase component like DBName, Username, Password, LibraryName etc as following:

DBName := 'C:\MyProject\MyDB.FDB'; //MyDB is the firebird database name
ConnectParams.UserName := 'SYSDBA'; //Default username of firebird database
ConnectParams.Password := 'masterkey'; //Default password of firebird database
LibraryName := 'C:\Program Files(86)\Firebird\Firebird_2_5\bin\fbclient.dll'; //Default library path of firebird database

Note: You can set all these properties at design time in your dfm file. But I would recommend to write all these settings in your pas file.

After setting the above properties, I have set connected property to true. If Firebird database connection is established successfully, above function will return true otherwise false. Finally, I am disconnecting the database.


  1. Burberry Outlet Air Max Shoes Coach Black Friday Coach Black Friday Coach Cyber Monday Coach Factory Coach Outlet Factory Coach Outlet USA Coach Purses Factory Coach Purses USA Coach Store Outlet Coach Purses On Sale Monster Beats Outlet Louis Vuitton Outlet Louis Vuitton Factory Marc Jacobs On Sale MCM Outlet MCM 店铺 cheap oakley sunglasses Michael Kors Outlet Michael Kors Outlet Michael Kors Factory Michael Kors Outlet Michael Kors Factory Online Coach Factory Outlet North Face Outlet Online Polo Outlet Store Ralph Lauren UK Sac Longchamp Pairs Coach Outlet Online Coach Factory Oultet Barbour Jackets Outlet Online Canada Goose Outlet Gucci Outlet Online Michael Kors Outlet Moncler Clearance Moncler Jackets Outlet Online North Clearace Outlet Polo Ralph Lauren Outlet Online Woolrich Clearance Michael Kors Factory Outlet Coach Outlet Online USA Beats by Dre Coach Purses Outlet Online Michael Kors USA

  2. Useful information. Fortunate me I found your site by accident, and I am surprised why this coincidence didn’t took place earlier! I bookmarked it.