RS.OPEN SQL,CONN,A,B
A:
ADOPENFORWARDONLY(=0)
Read-only, and the current data record can only be moved downward
by ADOPENKEYSET (=1)
Read only, the current data record can be moved freelyADOPENDYNAMIC
(=2)
Readable and writable, the current data record can be moved freely
ADOPENSTATIC (=3)
It can be read and written, the current data record can be moved freely, and the new record B can be seen
:
ADLOCKREADONLY(=1)
The default lock type, the record set is read-only, and records cannot be modified
ADLOCKPESSIMISTIC (=2)
Pessimistic locking, when a record is modified, the data provider will try to lock the record to ensure that the record is successfully edited. As soon as editing begins, the record is locked.
ADLOCKOPTIMISTIC(=3)
Optimistic locking does not lock the record until the updated record is submitted using the Update method.
ADLOCKBATCHOPTIMISTIC(=4)
Batch optimistic locking allows multiple records to be modified, and the records are locked only after the UpdateBatch method is called.
When no records need to be modified, a read-only recordset should be used so that the provider does not need to do any detection.
For general use, optimistic locking is probably the best option, since records are only locked for a short period of time, during which time the data is updated. This reduces resource usage.