ASP 读取数据 每页18行 3列

来源:百度知道 编辑:UC知道 时间:2024/06/20 16:55:59
我想每页读取18行,每行读取3条数据。求大侠们帮忙!

读取的顺序是这样的

1 10 19
2 11 20
3 12 21
4 13 22
5 14 23
6 15 24
7 16 25
8 17 26
9 18 27

<%
cctv=request("cctv")
mtv=request("mtv")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>数据显示页</title>
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
-->
</style>
</head>
<body>
<%
set conn=server.CreateObject("adodb.connection")
DBPath = Server.MapPath("参合人员信息表.mdb")
conn.open "provider=microsoft.jet.oledb.4.0; data source="&DBpath

exec="select * from Workbook where 字段10='"&mtv&"' "
'response.write exec
set rs=

首先 你的数据库名字不要用中文
page=int(request.QueryString ("page"))这个应该是CINT把
其他的看起来 没有什么问题啊 你最好一起把 报的错误给我

每页18行,每行3条数据,也就是每页54条记录
<%
Sub writeFiled(i)
colnum=(rs.PageSize/3)*i
for i=0 to colnum
if rs.EOF then
exit for
else
Response.Write("<%=rs("字段1")%> <%=rs("字段2")%> <%=rs("字段3")%><br>")
end if
next
End Sub

rs.PageSize=54
pagecount=rs.PageCount
page=Cint(request.QueryString ("page"))
if page<=0 then page=1
if request.QueryString("page")="" then
page=1
end if
rs.AbsolutePage=page
%>
<tr>
<td><%Call Sub writeFiled(1)%></td>
<td><%Call Sub writeFiled(2)%></td>
<td><%Call Sub writeFiled(3)%></td>
</tr>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHT