[Lazarus] How to do insert/update and select on database

Darius Blaszyk dhkblaszyk at gmail.com
Mon Jun 3 14:21:22 CEST 2019


Op zo 2 jun. 2019 om 22:55 schreef Michael Van Canneyt via lazarus <
lazarus at lists.lazarus-ide.org>

>
>
> On Sun, 2 Jun 2019, Darius Blaszyk via lazarus wrote:
>
> > Hi,
> >
> > I'm new to database programming with Lazarus. So hence possible a couple
> of
> > obvious questions!
> >
> > I would like to do inserts, selects, and updates on a single SQLite
> > database. I am now using multiple SQLQuery components with all their own
> > queries. Is this the way it should work?
>
> It is one way to work. I usually do the same.
>
> > After a commit, the SQLQuery that populates the DBGrid is closed. Is this
> > supposed to happen? The transaction component is set to
> caCommitRetaining.
> > I believe I read somewhere that it should remain open in that case.
>
> No, this is not what it means. You should avoid caCommitRetaining.
>
> There is an option on TSQLQuery, sqoKeepOpenOnCommit
>
> Documented here:
>
>
> https://docs.freepascal.org/docs-html/current/fcl/sqldb/tsqlquery.options.html
>
> It does what you want.


Thanks. As always good and to the point advice!

Regards, Darius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190603/0192f240/attachment.html>


More information about the lazarus mailing list