[Lazarus] Advice about creating database-aware application with Lazarus

John jszcmpr at netspace.net.au
Mon Jun 23 02:52:31 CEST 2008


Howard Lee Harkness wrote:
> Hmmm... looks like TDBF doesn't have any way to load my tables without 
> writing yet another program. And dBase tables? I think I will check 
> out SQLite first. I picked on MySQL by recommendation from some folks 
> telling me how it was a mature db with all of the features I was used 
> to from working with Oracle. It was certainly easier to set up than 
> FireBird -- and better documented.
>
> I suppose also that I could write all of the insert/delete/edit code, 
> but I didn't have to do that in Delphi 10 years ago. The DbNavigator 
> just worked with no additional code at all.
>
If you come from an Oracle background, consider Postgresql.  I had an 
Oracle background too, and felt immediately at home with PG.  On the 
other hand, dBase tables work fine for simple, single user tables, with 
less fuss than  SQL.  It depends on what you are trying to do.

I admit I always use an external tool to build the tables.  In 
postresql, pgadmin; for dbase tables an old copy of DBase it self (yes, 
I have one!) or DBD from Dephi.
 
Also, since I am writing, in looking through your last example or two, 
there doesn't seem to be any transaction.commit ?  This is needed in PG, 
I presume in MySQL as well.

My basic test database program had a PQConnection, SQLTranaction, 
SQLQuery (select * from ...), and the usual set of data-aware controls - 
grid, navigator, edit fields, etc - connected to the query, all set up 
at design time as you would in Delphi.  The only code was in a 'commit' 
button:

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  SQLQuery1.ApplyUpdates;
  SQLTransaction1.CommitRetaining;
end;

cheers,
John Sunderland



More information about the Lazarus mailing list