Database Programming Techniques > Changing the Current Record Position > Detecting BOF and EOF conditions |
In addition to the record navigation methods, True DBGrid provides BOF and EOF properties for determining beginning and end of file conditions. For example, the following loop iterates through all available records in any data mode:
Example Title |
Copy Code
|
---|---|
With TDBGrid1
.MoveFirst
While Not .EOF
' Process current record.
.MoveNext
Wend
End With
|
Note: This example is provided for illustration purposes only. In a real application, iterating through the entire grid would produce a flurry of screen activity, and is therefore not recommended. Such operations are best performed on the underlying data source, or better yet, a Recordset clone if one is available.