BOF property
Returns the position of the current record in a Recordset object relative to the "Beginning of File." If True, the current record position is before the first record. If False, the current record position is after the first record. If both the BOF property and the EOF property of the Recordset object are True, the record set is empty. Read-only Boolean.
Applies to
Objects: Recordset
Syntax
object.BOF
Parameters
Part |
Description |
---|---|
object |
Required. An expression that returns a Recordset object. |
Remarks
- To browse through records, use the BOF and EOF properties of a Recordset object in conjunction with the QueryAllRecords, QueryCircle, QueryPolygon, and QueryShape methods on a DataSet object and the MoveNext method on a Recordset object.
Example
Sub IsRecordsetEmpty()
Dim objApp As New MapPoint.Application
Dim objRS As MapPoint.Recordset
'Set up the application
objApp.Visible = True
objApp.UserControl = True
'Query to obtain all records in the record set
Set objRS = objApp.OpenMap(objApp.Path & "\Samples\Clients.ptm").DataSets("Clients").QueryAllRecords
'Record set is empty if both are true
If objRS.BOF And objRS.EOF Then
MsgBox "The record set is empty."
Else
MsgBox "Record set is not empty. It contains " _
+ CStr(objRS.Parent.RecordCount) + " records."
End If
End Sub