Rs. Open SQL, Conn, a, B
A:
Adopenforwardonly (= 0)
Read-only, and the current data record can only be moved down
Adopenkeyset (= 1)
Read-only, the current data records can be freely moved
Adopendynamic (= 2)
Read/write: The current data records can be freely moved.
Adopenstatic (= 3)
Read/write: The current data record can be freely moved. You can see the new record.
B:
Adlockreadonly (= 1)
Default lock type. The record set is read-only and cannot be modified.
Adlockpessimistic (= 2)
Pessimistic locking: When a record is modified, the data provider attempts to lock the record to ensure that the record is edited successfully. You only need to edit the record at the beginning, and lock the record immediately.
Adlockoptimistic (= 3)
Optimistic Locking: The record is locked only when an update record is submitted using the update method.
Adlockbatchoptimistic (= 4)
Optimistic Locking in batches. Multiple records can be modified. Records are locked only after the updatebatch method is called.
When no record needs to be modified, the read-only record set should be used, so that the provider does not need to perform any detection.
For general use, Optimistic Locking may be the best option, because the record is locked for only a short period of time,
The data is updated during this period. This reduces resource usage.