Reference: Rs. open SQL, Conn, A, B A: adopenforwardonly (= 0) read-only, and the current data record can only be moved downward adopenkeyset (= 1) read-only, the current data record can be freely moved to adopendynamic (= 2) and read/write. The current data record can be freely moved to adopenstatic (= 3) and read/write. The current data record can be freely moved, we can see that the new record B: adlockreadonly (= 1) is of the default lock type. The record set is read-only and the record adlockpessimistic (= 2) cannot be modified. When the record is modified, the data provider attempts to lock the record to ensure successful record editing. You only need to edit the record at the beginning, and lock the record immediately. Adlockoptimistic (= 3) Optimistic Locking is performed until the update record is submitted using the update method. Adlockbatchoptimistic (= 4) supports 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 choice, because the record is locked for only a short period of time, and the data is updated during this period of time. This reduces resource usage. To sum up, SQL, Conn, and indicate that update is not allowed and are generally used for query operations. SQL, Conn, 1, 3 indicates that update is allowed. It is generally used for insert, update, and delete operations.
Reference: 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) can be read and written, and the current data records can be freely moved
Adopenstatic (= 3) can be read and written. The current data record can be moved freely. 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 is performed until the update record is submitted using the update method.
Adlockbatchoptimistic (= 4) supports 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 choice, because the record is locked for only a short period of time, and the data is updated during this period of time. This reduces resource usage.
Summary:
SQL, Conn, indicates that updates are not allowed and are generally used for query operations.
SQL, Conn, 1, 3 indicates that update is allowed. It is generally used for insert, update, and delete operations.