Under asp, eof or bof are often used to verify whether it is the last of the record. You can refer to the following differences for judgment. if rs.bof then
Means: The current pointer position is before the first row of records
if rs.eof then
Means: The current pointer position is after the last row of records
if not rs.eof then
Means: The current pointer position has not reached the last record
if not rs.bof then
Means: The current pointer position has not reached the first record
------------------------
### It is recommended to use the following two
if not (rs.bof and rs.eof) then
Means: The pointer is located in the middle of the RecordSet (not the last one and the first one), which means there must be a record.
if rs.bof and rs.eof then
means: no record
eof: The pointer reaches the end
bof: the pointer reaches the top
BOF indicates that the current record position is before the first record of the Recordset object.
EOF indicates that the current record position is after the last record of the Recordset object.
return value
The BOF and EOF properties return Boolean values.
illustrate
Use the BOF and EOF properties to determine whether the Recordset object contains records or whether the Recordset object's limits are exceeded when moving from one record to another.
The BOF property returns True (-1) if the current record is before the first record, and False (0) if the current record is the first record or after it.
The EOF property returns True if the current record is after the last record of the Recordset object, and False if the current record is the last record of the Recordset object or before it.
If the BOF or EOF attribute is True, there is no current record.
If you open a Recordset object without records, the BOF and EOF properties are set to True, and the Recordset object's RecordCount property is set to zero. When you open a Recordset object that contains at least one record, the first record is the current record, and the BOF and EOF properties are False.
If the last record retained in the Recordset object is deleted, the BOF and EOF properties will remain False until the current record is rescheduled.