Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 1 (10.1)

Part Number B10119-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

IsValidRecord Method

Applies To

ODynaset

Description

This method returns TRUE if the current record is valid.

Usage

oboolean IsValidRecord(void) const

Remarks

If the current record was deleted, or if the current record is before the first record or after the last record, then the current record is invalid and this method returns FALSE. A closed ODynaset also returns FALSE. Otherwise the current record is valid and this routine returns TRUE.

This method is more reliable for checking than IsLast when the fetch limit is a multiple of the total number of records in the table.

Return Value

TRUE if the current record is valid; FALSE otherwise.

Example

An example showing invalid record:

// open a database

ODatabase odb;

odb.Open("ExampleDB", "scott", "tiger");

// open a dynaset

ODynaset odyn;

odyn.Open(odb, "select * from emp");

// go to the first record

odyn.MoveFirst();

oboolean isvalid = odyn.IsValidRecord();

// isvalid is TRUE, unless the dynaset has no records

// go before first record

odyn.MovePrev();

isvalid = odyn.IsValidRecord();

// isvalid is FALSE now

// delete a record

odyn.MoveFirst();

odyn.MoveNext();

odyn.DeleteRecord();

isvalid = odyn.IsValidRecord();

// isvalid is FALSE now, because the current record is deleted