Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

ADO Recordset Object

The Recordset object represents the entire set of records from a database table or the results of an executed command.

ADO Recordset Object Collections

ADO Fields Collection

All the stored Field objects of a Recordset object.

ADO Properties Collection

All the Property objects for a specific instance of a Recordset object. This collection is not currently supported on UNIX.

ADO Recordset Object Methods

ADO Recordset Object AddNew Method

Creates a new record for an updatable Recordset object.

ADO Recordset Object CancelBatch Method

Cancels a pending batch update. This method is not currently supported on UNIX.

ADO Recordset Object CancelUpdate Method

Cancels any changes made to the current record prior to calling the Update method.

ADO Recordset Object Clone Method

Creates a new Recordset object from an existing Recordset object. This method is not currently supported on UNIX.

ADO Recordset Object Close Method

Closes an open Recordset object and any dependent objects.

ADO Recordset Object Delete Method

Deletes the current record or group of records from a Recordset object.

ADO Recordset Object GetRows Method

Retrieves multiple rows from a Recordset object into an array.

ADO Recordset Object Move Method

Moves the position of the current record in a Recordset object.

ADO Recordset Object MoveFirst Method

Moves to the first record in a Recordset object and makes that record the current record.

ADO Recordset Object MoveLast Method

Moves to the last record in a Recordset object and makes that record the current record.

ADO Recordset Object MoveNext Method

Moves to the next record in a Recordset object and makes that record the current record.

ADO Recordset Object MovePrevious Method

Moves to the previous record in a Recordset object and makes that record the current record.

ADO Recordset Object NextRecordset Method

Clears the current Recordset object and returns the next recordset by advancing through a series of commands. This method is not currently supported on UNIX.

ADO Recordset Object Open Method

Opens a cursor.

ADO Recordset Object Requery Method

Updates the data in a recordset by re-executing the query on which the object is based.

ADO Recordset Object Resync Method

Refreshes the data in the Recordset object from the underlying database.

ADO Recordset Object Supports Method

Determines whether a specified Recordset object supports a particular type of functionality.

ADO Recordset Object Update Method

Saves any changes you make to the current record of a Recordset object.

ADO Recordset Object UpdateBatch Method

Writes all pending batch updates. This method is not currently supported on UNIX.

ADO Recordset Object Properties

ADO Recordset Object AbsolutePage Property

The page in which the current record resides.

ADO Recordset Object AbsolutePosition Property

The ordinal position of a Recordset object's current position.

ADO Recordset Object ActiveConnection Property

The Connection object to which the Recordset object currently belongs.

ADO Recordset Object BOF, EOF Properties

If True, the current record position is before the first record in a Recordset object.

ADO Recordset Object Bookmark Property

A value that uniquely identifies the current record in a Recordset object. Setting the Bookmark property to a valid bookmark changes the current record.

ADO Recordset Object CacheSize Property

The number of records from a Recordset object that are cached locally in memory. This property is not currently supported on UNIX.

ADO Recordset Object CursorLocation Property

The location of the cursor engine.

ADO Recordset Object CursorType Property

The type of cursor used in a Recordset object.

ADO Recordset Object EditMode Property

The editing status of the current record.

ADO Recordset Object BOF, EOF Properties

True if the record position is after the last record in a Recordset object.

ADO Recordset Object Filter Property

A filter for data in a Recordset object.

ADO Recordset Object LockType Property

The type of locks placed on records during editing.

ADO Recordset Object MarshalOptions Property

Which records are to be marshaled back to the server.

ADO Recordset Object MaxRecords Property

The maximum number of records to return to a Recordset object from a query.

ADO Recordset Object PageCount Property

The number of pages of data the Recordset object contains.

ADO Recordset Object PageSize Property

The number of records that make up one page in the Recordset object.

ADO Recordset Object RecordCount Property

The current number of records in a Recordset object.

ADO Recordset Object Source Property

The source for the data in a Recordset object.

ADO Recordset Object State Property

Describes the current state of the Recordset object.

ADO Recordset Object Status Property

