ADO PageSize Property

Home | About me | EXCEL VB Programming (XL97-2003) | ACCESS Programming | EXCEL VB.Net Programming | EXCEL Spreadsheet Functions Material Management  |  Guestbook
 

ADO PageSize Property

The PageSize property returns a long value that defines the maximum number of records that can be displayed on a single page in the Recordset object. You can set this property at any time, regardless if the Recordset is open or closed.

Some providers do not recognize this property.

You use the PageCount property to determine how many pages of data are contained in the Recordset object. When you set the PageSize property, the PageCount property is implicitly updated.Syntax.

Syntax

objRecordset.PageSize

Example

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset, i As Integer

set conn=New ADODB.Connection
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "F:\Mydata\northwind.mdb"
set rs = New ADODB.recordset
sql="SELECT * FROM Customers"
rs.Open sql,conn
rs.PageSize=5
i=rs.PageCount
MsgBox ("The number of pages in RS = " & i)
rs.Close
conn.Close
set rs = Nothing
set conn = Nothing