Microsoft Access
  Home arrow Microsoft Access arrow Page 2 - Cursors in MS Access and ADO
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MICROSOFT ACCESS

Cursors in MS Access and ADO
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2006-05-03

    Table of Contents:
  • Cursors in MS Access and ADO
  • ADO Cursors
  • The Recordset's RecordCount, AbsolutePosition, BOF and EOF properties
  • CursorType changed to adOpenForwardOnly

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Cursors in MS Access and ADO - ADO Cursors


    (Page 2 of 4 )

    If you look at the object browser for the recordset you will see two properties associated with cursor. One is the CursorLocation property and the other is the CursorType property. In part two of this series the default values of these were shown to be CursorLocation(2) is adUseServer and the CursorType(0) is adOpenKeyset.

    As far as the Cursor Location property is concerned there are just two usable properties, the Client-side cursors and Server-side cursors denoted by adUseClient and adUseServer respectively. These enumerated constants also have values associated with them, adUseServer:= 2 and adUseClient:= 3. These determine how the retrieved results of your query are stored. The default setting adUseServer can be changed to client-side if you want. In addition to these two properties, two other properties of the recordset, the LockType and CacheSize, also influence the functionality of the cursors. These will not be discussed in the present tutorial.

    In the case of Client-side cursors, the results of the entire query get stored to the ADO Cursor engine. In the case of Server-side cursors either the OleDB provider or the database manages the results, with ADO storing a small subset of the result. It is important to realize that the data in a client-side cursor is inherently disconnected from the database, but stored in the ADO Cursor Engine, it is a copy of the data when it was retrieved. Any changes to the recordset are applied as an action query through the OleDB provider, the intermediary between ADO and the Data.

    Cursor Type Constant Value Description
    adOpenForwardOnly 0 Default for Server-Side Recordsets
    You can only move forward.
    adOpenKeySet 1 You can move forward and backward
    Modify, delete by others can be seen.
    adOpenDynamic 2 You can move forward and backward
    Insert, Modify and delete by others can be seen.
    adOpenStatic 3 Default for Client-side recordsets, the only option for client-side recordsets. You cannot see
    changes by others, but you can move
    forward and backward.

    The ADO 2.8 API library defines the various cursors as follows ( a reproduction of information from Microsoft's documentation on MSDN):

    More Microsoft Access Articles
    More By Jayaram Krishnaswamy


       · The tutorial is written targeting the beginner and so the discussion is at its very...
       · These are excellent articles and I am enjoying reading them. We all have to start...
     

    MICROSOFT ACCESS ARTICLES

    - Linking SQL Express 2005 Tables to MS Access...
    - Working with Access Projects in Access 2007
    - Exploring Access 2007
    - Working with Stored Procedures in an MS Acce...
    - Creating and Using Action Queries
    - Creating Data Access Pages with Charts using...
    - Advanced Ideas using VBA
    - VBA Details
    - Updating Records in MS Access
    - Using ADO`s Record Object with URLs
    - Exporting XML from MS Access 2003
    - Importing XML into MS Access 2003
    - On Using Pass-through Queries in MS Access
    - Distributed Queries in MS Access
    - Configuring a Linked Microsoft Access Server...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT