Oracle Objects for OLE
Release 9.0.1

Part Number A90173-01

Home

Book List

Contents

Master Index

Feedback

MoveFirst, MoveLast, MoveNext, MovePrevious Methods

See Also
Example
Applies To

OraDynaset

Description

These methods change the cursor position to the first, last, next, or previous row within the specified dynaset. MoveNext (MovePrevious, etc.) moves to the next (previous, etc.) valid rownum, skipping rownums that have been deleted.

Usage

oradynaset.MoveFirst

oradynaset.DbMoveFirst

oradynaset.MoveLast

oradynaset.DbMoveLast

oradynaset.MovePrevious

oradynaset.DbMovePrevious

oradynaset.MoveNext

oradynaset.DbMoveNext

Remarks

The data control buttons map (from left to right or from top to bottom) to the MoveFirst, MovePrevious, MoveNext, and MoveLast methods. The BOF and EOF properties are never True when using the data control buttons.

When the first or last record is current, record movement does not occur if you use MoveFirst or MoveLast, respectively. You force the query to completion if you use MoveLast on a dynaset.

If you use MovePrevious and the first record is current, there is no current record and BOF is True. Using MovePrevious again causes an error, though BOF remains True. If you use MoveNext and the last record is current, there is no current record and EOF is True. Using MoveNext again causes an error, though EOF remains True. Note that when the dynaset is created with the ORADYN_NO_MOVEFIRST option, BOF and EOF are true whether the dynaset is empty or not.

When you open a dynaset, BOF is False and the first record is current. If a dynaset is empty, BOF and EOF are both True and there is no current record.

If an Edit or AddNew operation is pending and you use one of the
"Move" methods indirectly by way of the data control, then Update is invoked automatically although it may be stopped during the Validate event.

If an Edit or AddNew operation is pending and you use one of the
"Move" methods directly without the data control, pending Edit or AddNew operations cause existing changes to be lost, though no error occurs.

Data is fetched from the database as necessary, so performing a MoveFirst followed by MoveNext will incrementally build the mirrored (cached) local set without requiring read-ahead of additional data. However, executing a MoveLast will require that the entire query be evaluated and stored locally.

When a dynaset is attached to a data control, these methods first notify the data control's Validate event that record motion is about to occur. The Validate handler may deny the request for motion, in which case the request is ignored. If the record pointer is successfully moved, then all custom controls attached to the data control are notified automatically of the new record position.


 
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.

Home

Book List

Contents