The ADO Recordset object represents the entire set of records from a base table. At any time, the Recordset object only refers to a single record within the set as the current record.
The following Recordset object methods, properties, and collections are supported by the current version of the Microsoft® OLE DB Provider for AS/400 and VSAM:
Name | Comment |
---|---|
AddNew method | Creates a new record for an updatable Recordset object. |
CancelBatch method | Cancels a pending batch update. |
CancelUpdate method | Cancels any changes made to a current record or to a new record prior to calling the UpdateBatch method. |
Clone method | Creates a duplicate Recordset object from an existing Recordset object. |
Close method | Closes an open object and any dependent objects. |
Delete method | Deletes the current record in an open Recordset object or an object from a collection. |
Find method | Finds the next record to match a condition (ADO 1.5). |
GetRows method | Retrieves multiple records of a Recordset into an array. |
Move method | Moves the position of the current record in a Recordset object. |
MoveFirst method | Moves to the first record in a specified Recordset. |
MoveLast method | Moves to the last record in a specified Recordset. |
MoveNext method | Moves to the next record in a specified Recordset. |
MovePrevious method | Moves to the previous record in a specified Recordset. |
Open method | Opens a cursor on a Recordset. |
Requery method | Updates the data in a Recordset object by re-executing the query on which the object is based (equivalent to calling the Close and Open methods in succession). |
Supports method | Determines whether a specified Recordset object supports a particular type of function. |
Update method | Saves any changes you make to the current record of a Recordset object. |
UpdateBatch method | Writes all pending batch updates to disk. |
ActiveConnection property | Sets or returns which Connection object the specified Recordset object currently belongs to. |
BOF property | Indicates if the current record position is before the first record in a Recordset object. |
Bookmark property | Returns a bookmark that uniquely identifies the current record in a Recordset object or sets the current record in a Recordset object identified by a valid bookmark. |
CacheSize property | Sets or returns the number of records from a Recordset object that are cached locally in memory. |
CursorLocation property | Sets or returns the location of the cursor (whether the cursor is on the client or the server side). |
CursorType property | Sets or returns the type of cursor used in a Recordset object. Only the adOpenDynamic CursorType is supported by the current version of the OLE DB Provider for AS/400 and VSAM. |
EditMode property | Indicates the editing status of the current record type. |
EOF property | Indicates if the current record position is after the last record in a Recordset object. |
Filter property | Indicates a filter for data in a Recordset (revised in ADO 1.5). |
LockType property | Sets or returns the types of locks placed on records during editing. All four lock types (adLockReadOnly, adLockOptimistic, adLockPessimistic, and adLockBatchOptimistic) are supported by the OLE DB Provider for AS/400 and VSAM. |
Sort property | Indicates the column names and order to sort data in a Recordset object (new property in ADO 1.5). |
Source property | Sets or returns the source (table name) for the data in a Recordset. |
State property | Describes the current state of an object. |
Status property | Indicates the status of the current record with respect to batch updates or other bulk operations. |
Fields collection | Collections of fields on the Recordset. |
Properties collection | Collections of properties on the Recordset. |
The syntax supported by the OLE DB Provider for AS/400 and VSAM to open a recordset (table) using the Recordset.Open method is as follows:
EXEC OPEN TableName
where TableName represents one of the following host file naming conventions.
Host file type | File naming convention |
---|---|
VSAM Data Sets | DATASETNAME.FILENAME |
Partitioned Data Sets | DATASETNAME.FILENAME(MEMBER) |
OS/400 Files | LIBRARY/FILE |
OS/400 Files | LIBRARY/FILE.NAME |
OS/400 File Members | LIBRARY/FILE(MEMBER) |
OS/400 File Members | LIBRARY/FILE.NAME(MEMBER) |
Note that if a member of a library contains a dot in the member name, the member name must be surrounded by double quotes. For example, if the member name is NAMES.DAT the proper syntax for command text used for the Recordset.open method is as follows:
EXEC OPEN LIBRARY/FILE("NAMES.DAT")
The Recordset Bookmark method is supported for the following AS/400 files:
·KSDS if the file has a unique key
·RRDS
The Recordset AddNew method can only be used on ESDS files on the AS/400 when you are positioned at the end of the Recordset object (file). With KSDS files on the AS/400, the AddNew method adds new records by key. With RRDS or Alternate Index files on the AS/400, the AddNew method can be used to add records when at the end of the Recordset object or by key.
In order to use the Recordset Find method or the Filter property, an AS/400 logical file or a mainframe KSDS or RRDS file must be used. If these methods or properties are used on an AS/400 physical file or any other mainframe file type, then the method fails.
The Recordset Sort property is used with an open Recordset object based on an AS/400 physical file. The Sort property allows the user to indicate which logical view to apply to an AS/400 physical file. The logical view must be a valid index specified in the description of the AS/400 physical file. The logical view is provided by the AS/400 logical file. The OLE DB Provider for AS/400 and VSAM responds to the Sort property request by first closing the open physical file, and then opening the logical file that points back to the data in the physical file.
The Recordset Sort property is only supported on AS/400 hosts. If the user opens a Recordset object based on an AS/400 logical file, then there is probably no need to use Recordset.Sort. For performance reasons, applications should be written to open the AS/400 logical file first, because the overhead is so much greater when opening a physical file first.