Forum > Databases

How to disconnect db controls


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. 

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.

Got it!  Thanks Sieben.


[0] Message Index

Go to full version