From RAD Studio API Documentation
Jump to: navigation, search


TADOLockType = (ltUnspecified, ltReadOnly, ltPessimistic, ltOptimistic,


enum DECLSPEC_DENUM TADOLockType : unsigned char { ltUnspecified, ltReadOnly, ltPessimistic, ltOptimistic, ltBatchOptimistic };


Type Visibility Source Unit Parent
enum public
Data.Win.ADODB Data.Win.ADODB


TADOLockType specifies the types of locks used.

Use TADOLockType with execution methods to specify the types of record locks used during editing. Lock type values allow you to specify whether the locking scheme used for a recordset is optimistic or pessimistic. To use a specific locking scheme, the provider and database type must support that locking scheme. Use ltUnspecified to have the provider use the default locking scheme. Use the LockType ltBatchOptimistic to open a recordset in batch update mode.

In addition to use as command execution method parameters, TADOLockType values are passed as var parameters to event handlers related to execution. This value indicates the lock type already in use when the execution was initiated. The LockType parameter of the TADOConnection. ::OnWillExecute event is an example of this.

The constants that make up the TADOLockType type correspond directly to the LockTypeEnum values with similar names. These values are discussed in the Microsoft Data Access SDK help, in the topic for the LockType property of the ADO Recordset object. See the SDK for additional information on the ADO constants and their effects.

TADOLockType consists of the five constants summarized in the following table:

Lock Type Meaning


A specific lock type has not been specified or determined.


Read-only; the current execution cannot modify data.


Pessimistic locks; locks instantiated on a record-by-record basis when edit mode is applied to a record.


Optimistic locks; locked are initiated on a record-by-record basis, but only when updates are applied and a record is being updated.


Optimistic batch updates; used for batch update mode rather than immediate update mode.

See Also