2.2.19. ADO Recordset object

发布时间 :2025-10-25 12:23:20 UTC      

Recordset object

ADO Recordset object is used to hold a recordset from a database table.one Recordset the object consists of records and columns (fields).

In ADO, this object is the most important and most commonly used object to manipulate the data of the database.

ProgID

set objRecordset=Server.CreateObject("ADODB.recordset")

When you first open a Recordset , the current record pointer points to the first record, while BOF and EOF the property is False . If there is no record, the BOF and EOF properties are True .

Recordset object can support two types of updates:

In ADO, different cursor (pointer) types in 4 are defined:

  • Dynamic cursor-allows you to view additions, changes, and deletions made by other users

  • Keyset cursors-similar to dynamic cursors, except that you cannot view additions made by other users, and it prevents you from accessing records that have been deleted by other users. Data changes made by other users are still visible.

  • Static cursor-provides a static copy of the recordset that can be used to find data or generate reports. In addition, additions, changes, and deletions made by other users will not be visible. When you open a client Recordset object, this is the only cursor type that is allowed.

  • Forward cursor only-only allowed in Recordset scroll forward in the. Inaddition, additions, changes, and deletions made by other users will not bevisible.

Can be passed through CursorType property or Open in the method CursorType parameter to set the type of cursor.

Note: not all providers supports Recordset all methods and properties of the.

Attribute

Attribute

Description

AbsolutePage

Sets or returns a specified Recordset the value of the page number in the object.

AbsolutePosition

Sets or returns a value that specifies Recordset the sequential position (serial number position) of the current record in the object.

ActiveCommand

Return and Recordset object associated with the Command object.

ActiveConnection

If the connection is closed, set or return the definition of the connection,and if the connection is open, set or return the current Connection object.

BOF

If the current record location is before the first record, return true Otherwise, return fasle .

Bookmark

Sets or returns a bookmark. The location where this bookmark saves the current record.

CacheSize

Sets or returns the number of records that can be cached.

CursorLocation

Sets or returns the location of the cursor service.

CursorType

Set or return the cursor type of a Recordset object.

DataMember

Set or return the name of the data member to be retrieved from the object referenced by the DataSource property.

DataSource

Specify an object that contains data to be represented as a Recordset object.

EditMode

Returns the editing status of the current record.

EOF

If the location of the current record is after the last record, return true otherwise, return fasle .

Filter

Returns a target for Recordset gets or sets the filter for the data in the

Index

Set or return Recordset the name of the current index of the object.

LockType

Set or return when editing Recordset when you have a record in the, youcan specify a value for the lock type.

MarshalOptions

Sets or returns a value that specifies which records are returned to the server.

MaxRecords

Sets or returns the return from a query Recordset the maximum number ofrecords for the object.

PageCount

Returns the number of data pages in a Recordset object.

PageSize

Set or return Recordset the maximum number of records allowed on a single page.

RecordCount

Returns a Recordset the number of records in the object.

Sort

Sets or returns one or more as Recordset the field name of the sort base.

Source

Set a string value, or a Command object reference, or returns a string value that indicates Recordset gets or sets the data source.

State

Returns a value that describes whether Recordset the object is open, closed, connecting, executing, or retrieving data.

Status

Returns the status of the current record about batch updates or other numerous operations.

StayInSync

Sets or returns whether the reference to the child record changes when the location of the parent record changes.

Method

Method

Description

AddNew

Create a new record.

Cancel

Revoke an execution.

CancelBatch

Undo a batch update.

CancelUpdate

Undo the right Recordset gets or sets the changes made by a record of the.

Clone

Create a copy of the existing Recordset .

Close

Close Recordset .

CompareBookmarks

Compare the two bookmarks.

Delete

Delete a record or group of records.

Find

Search for a record in a Recordset that meets a specified condition.

GetRows

Change multiple records from one Recordset object into a two-dimensional array.

GetString

Set Recordset returned as a string.

Move

In Recordset moves the record pointer

MoveFirst

Move the record pointer to the first record.

MoveLast

Move the record pointer to the last record.

MoveNext

Move the record pointer to the next record.

MovePrevious

Move the record pointer to the previous record.

NextRecordset

Clear the current by executing a series of commands Recordset object and return to the next Recordset .

Open

Open a database element that provides access to table records, query results, or saved ‘Recordset’.

Requery

Update by re-executing the query on which the object is based Recordset data.

Resync

Refresh the current from the original database Recordset data.

Save

Put Recordset object to save to file or Stream object.

Seek

Search Recordset to quickly locate the row that matches the specified value and make it current

Supports

Returns a Boolean value that defines Recordset object supports specifictypes of functionality.

Update

Save all changes made to a single record in the Recordset object.

UpdateBatch

Save all changes in the Recordset to the database. Please use in batch update mode.

Event

Note: you cannot use VBScript or JScript processing (only Visual Basic, Visual blocking, and Visual Junction + languages are allowed to handle events).

Event

Description

EndOfRecordset

Triggered when attempting to move to a line beyond the end of Recordset .

FetchComplete

Triggered when all records in the asynchronous operation are read.

FetchProgress

It is triggered periodically during an asynchronous operation to report how many records have been read.

FieldChangeComplete

The value change of the `` Field` object is triggered.

MoveComplete

Recordset is triggered when the current position in the

RecordChangeComplete

A record is triggered after a change.

RecordsetChangeComplete

Triggered after the Recordset change.

WillChangeField

Triggered before the value of the Field object changes

WillChangeRecord

Triggered before a record changes.

WillChangeRecordset

Triggered before making changes to the Recordset .

WillMove

Triggered before the current position in the Recordset changes.

Set

Set

Description

Fields

Indicates the number of Field objects in this Recordset object.

Properties

Contains all Recordset object in the Property object.

Properties of the Fields collection

Attribute

Description

Count

Returns the number of items in the fields set. Starting from 0.

Example:

countfields = rs.Fields.Count

Item(named_item/number)

Return fields a specified item in the collection.

Example:

itemfields = rs.Fields.Item(1)
或者    
itemfields = rs.Fields.Item("Name")

Properties of the Properties collection

Attribute

Description

Count

Returns the number of items in the properties set. Starting from 0.

Example:

countprop = rs.Properties.Count
Item(named_item/number) 
返回 properties 集合中某个指定的项目。

Item(named_item/number)

Returns a specified item in the properties collection. Example:

itemprop = rs.Properties.Item(1)
或者
itemprop = rs.Properties.Item("Name")
Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.