ASP分页出现的问题

来源:百度知道 编辑:UC知道 时间:2024/05/26 13:20:08
代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Set dbConn = Server.CreateObject("ADODB.Connection")
dbconn.Open "webdata","sa","1234"
set dbRS=dbConn.Execute("select * from 新闻")
%>
<%
dbRS.PageSize = 2
zongye=dbRS.PageCount
if trim(request("page"))="" then
page=1
else
page=cint(request("page"))
end if
if page<=0 then page=1
dbRS.AbsolutePage=page
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>分页效果</title>
</head>

<body>
<% if dbRS.EOF and dbRS.BOF then
response.Write("暂时还没有文章")
else
for i=1 to dbRS.pagesize
if dbRS.EOF then : exit for : end if
%>
<a href="shownews.asp?

set dbRS=dbConn.Execute("select * from 新闻")

改成

set dbRS=Server.CreateObject("ADODB.Recordset")
dbRS.open "select * from 新闻",dbConn,1,1

Connction对象的Execute方法返回的记录集是不支持分页的。

吧 源程序该 发我