RAD Studio VCL Reference
|
Generates single-table commands as part of the operation of the TAdoDbxDataAdapter.
TAdoDbxCommandBuilder = class(DbCommandBuilder);
class TAdoDbxCommandBuilder : public DbCommandBuilder;
Borland.Data.AdoDbxClientProvider
The TAdoDbxCommandBuilder class is used to automatically generate single-table commands to reconcile changes made to a DataSet with its underlying database.
TAdoDbxCommandBuilder implements the ADO.NET DbCommandBuilder class.
You can generate SQL commands based on the SelectCommand property, which you must set prior to executing any of the other TAdoDbxCommandBuilder methods. The results of the SelectCommand are used to return metadata that is then used to construct the arguments to the InsertCommand, UpdateCommand, or DeleteCommand properties of TAdoDbxDataAdapter. If you want to achieve greater performance, you might want to consider using direct commands, rather than using the TAdoDbxCommandBuilder.
If you review the SQL statements generated for the UpdateCommand and DeleteCommand, you see that they each contain a WHERE clause that specifies that the row can only be updated if it contains all original values and hasn't been deleted from the database. Records are not locked and therefore the TAdoDbxCommandBuilder operates on the basis of optimistic concurrency. If you try to update or delete a record that has been changed by another user, the operation throws a DBConcurrencyException.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|