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 stepsWe 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, etcPlease 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.

Next: Write code to Open ADODB connection, Recordset and close open objects >>
More Microsoft Access Articles
More By Jayaram Krishnaswamy