网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: ADO :: ADO PageCount 属性

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

ADO PageCount 属性


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:1112 :: ::

The PageCount property returns a long value that indicates the number of pages with data in a Recordset object.
PageCount属性的作用是:返回一个长值,用于指定记录集对象中数据页面的数量。

Tip: To divide the Recordset into a series of pages, use the PageSize property.
提示:你可以使用PageSize属性将记录集分割为一系列的页面。

Note: If the last page contains fewer records than specified in PageSize, it still counts as an additional page in the PageCount property.
注意:如果最后一页的记录数量少于在PageSize属性中指定的数量,那么它仍然被视为一页。

Note: If this method is not supported it returns -1.
注意:如果不支持这个方法,那么将返回-1。

Syntax
语法

objRecordset.PageCount

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")
sql="SELECT * FROM Customers"
rs.Open sql,conn
rs.PageSize=5
i=rs.PageCount
response.write("The number of pages in RS=" & i)
rs.Close
conn.Close
%>

评论 (0) All