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

Howard Lee Harkness howard.lee.harkness at gmail.com
Mon Jun 23 03:34:55 CEST 2008


Interesting... I tried your approach with MySQL, and I still could not get
edit to work. It appears to work in the grid, but stopping and re-starting
the program showed that nothing actually got edited.

Looks like I need to take your advice and try Postgresql. However, I won't
have any significant time to work on this project until next Sunday. Bummer.
I still have the vague suspicion that the problem is not with MySQL, but
with the TNavigator component. But if MySQL simply won't work with Lazarus,
it just won't work, and I don't need to spend the rest of the year running
into the same brick wall.

This is not the only project I have in mind, of course. It's just the first
step in a much larger project, for which I would like to make some money. So
the real solution may still be to actually buy some commercial development
tools. I really wanted to make a go of using all open-source stuff, but
first I need to find something that is ready for prime time.

Until I can write a trivial program that displays, inserts, deletes, and
edits records in a simple database table, I have no hope whatever of getting
any farther. So far, I have not seen any evidence that this is even possible
using Lazarus and MySQL (without writing 1000 lines of code to do all of the
SQL manipulation), so the next step is to evaluate another set of tools.

What I REALLY wanted was to be able to drop some components on a form
(connection, query, datasource, dbgrid, and dbnavigator), and link them
together with some properties, and have it work without writing a lick of
code -- just like I once did with Delphi 3 over a decade ago. So far,
Lazarus has not caught up with D3, much less D6.

Hmm... I need to spend some time looking for my old copy of D3 and see if it
will even run on XP.

On Sun, Jun 22, 2008 at 6:52 PM, John <jszcmpr at netspace.net.au> wrote:

> 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
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Howard Lee Harkness
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20080622/cf51d8ec/attachment-0007.html>


More information about the Lazarus mailing list