Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 28-11-2009
Member
 
Join Date: Jan 2009
Posts: 65
Types of Cursors in ADODB

Hi, can anyone give me information about the Cursors in ADODB? I don't know anything about it. I am a student of BSC.I.T. and we don't have this in our syllabus. And one of my interview interviewer ask me about the cursors in ADODB and I kept silent. Can anyone give me details about it?
Reply With Quote
  #2  
Old 28-11-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: Types of Cursors in ADODB

Hi friend, Basically we have four types of cursors in ADODB. Which are as follows:

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

You need to improve your knowledge with the help of different books which are in market or you can get pdf files from the internet and use those for reading.
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
  #3  
Old 28-11-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Types of Cursors in ADODB

Hi, there are four types of cursors are available in ADODB, which are as follows:

1.Dynamic Recordsets - This allows viewing the result of add, modify & delete by other users.
2.Keyset Recordsets - This is similar as Dynamic recordset but prevents looking the changes by the other users.
3.Static Recordsets - It provides the static copy of a set of records to find data or generate reports.
4.Forward-only - This improves performance. It behaves identical to a
static recordset and allows forward-only.
Reply With Quote
  #4  
Old 28-11-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: Types of Cursors in ADODB

Hi, In ADO there are 4 different cursor types defined:
  • Dynamic cursor - Allows you to see additions, changes, and deletions by other users.
  • Keyset cursor - Like a dynamic cursor, except that you cannot see additions by other users, and it prevents access to records that other users have deleted. Data updation can be visible.
  • Static cursor - Provides a static copy of a recordset for you to use to find data or generate reports.
  • Forward-only cursor - Allows you to only scroll forward through the Recordset. Additions, changes, or deletions by other users will not be visible.

You can set the cursor type with the help of CursorType property or by the CursorType parameter in the Open method.
Reply With Quote
  #5  
Old 28-11-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Types of Cursors in ADODB

Hi, you want the details about the Types of Cursors in ADODB. You need to use the simple cursor that provides the required data access. You need to make choice of cursor type depending upon the use of result set. For just scrolling your data use a forward-only or static cursor. If you have a large result set and need to select just a few rows, use a keyset cursor. If you want to synchronize a result set with recent adds, changes, and deletes by all concurrent users, use a dynamic cursor.

Types of Cursors in ADODB:
  • Forward-Only Cursors
  • Static Cursors
  • Keyset Cursors
  • Dynamic Cursors

Syntax:
Code:
objRecordset.CursorType
Example:
Code:
<%
set connect=Server.CreateObject("ADODB.Connection")
connect.Provider="Microsoft.Jet.OLEDB.4.0"
connect.Open(Server.Mappath("northwind.mdb"))
set rst = Server.CreateObject("ADODB.recordset")
sql="SELECT * FROM office"
rst.CursorLocation = adUseClient
rst.CursorType = adOpenStatic
rst.LockType = adLockBatchOptimistic
rst.Open sql, connect
%>

Last edited by Praetor : 28-11-2009 at 01:41 PM.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Types of Cursors in ADODB"
Thread Thread Starter Forum Replies Last Post
ADODB 0x80020009 error problem Halyn Software Development 3 28-08-2009 06:50 PM
Mac OS X Cursors for Windows XP Kiho Customize Desktop 6 12-08-2009 09:27 AM
Vista cursors in XP banjoman Customize Desktop 3 08-06-2009 06:02 PM
ADODB Connection String with password Xan Software Development 2 21-04-2009 03:29 PM
Opening .DBF file using ADODB Pratap Gad Software Development 3 21-04-2009 02:52 PM


All times are GMT +5.5. The time now is 10:06 PM.