Microsoft Access
  Home arrow Microsoft Access arrow Page 2 - Using the Recordset with 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

Using the Recordset with MS Access and ADO
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2006-04-26

    Table of Contents:
  • Using the Recordset with MS Access and ADO
  • The Recordset Object, Properties, Methods and events
  • Write code to Open ADODB connection, Recordset and close open objects
  • Review recordset properties using 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


    Using the Recordset with MS Access and ADO - The Recordset Object, Properties, Methods and events


    (Page 2 of 4 )

    In order to understand the properties, methods and events, I have no better recommendation than the Object Browser. This is even better than a book, because the object browser directly relates to the version you are using. This picture shows the Recordset object as revealed by the Object Browser. We will be describing only some of the properties and methods in this tutorial and several others in forthcoming tutorials.

     

    The tutorial steps

    We will be following step-by-step the line items shown here for this tutorial. Basically, you'll be opening a connection and opening a recordset. The data is represented by rows of information --  the recordset. The rows have columns of information for each row, called the fields. Each column represents a field in the fields collection. The summary of steps you will be following are as follows.

    • Create a MDB file, add a form, a button, etc.
    • Establish a reference to ADO.
    • Write code to open ADODB connection, recordset and close open objects.
    • Review recordset properties using code.
    • Take a look at the Recordset object and the User interface in MS Access.
    • Summary.
    Create a MDB file, add a form, a button, etc

    Please follow the steps indicated in the first part of this tutorial. Just open your MS Access application and choose to Create a New File... which prompts you for a number of options. Choose to create a blank database. For this tutorial, I used the same AdoTest.mdb file as I did in the earlier article. This time I will be writing code to the Form's load event.

    Open the form in design view, by first highlighting Form 3 (in addition to Form1, I also have a Form2 which is not used in this tutorial) and then choosing Design View. Right click on the form on the little square at the top left corner of the form in the design view (which darkens when you click). From the drop-down menu click on Build Event... and in the Choose Builder pop-up that comes up click on Code Builder.

    You will get to the Microsoft Visual Basic Editor screens consisting of Properties - Form3, Project AdoTest, and the Form_Form3(code). If some of them are not visible you can display them using the View menu in the Microsoft Visual Basic Editor. If you want to go back to the form just click on the MS Access icon on the tool bar. The code page for Form3 is called AdoTest - Form_Form1(code). This is where the code for the form and for any controls on the form are written. Presently there is no code except an empty Form_Load() event.

    Establish a reference to ADO

    This is an important step where you will establish a reference to the Microsoft ActiveX Data objects library, which allows you to use the methods, properties and events related to these objects. In the Microsoft Visual Basic screen go to Tools, click on it (do not right click), and from the drop down click References (it is usually the first one in the list). This brings up the window References - AdoTest as shown. You will see references to a whole lot of ADOs. Here the ADO 2.8 library is chosen; click OK. With this we can use the msado15.dll.

    More Microsoft Access Articles
    More By Jayaram Krishnaswamy


       · ADO and ADO.NET will be the technologies you may need to pursue in the future....
       · Hi Jay,I was working with a form. The example you have given here perfectly...
     

    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 2 hosted by Hostway
    Stay green...Green IT