Student Menu. © Lesson 3. Printable layout. Links won't function in print.

Notes Section

Main Text

 

Module 1.0

 

Recordset Object.

A single record may contain several pieces of data. A whole collection of records is a recordset, and it's used to manage the data retrieved from the data store.

 

1. Cursor - Points to the current position in a recordset--just one record at any given time.

2. Recordset Creation - First define (dimension) a variable, and then make it equal to the Recordset Object.

3. Explicit Connection Object - A connection to the data store is very expensive. If you are (1) needing several recordsets or (2) using one recordset for multiple queries, connect to the data store only once by creating an explicit Connection Object.

4. Open Recordset Object Directly - ADO creates the Connection Object behind the scenes allowing for greater coding flexibility and keeping the code tidy. What is flat hierarchy?

 

 

Module 1.1

 

ADO Constants.

Predefined settings for many features when using ADO. Designed to make reading and writing ADO code easier.

 

1. For example, these constants are used to define certain features of the recordset:

 

    Const adOpenForwardOnly = 0

    Const adLockReadOnly = 1

    Const adCmdTable = 2

2. ADO Type Library - Defines the almost 400 ADO constant names and values created by Microsoft.

 

Module 1.2

 

Recordset Object Characteristics.

Syntax of the Recordset Objects
's Open method:

recordset.Open Source, ActiveConnection, CursorType, LockType, Options

1. Source - Where data comes from. Can be a table name, SQL statement, stored procedure, query or an ADO Command Object.

2. ActiveConnection - Identified the data store connection.

3. CursorType - The cursor
's type (Forward-only, Static, Dynamic and Keyset) affects the functionality available in the recordset that's returned.

4. LockType - Prevents records from being updated in the data store (Read-only, Pessimistic, Optimistic and Optimistic Batch).

5. Options - Defines what type of data source is being referred to (Text command, Table name, Stored procedure, Table, Saved Recordset and URL).

 

Module 1.3

 

The Recordset Object in Use.

The Recordset Object has many methods and properties that allow it to easily manipulate data:

1. BOF and EOF - Two properties (beginning-of-file and end-of-file) that return Boolean values (True or False) as the cursor steps through the recordset.

2. Moving through Records - There are four easy methods for moving the cursor forwards for backwards through its records: MovePrevious, MoveNext, MoveFirst and MoveLast. Also, a fifth method called Move allows the cursor to jump over a specified number of records.

3. Bookmarks - Uniquely identifies a record within a recordset and is stored as a varient value.

 

4. Finding Records - A method that does a full table scan to move the cursor to a record that fits a particular description. It has the following syntax.

 

objRecordset.Find Criteria, SkipRecords, SearchDirection, Start

 

5. Filtering Records - Identify all records in a recordset that meet a certain criteria.

 

6. Fields Collection - Contains an entry for each Field (column) in the current record, and you may iterate through each field in the fieldset.

 

7. GetRows Method - Returns a multi-dimensional array having a field's data from a specific number of records in the recordset. It has three optional parameters: Rows, Start and Fields.

 

Module 1.4

 

Exercise 3.

1.     Finish reading Chapter Thirteen, Using Recordsets, in the course textbook. Please read, outline and paraphrase the entire chapter. Work the Try It Out projects for data access with your own code if possible.

2.   Please define all the new vocabulary terms from the paragraphs in the textbook, from the textbook's glossary and from online resources.

3.   Discuss the correct answers to this week’s quiz (shown below) on the Week 3 Student Discussion Board.

4.   Try out the class project links which will not be graded.

 

Module 1.5

 

Quiz 3.

 

  1. A recordset holds what?
  2. Which IS NOT a syntax of the Recordset Object's Open method?
  3. Which is a property or method of the Recordset Object?
  4. What is an advantage of the Move method?
  5. Which of the following can be a source for the Recordset?