Monday, April 26, 2010

Using lazarus ide with firebird in ubuntu lucid lynx

Start lazarus from command line or from main Menu Programming -> Lazarus

$sudo lazarus-ide or

SQLdb tab also contains a component TIBConnection that you can place it on the form





we will connect to /var/lib/firebird/2.1/data/employee.fdb



On the form put an TIBConnection, TSQLTransaction,TSQLQuery,TDatasource and an TDBGrid
























TIBConnection is configured to have DatabaseName=/var/lib/firebird/2.1/data/employee.fdb



Password=masterkey



Username=sysdba



and Transaction=SQLTransaction1



You can put it to be Connected = True







Then configure SQLTransaction1



to use




Database=IBConnection1



Active =True;










Configure TSQLQuery  this way




Database:IBConnection1



SQL=select * from employee;



Active = True;











Configure TDatasource



DataSet=SQLQuery1






Configure TDBGrid




DataSource = DataSource1










Next you can put an button and make them active from run time





procedure TForm1.Button1Click(Sender: TObject);
begin
SQLQuery1.Active:=true;
end;













ps: screenshots are from a previous article and by default now lazarus usese gtk2 so it looks nicer than the above ones

2 comments:

Gintas said...

Thanks for nice example,but I wonder how to read RFT/TXT files from Firebird database and display on simple TRichText component ?

Popa Adrian Marius said...

I will try to write an example today