Inspecting the Update Status of Individual Rows

From RAD Studio
Jump to: navigation, search

Go Up to Connecting an ADO Dataset to a Data Store


Determine the update status of a given row by making it current and then inspecting the RecordStatus property of the ADO data component. RecordStatus reflects the update status of the current row and only that row.

 if (rsNew in ADOQuery1.RecordStatus) then
 begin
 ...
 end;
 else
 if (rsDeleted in ADOQuery1.RecordStatus) then
 begin
 ...
 else
 switch (ADOQuery->RecordStatus)
 {
   case rsUnmodified:
     StatusBar1->Panels->Items[0]->Text = "Unchanged record";
     break;
   case rsModified:
     StatusBar1->Panels->Items[0]->Text = "Changed record";
     break;
   case rsDeleted:
     StatusBar1->Panels->Items[0]->Text = "Deleted record";
     break;
   case rsNew:
     StatusBar1->Panels->Items[0]->Text = "New record";
     break;
 }

See Also

Code Examples