EOF property
Returns the position of the current record in a Recordset object relative to the "End of File." If True, the current record position is after the last record. If False, the current record position is before the last record. If both the EOF property and the BOF property of the Recordset object are True, the record set is empty. Read-only Boolean.
Applies to
Objects: Recordset
Syntax
object.EOF
Parameters
Part |
Description |
---|---|
object |
Required. An expression that returns a Recordset object |
Remarks
- To browse through records, use the EOF and BOF properties of a Recordset object in conjunction with the QueryAllRecords https://msdn.microsoft.com/en-us/library/gg674865, QueryCircle https://msdn.microsoft.com/en-us/library/gg674866, QueryPolygon https://msdn.microsoft.com/en-us/library/gg674867, and QueryShape https://msdn.microsoft.com/en-us/library/gg674868 methods on a DataSet object and the MoveNext https://msdn.microsoft.com/en-us/library/gg674850 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