当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO PageCount 属性

ADO
ADO DataTypes
ADO 摘要
ADO 实例

ADO PageCount 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 334 ::
收藏到网摘: n/a

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

登陆 | 还没注册?