Open Directory Site ADO Tutorials

ASP | XML | VBScript | JavaScript | ADO | CSS | XMLDOM | PHP | Operating Systems

Home >> ADO >> ADO Recordset object

ADO Recordset object

 

Examples

GetRows

This example demonstrates how to use the GetRows method.

Recordset Object

The Recordset Object is used to hold a set of records from a database table.

Syntax

objectname.property objectname.method

Properties

Property Description

AbsolutePage Specifies on which page the current record is located

AbsolutePosition Specifies the ordinal position of the current record in a Recordset

ActiveCommand Returns the Command Object associated with the Recordset

ActiveConnection Sets or returns a definition for a connection if the connection is closed, or the current Connection object if the connection is open

BOF Returns true if the current record position is before the first record, otherwise false

Bookmark Sets or returns a bookmark. The bookmark saves the position of the current record

CacheSize Sets or returns the number of records that are cached

CursorLocation Sets or returns the location of the cursor service

CursorType Sets or returns the type of cursor

DataMember Sets or returns the name of the data member referenced by the DataSource property

DataSource Specifies an object containing data to be represented as a Recordset object

EditMode Defines the editing status of the current record

EOF Returns true if the current record position is after the last record, otherwise false

Filter Sets or returns a filter for the data in the Recordset

Sets or returns the name of the index in effect

LockType Sets or returns the type of locking on records

MarshalOptions Sets or returns which records are to be transferred back to the server

MaxRecords Sets or returns the maximum number of records to return to a Recordset object from a query

PageCount Returns the number of pages in a Recordset object

PageSize Sets or returns how many records are on one page

RecordCount Returns how many records there are in a Recordset object

Sort Specifies a comma-separated list of field names the Recordset is sorted on Source Indicates the source for the data in a Recordset object

State Indicates if the Recordset object is open, closed or executing

Status Indicates the status of the current record

StayInSync Indicates whether the parent row should change when set of underlying child records changes

Methods

Method Description

AddNew Creates a new record

Cancel Cancels an execution

CancelBatch Cancels a batch update. Must happen in batch update mode

CancelUpdate Cancels any changes. Must be done before an Update

Clone Creates a copy of a Recordset

Close Closes a Recordset

CompareBookmarks Compares two bookmarks

Delete Deletes a record or a group of records

Find Searches for a record in a Recordset

GetRows Copies records into an array

GetString Returns a Recordset as a string

Move Moves the position of the current record

MoveFirst Moves to the first record

MoveLast Moves to the last record

MoveNext Moves to the next record

MovePrevious Moves to the previous record

NextRecordset Clears the current Recordset and returns the next Recordset

Open Opens a Recordset

Requery Updates the data in a Recordset by executing the query again

Resync Refreshes the data in the current Recordset from the original database

Save Saves the Recordset to a file

Seek Searches the index of a Recordset to locate the row that matches the specified values

Supports Defines whether or not a Recordset supports a specific type of functionality

Update Saves any changes of the current record

UpdateBatch Saves all changes in a Recordset to the database. Used when working on a Recordset in batch update mode

Events

Event Description

EndOfRecordset Triggered when you try to move to a record after the last record

FetchComplete Triggered after all records in an asynchronous operation have beenfetched

FetchProgress Triggered periodically in an asynchronous operation, to state how many more records that have been fetched

FieldChangeComplete Triggered after the values of one or more Field objects have been changed

MoveComplete Triggered after the current position in the Recordset has changed

RecordChangeComplete Triggered after one or more records have been changed

RecordsetChangeComplete Triggered after the Recordset has changed

WillChangeField Triggered before the values of one or more Field objects are changing

WillChangeRecord Triggered before one or more record changes

WillChangeRecordset Triggered before the Recordset changes

WillMove Triggered before the current position in the Recordset changes

Collections

Collection Description

Fields Indicates the number of Field objects in the Recordset object

Properties Contains all the Property objects in the Recordset object

The Fields Collection's Properties

Property Description

Count Returns the number of items in the fields collection. Starts at zero. Example: countfields = rs.Fields.Count

Item(named_item/number) Returns a specified item in the fields collection.

Example: itemfields = rs.Fields.Item(1) or

itemfields = rs.Fields.Item("Name")

The Properties Collection's Properties

Property Description

Count Returns the number of items in the properties collection. Starts at zero. Example: countprop = rs.Properties.Count

Item(named_item/number) Returns a specified item in the properties collection.

Example: itemprop = rs.Properties.Item(1) or

itemprop = rs.Properties.Item("Name")

Cheap Web Hosting Articles - Web Site Design & Web Hosting Tutorials - Domain Hosting