Lazarus

Programming => Databases => Topic started by: Bert_Plitt on November 29, 2021, 08:21:47 pm

Title: How to disconnect db controls
Post by: Bert_Plitt on November 29, 2021, 08:21:47 pm
I'm running sqlite3 with Lazarus in Windows 10.  I have a form with several db controls connected to various fields of dbTable1, plus the form contains a TSQLite3, TSQLTransaction, TDataSource, and a TSQLQuery.  My app sequentially steps through the table from first record to last record.  At each record, I query the table, read the data, and then step to the next record.  At the end of the sequence, I'll need to re-connect the controls. 

I remember seeing a code example to do the above using a try/finally construct, but cannot find it anymore.  Can anyone provide some code that disconnects the controls from the table so that they do not display the changing values until the end of the query. 
Title: Re: How to disconnect db controls
Post by: Sieben on November 29, 2021, 08:27:40 pm
I think you are looking for TDataSet or in your case TSQLQuery methods DisableControls / EnableControls. But you might as well want to consider a second dataset for your iterations.
Title: <SOLVED> Re: How to disconnect db controls
Post by: Bert_Plitt on November 30, 2021, 03:21:31 am
Got it!  Thanks Sieben.
TinyPortal © 2005-2018