BOOL IsBOF( ) const;
throw( CDaoException, CMemoryException );
Return Value
Nonzero if the recordset contains no records or if you have scrolled backward before the first record; otherwise 0.
Remarks
Call this member function before you scroll from record to record to learn whether you have gone before the first record of the recordset. You can also call IsBOF along with IsEOF to determine whether the recordset contains any records or is empty. Immediately after you call Open, if the recordset contains no records, IsBOF returns nonzero. When you open a recordset that has at least one record, the first record is the current record and IsBOF returns 0.
If the first record is the current record and you call MovePrev, IsBOF will subsequently return nonzero. If IsBOF returns nonzero and you call MovePrev, an exception is thrown. If IsBOF returns nonzero, the current record is undefined, and any action that requires a current record will result in an exception.
Effect of specific methods on IsBOF and IsEOF settings:
This table shows which Move operations are allowed with different combinations of IsBOF/IsEOF.
MoveFirst, MoveLast | MovePrev, Move < 0 |
Move 0 |
MoveNext, Move > 0 |
|
IsBOF=nonzero, IsEOF=0 |
Allowed | Exception | Exception | Allowed |
IsBOF=0, IsEOF=nonzero |
Allowed | Allowed | Exception | Exception |
Both nonzero | Exception | Exception | Exception | Exception |
Both 0 | Allowed | Allowed | Allowed | Allowed |
Allowing a Move operation does not mean that the operation will successfully locate a record. It merely indicates that an attempt to perform the specified Move operation is allowed and will not generate an exception. The value of the IsBOF and IsEOF member functions may change as a result of the attempted move.
The effect of Move operations that do not locate a record on the value of IsBOF and IsEOF settings is shown in the following table.
IsBOF | IsEOF | |
MoveFirst, MoveLast | Nonzero | Nonzero |
Move 0 | No change | No change |
MovePrev, Move < 0 | Nonzero | No change |
MoveNext, Move > 0 | No change | Nonzero |
For more information about navigating in recordsets, see the article DAO Recordset: Recordset Navigation in Visual C++ Programmer's Guide. For related information, see the topic "BOF, EOF Properties" in DAO Help.
CDaoRecordset Overview | Class Members | Hierarchy Chart
See Also CDaoRecordset::IsEOF