The status of the current record with respect to batch updates or other bulk operations.

ADO Recordset Object Remarks

Use Recordset objects to manipulate data from a provider. In ADO, data is almost entirely manipulated using Recordset objects. All Recordset objects are constructed using records (rows) and fields (columns). Depending on the functionality supported by the provider, some Recordset methods or properties may not be available.

Recordset objects can also be run remotely. For example, in a Web-based application, you can open a Recordset on the client, using the progID "ADOR." The Remote Data Service provides a mechanism for local data caching and local cursor movement in remote recordset data. A client-side recordset can be used in the same way as a server-side recordset, and supports almost all of the Recordset object's normal methods and properties. Recordset methods and properties that are not supported on a client-side recordset, or that behave differently, are noted in the topics for those properties and methods.

There are four different cursor types defined in ADO:

Cursor

Description

Dynamic

Allows you to view additions, changes and deletions by other users, and allows all types of movement through the recordset that don't rely on bookmarks; allows bookmarks if the provider supports them.

Keyset

Behaves like a dynamic cursor, except that it prevents you from seeing records that other users add, and prevents access to records that other users delete. Data change by other users will still be visible. It always supports bookmarks and therefore allows all types of movement through the recordset.

Static

Provides a static copy of a set of records for you to use to find data or generate reports. Always allows bookmarks and therefore allows all types of movement through the recordset. Additions, changes, or deletions by other users will not be visible. This is the only type of cursor allowed when you open a client-side (ADOR) Recordset object.

Forward-only

Behaves identically to a dynamic cursor except that it allows you to scroll only forward through records. This improves performance in situations where you need to make only a single pass through a recordset.

Set the ADO Recordset Object CursorType Property prior to opening the recordset to choose the cursor type, or pass a CursorType argument with the ADO Recordset Object Open Method. Some providers don't support all cursor types. Check the documentation for the provider. If you don't specify a cursor type, ADO opens a forward-only cursor by default.

When used with some providers (such as the Microsoft ODBC Provider for OLE DB in conjunction with Microsoft SQL Server), you can create Recordset objects independently of a previously defined ADO Connection Object by passing a connection string with the Open method. ADO still creates a Connection object, but it doesn't assign that object to an object variable. However, if you are opening multiple Recordset objects over the same connection, you should explicitly create and open a Connection object; this assigns the Connection object to an object variable. If you do not use this object variable when opening your Recordset objects, ADO creates a new Connection object for each new recordset, even if you pass the same connection string.

You can create as many Recordset objects as needed.

When you open a recordset, the current record is positioned to the first record (if any) and the ADO Recordset Object BOF, EOF Properties are set to False. If there are no records, the BOF and EOF property settings are True.

Use the ADO Recordset Object MoveFirst, MoveLast, MoveNext, MovePrevious Methods, as well as the ADO Recordset Object Move Method, and the AbsolutePosition, AbsolutePage, and ADO Recordset Object Filter Property properties to reposition the current record, assuming the provider supports the relevant functionality. Forward-only Recordset objects support only the MoveNext method. When you use the Move methods to visit each record (or enumerate the recordset), you can use the BOF and EOF properties to see if you've moved beyond the beginning or end of the recordset.

Recordset objects may support two types of updating: immediate and batched. In immediate updating, all changes to data are written immediately to the underlying data source once you call the ADO Recordset Object Update Method. You can also pass arrays of values as parameters with the ADO Recordset Object AddNew Method and Update methods and simultaneously update several fields in a record.

If a provider supports batch updating, you can have the provider cache changes to more than one record and then transmit them in a single call to the database with the ADO Recordset Object UpdateBatch Method. This applies to changes made with the AddNew, Update, and ADO Recordset Object Delete Method methods. After you call the UpdateBatch method, you can use the ADO Recordset Object Status Property to check for any data conflicts in order to resolve them. Batch updating is not currently supported on UNIX.

Note

To execute a query without using an ADO Command Object, pass a query string to the ADO Recordset Object Open Method of a Recordset object. However, a Command object is required when you want to retain the command text and re-execute it, or use query parameters.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.