GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  Visual Basic
Go To First  |  Previous Question  |  Next Question 
 Visual Basic  |  Question 357 of 453    Print  
How many cursor type and lock type in ADO.Give me Details answers.

  
Total Answers and Comments: 4 Last Update: January 03, 2007     Asked by: kulwant kumar 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 03, 2005 06:07:02   #1  
Gokul Tyagi        

RE: How many cursor type and lock type in ADO.Give me ...

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


 
Is this answer useful? Yes | No
March 22, 2006 03:07:46   #2  
Poonam        

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.
 
Is this answer useful? Yes | No
April 12, 2006 12:59:55   #3  
Jayashree .N Ragavan        

RE: How many cursor type and lock type in ADO.Give me ...

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


 
Is this answer useful? Yes | No
January 03, 2007 11:42:23   #4  
Mohammed yousuf uddin        

RE: How many cursor type and lock type in ADO.Give me ...

cursor types 4

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

Lock types 3

  1. pessimistic
  2. optimistic
  3. read only

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape