How many cursor type and lock type in ADO.Give me Details answers.

Showing Answers 1 - 4 of 4 Answers

Gokul Tyagi

  • Nov 3rd, 2005
 

There are 4 types of cursors in ADO which are Dynamic,Keyset,Static and Forward only.

There are 4 types of locks in ADO which are Optimistic, Pessimistic, Batch Optimistic and Read only

  Was this answer useful?  Yes

Poonam

  • Mar 22nd, 2006
 

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.

  Was this answer useful?  Yes

Jayashree .N Ragavan

  • Apr 12th, 2006
 

There are 4 cursor types:

Cursor TypeDescription
adOpenForwardOnlyThis 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.
adOpenKEysetThis 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. 
adOpenDynamicThis 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.
adOpenStaticThe static cursor is useful when we have a small recorset.

There are 4 Lock types:

Lock TypeDescription
adLockReadonlythis lock mode is used when no additions, updates or deletions are allowed from recordset
adLockPesimisticIn pessimistic locking, the record is locked as soon as editing begins and remains  locked until editing is completed.
adLockOptimisticthis 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 
adLockBatchOptimisticThis option allows us to perform optimistic locking when we are updating a batch of records

  Was this answer useful?  Yes

Mohammed yousuf uddin

  • Jan 3rd, 2007
 

cursor types  4

  1. dynamic
  2. static
  3. keyset
  4. forward only

Lock types 3

  1. pessimistic
  2. optimistic
  3. read only

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions