RE: How many cursor type and lock type in ADO.Give me ...
Cursor type Static cursor- This is the one to use for generating reports or finding data. Additions changes or deletions by other users are not visible.(adOpenStatic)Forward-only cursor- This is the default. It is identical to the Static except that you can only scroll forward. (adOpenForwardOnly)Dynamic cursor- Additions and deletions by others are visible. All movement is supported. But some providers don't support this cursor type(adOpenDynamic)Keyset-driven cursor- This is similar to a Dynamic cursor except you can't see records others add. If another user deletes a record it is inaccessible from your recordset. (adOpenKeyset)Lock TypeadLockReadOnly-A read-only lock is the most efficient when accessing data as there is no checking for data changes and therefore no extra traffic between the client and server while loading records.adLockOptimistic-With an optimistic lock the table or row locks will occur when the update method of the recordset object is called.adLockBatchOptimistic-When UpdateBatch is called all changes will be pushed to the server in a group. This can make the bulk insert of a large number of records more efficient. adLockPessimistic-In a situation of high concurrency with multiple users modifying the same data you may need a pessimistic lock type. With asLockPessimistic the underlying rows (or table) will be locked as soon as you begin making changes to the current record and will not be unlocked until the Update method is called.
RE: How many cursor type and lock type in ADO.Give me ...
There are 4 cursor types:
Cursor Type
Description
adOpenForwardOnly
This type of cursor can only be used to move forward through the recordset. This option is used when a list box or combo box is to be populated.
adOpenKEyset
This is the best type of cursor to use when we expect a large recordset because we are not informed when changes are made to data that can affect our recordset.
adOpenDynamic
This cursor allows us to see all the changes made by other users that affect our recordset. It is the most powerful type of cursor but the slowest one.
adOpenStatic
The static cursor is useful when we have a small recorset.
There are 4 Lock types:
Lock Type
Description
adLockReadonly
this lock mode is used when no additions updates or deletions are allowed from recordset
adLockPesimistic
In pessimistic locking the record is locked as soon as editing begins and remains locked until editing is completed.
adLockOptimistic
this occurs when the update method is called on the record. the record is unlocked even while edit but is temporarily locked when the changes are saved to the database
adLockBatchOptimistic
This option allows us to perform optimistic locking when we are updating a batch of records