Database Code
  Home arrow Database Code arrow Page 3 - Using ADO to Communicate with the Database...
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 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
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? 
DATABASE CODE

Using ADO to Communicate with the Database, Part 1
By: Pradeep Chaudhary
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 34
    2004-11-02

    Table of Contents:
  • Using ADO to Communicate with the Database, Part 1
  • What is a Recordset?
  • What Are the Lock Types?
  • Bringing All Together
  • Implementing the Code

  • 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Using ADO to Communicate with the Database, Part 1 - What Are the Lock Types?


    (Page 3 of 5 )

    If multiple users try to update the same record at the same time, an error will occur. When locking your records, you will either be optimistic (adLockOptimistic) that this error won't occur, or you will be pessimistic (adLockPessimistic) and figure this error is likely to happen. So we require to implement some locking strategy. So Lock Type is required because, it determines how to implement concurrent sessions, specially when the solution is supposed to run in a network environment. How to lock the records when the application will run on a network. In optimistic locking, other users are only locked out of the record(s) when the Update method is called - probably just a split second. In pessimistic locking, other users are locked out for the entire period that the records are being accessed and modified.

    Navigating Through a Recordset?

    Recordset is a collection of one or more rows from the database and table specified by you. So you must be able to navigate (Move) through this collection of rows. The Move method moves to a record in a database specified by a row number.

    • Move: The Move method moves to a record in a database specified by a row number (e.g adoRS.Move 4 will move the recordset to fourth record)

    • MoveFirst: Moves to the first record in the recordset

    • MoveLast: Moves to the last record in the recordset

    • MovePrevious: The MovePrevious method moves to the previous record in the recordset. The BOF property should be checked to prevent an error occurring. BOF is set to True if the current record is before the first record in the recordset

    • MoveNext: The MoveNext method moves to the next record in the recordset. The EOF property should be checked to prevent an error occurring. EOF is set to True if the current record is after the last record in the recordset

    More Database Code Articles
    More By Pradeep Chaudhary


       · Seems like you would at least cover ADO.NET rather than covering 3+ year outdated...
       · contrary to what Microsoft says, there are thousands of ASP coders out there that...
       · but there are already a massive number of ADO tutorials on the web - why continue to...
       · Nice concise information with examples to help a DAO developer move to ADO. Thank...
       · anything i can learn is great, thanks for taking the time to post up the knowlegde!...
     

    DATABASE CODE ARTICLES

    - Deployment of the MobiLink Synchronization M...
    - MobiLink Synchronization Wizard in SQL Anywh...
    - Finding Matching Records in Data Access Pages
    - Using the AccessDataSource Control in VS 2005
    - A Closer Look at ADO.NET: The Command Object
    - A Closer Look at ADO.NET: The Connection Obj...
    - Using ADO to Communicate with the Database, ...
    - Code Snippets: Counting Records
    - Constraints In Microsoft SQL Server 2000
    - Multilingual entries into a DB and to be dis...
    - Getting A List of Tables From SQL Server
    - SQL Server Database Creator - .NET Version
    - ADO Recordset Paging
    - Two combos, one textbox example
    - Discussion & Listserv Module by Mike Eck...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway