Emptying TBufDataSet lazarus / 16-Databases ---------------------------------------------------------------------- egsuh · 2018-01-12 15:25 Hi, TBufDataSet does not have any methods like EmptyTable or EmptyDataSet. So I wrote a quick procedure as follows: procedure EmptyDataSet(ADataSet:TDataSet); begin    ADataSet.Active := True;    ADataSet.First;    While not ADataSet.Eof do ADataSet.Delete;    ADataSet.Close; end; This works fine for my purpose for now. But I'd like to ask you whether this procedure is applicable to all other datasets, and does not have any problem (which I don't know).  Also welcome any other suggestions for this purpose. Regards, ---------------------------------------------------------------------- balazsszekely · 2018-01-12 15:43 Use a query, like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  SQLQuery1.SQL.Text := 'delete from Your_TableName'; SQLQuery1.ExecSQL; //commit ---------------------------------------------------------------------- Leledumbo · 2018-01-13 17:11 Quote from: GetMem on January 12, 2018, 04:43:33 pmUse a query, like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  SQLQuery1.SQL.Text := 'delete from Your_TableName'; SQLQuery1.ExecSQL; //commitIf rollback is not needed, truncate table actually works a lot faster.