Lock Type adLockBatchOptimistic adLockOptimistic adLockPessimistic adLockReadOnly


Used for batch updates.

Records are locked only when the Recordset object's Update method is called. Other users can access and update the same row of data while you have it open.

Records are locked as soon as record editing begins. Other users can't access or modify the row of data until you have called the Recordset's Update or CancelUpdate methods.

Records are read only (default lock type).

Generally speaking, most VBA programmers need decide whether their database locks should be read only or not. As a rule of thumb, use the read-only lock type (adLockReadOnly) when you simply need to scroll forward through a result set without modifying its contents. If you need to perform any updates on the result set, an optimistic locking solution (adLockOptimistic) is sufficient.

0 0

Post a comment