I thought this would be simple but don't see a function that clears all records from the dataset of a TDataSource. Any ideas?
Asked
Active
Viewed 996 times
-1
-
What kind of dataset? Some support that operation, some don't. – Ken White Jul 17 '15 at 15:13
2 Answers
1
There is no such function. You have to step through all records.
while ds.RecordCount>0 do
ds.delete;

user3640611
- 87
- 2
- 10
0
try clear the DataSet with EmptyDataSet.. Example... ds.EmptyDataSet;
-
1This is only available for a `TClientDataSet`, and the poster has not indicated that a ClientDataSet is being used. – Ken White Jul 17 '15 at 15:22