Oracle Objects for OLE C++ Class Library
Release 9.2

Part Number A95896-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

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


 
Oracle
Copyright © 1998, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback