Tutorials References Menu

ADO MaxRecords Property


❮ Complete Recordset Object Reference

The MaxRecords property sets or returns a long value that indicates the maximum number of records to return to a Recordset object from a query. Default is zero (which means that the provider returns all requested records).

This property is read/write on a closed Recordset and read-only on an open Recordset.


Syntax

objRecordset.MaxRecords

Example

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("northwind.mdb"))

set rs=Server.CreateObject("ADODB.recordset")
rs.MaxRecords=20
sql="SELECT * FROM Customers"
rs.Open sql,conn

rs.Close
conn.Close
%>

❮ Complete Recordset Object Reference