Data.Win.ADODB.TCustomADODataSet.DeleteRecords

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Unit: Data.Win.ADODB
Parent: TCustomADODataSet

Delphi

procedure DeleteRecords(AffectRecords: TAffectRecords = arAll);

C++

void __fastcall DeleteRecords(TAffectRecords AffectRecords = (TAffectRecords)(0x2));

Description

Deletes one or more records in the dataset.

Use DeleteRecords to delete one or more records from the recordset the ADO dataset component represents.

If the recordset does not support record deletions, an exception is raised. Use the Supports method to determine whether the recordset supports deleting records.

If the dataset was opened in batch update mode, the records are only marked for deletion. Apply the batch deletions by calling the UpdateBatch method. If the dataset is not in batch update mode, the records are immediately removed from the base table.

AffectRecords is a TAffectRecords constant that determines which records are deleted by DeleteRecords. The default value for the AffectRecords parameter is arAll, which causes all records in the recordset to be deleted.



Option Meaning

arCurrent

Only the deletes the current record.

arFiltered

Only deletes records accessible through the current filter.

arAll

Deletes all records in the recordset.

arAllChapters

Deletes records in all chapters (ADO chapters)



See Also