clearfields lazarus / 16-Databases ---------------------------------------------------------------------- mangakissa · 2014-02-27 14:11 There's a property called TBufdataset.clearfields. But I see my DBGrid not empty. If I fill the TBufdataset with data again, the old results still remains. Code: [Select]begin   try     BFStatistiek.DisableControls;     if BFStatistiek.Active then       BFStatistiek.ClearFields;     ..........   finally     BFStatistiek.EnableControls;   end; end; Lazarus 1.0.12/ FPC 2.62 windows Vista 32 ---------------------------------------------------------------------- kpeters58 · 2014-02-27 23:58 Clearfields is a method and not a property and I have a feeling that your expectations are wrong: http://lazarus- ccr.sourceforge.net/docs/fcl/db/tdataset.clearfields.html Are you trying to clear all rows from your dataset or what is your intention? ---------------------------------------------------------------------- mangakissa · 2014-02-28 07:16 Yes. I can delete all rows by calling TBufdataset.delete by row, but is that's not a proper (my opinion)  way to do. If the dataset is filled and other data must be find, the dataset must be empty. ---------------------------------------------------------------------- LacaK · 2014-02-28 11:19 Do you use TBufDataset as local dataset only ? How do you add rows into it ? (do you use CreateDataset and then Append or so ?) You can close dataset and data are gone ... No ClearFields does not remove rows, but clears Fields (Columns) in active record. ---------------------------------------------------------------------- mangakissa · 2014-02-28 16:08 QuoteDo you use TBufDataset as local dataset only ?Yes QuoteHow do you add rows into it ? (do you use CreateDataset and then Append or so ?)TBufdataset.appendRecord() QuoteYou can close dataset and data are gone ...I didn't know that. In Delphi I work with virtualtable. closing this component doesn't remove all data. I shall close and reopend the TBufdataset.