Name
EOF (Recordset Object) —
rsObj
.EOF
Synopsis
If the value of a Recordset
object's EOF property is True
, the current
record pointer is positioned one record after the last record in the
recordset. This is a read-only property. You can use the EOF property
in conjunction with the BOF property to ensure that your recordset
contains records and that you have not navigated beyond the
boundaries of the recordset. Note that the value of EOF is also
True
if there are no records in the recordset.
Parameters
None
Example
The following example demonstrates the use of EOF to iterate through a set of records. Assuming that there are records in the recordset, we know that EOF will be true once we have iterated through all the records and the record pointer is pointing at the position after the last record in the recordset.
<%@ LANGUAGE="VBSCRIPT" %> <% Response.Buffer = True %> <HTML> <HEAD> <TITLE>ADO Examples</TITLE> </HEAD> <BODY> <% ' Include ADOVBS.INC so we can use the ADO constants. %> <!-- #include virtual = "/MySSIncludes/adovbs.inc" --> <% ' Instantiate an ADO Connection object. Set objDBConn = Server.CreateObject("ADODB.Connection") ' Construct the connection string for the Connection object. strConn = _ "driver={SQL Server};;uid=sa;pwd=;database=SalesDB" ' Using the connection string, open the connection. objDBConn.Open strConn ' Instantiate an ADO Recordset object. Set rsHighSales = _ Server.CreateObject("ADODB.Recordset") ' Set the ActiveConnection property of the recordset. rsHighSales.ActiveConnection ...
Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.