Applying the Batch Updates to Base Tables

From RAD Studio
Jump to: navigation, search

Go Up to Using Command Objects


Apply pending data changes that have not yet been applied or canceled by calling the UpdateBatch method. Rows that have been changed and are applied have their changes put into the base tables on which the recordset is based. A cached row marked for deletion causes the corresponding base table row to be deleted. A record insertion (exists in the cache but not the base table) is added to the base table. Modified rows cause the columns in the corresponding rows in the base tables to be changed to the new column values in the cache.

Used alone with no parameter, UpdateBatch applies all pending updates. A TAffectRecords value can optionally be passed as the parameter for UpdateBatch. If any value except arAll is passed, only a subset of the pending changes are applied. Passing arAll is the same as passing no parameter at all and causes all pending updates to be applied. The example below applies only the currently active row to be applied:

Delphi:

ADODataSet1.UpdateBatch(arCurrent);

C++:

ADODataSet1->UpdateBatch(arCurrent);

See Also