An ADO Recordset keeps a current-row position while you browse query results. The cursor type used when the Recordset is opened determines which movement operations are available.
EOF becomes true after the current position moves beyond the last record. A forward-reading loop normally checks Do While Not rs.EOF before reading fields.
BOF indicates that the current position is before the first record. If a Recordset opens with no rows, both BOF and EOF are true and there is no current record.
MoveNext advances to the next row. Calling it when EOF is already true raises an error, so a normal loop stops when EOF becomes true.
Backward movement and direct first/last navigation require a Recordset/cursor that supports those operations. A forward-only Recordset is designed primarily for sequential MoveNext access.
RecordCount is cursor/provider dependent and can return -1 for a forward-only cursor. When you only need a count, a SQL COUNT(*) query is usually clearer and avoids opening a scrollable cursor just to count rows.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.