asp分页显示代码出错
</style></head><body><%sql="select*frombookinfo"setrs=server.CreateObject("adodb.reco...
</style></head>
<body>
<%
sql ="select * from bookinfo"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,3,1
%>
<%
rs.pagesize=3
page1=request("page")
if page1="" then
page2=1
else
page2=cint(page1)
end if
rs.absolutepage=page2
rowcount=0
%>
</table></td>
<td width="657"><table width="758" height="106" border="1" cellpadding="0" cellspacing="0" bordercolor="#336699">
<tr align="center" bgcolor="#6699FF">
<td width="48" height="41">馆藏号</td>
<td width="80">ISBN</td>
<td width="158">借阅图书名称</td>
<td width="66">作者</td>
<td width="161">出版社</td>
<td width="48">数量</td>
<td width="48">语言</td>
<td width="78">图书类别</td>
<td width="51">版次</td>
</tr>
<% while not rs.eof and rowcount<rs.pagesize%>
<% for i=0 to rs.fields.count-1%>
<%=rs.fields(i).value%>
<%next%>
<tr align="center">
<td height="44" bgcolor="#999999"><span class="STYLE2"><%=rs("bookID")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("ISBN")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("bookname")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("bookauthot")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("publishname")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("bookscount")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("languagetyoe")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("booktype")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("typeci")%> </span></td>
</tr> <%
rowcount =rowcount+1
rs.movenext
wend
%>
</table>
</table>
<p>到页号:
<% for i=1 to rs.pagecount %>
<% if i=page2 then %>
[<font color="#FF0000"><&%=i%></font>]
<% else %>
[<a href="page2.asp?page=<%=i%>"><%=i%></a>]
<% end if %>
<%next%>
共<%=rs.recordcount%>条图书信息</p>
</body>
</html> 展开
<body>
<%
sql ="select * from bookinfo"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,3,1
%>
<%
rs.pagesize=3
page1=request("page")
if page1="" then
page2=1
else
page2=cint(page1)
end if
rs.absolutepage=page2
rowcount=0
%>
</table></td>
<td width="657"><table width="758" height="106" border="1" cellpadding="0" cellspacing="0" bordercolor="#336699">
<tr align="center" bgcolor="#6699FF">
<td width="48" height="41">馆藏号</td>
<td width="80">ISBN</td>
<td width="158">借阅图书名称</td>
<td width="66">作者</td>
<td width="161">出版社</td>
<td width="48">数量</td>
<td width="48">语言</td>
<td width="78">图书类别</td>
<td width="51">版次</td>
</tr>
<% while not rs.eof and rowcount<rs.pagesize%>
<% for i=0 to rs.fields.count-1%>
<%=rs.fields(i).value%>
<%next%>
<tr align="center">
<td height="44" bgcolor="#999999"><span class="STYLE2"><%=rs("bookID")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("ISBN")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("bookname")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("bookauthot")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("publishname")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("bookscount")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("languagetyoe")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("booktype")%> </span></td>
<td bgcolor="#999999"><span class="STYLE2"><%=rs("typeci")%> </span></td>
</tr> <%
rowcount =rowcount+1
rs.movenext
wend
%>
</table>
</table>
<p>到页号:
<% for i=1 to rs.pagecount %>
<% if i=page2 then %>
[<font color="#FF0000"><&%=i%></font>]
<% else %>
[<a href="page2.asp?page=<%=i%>"><%=i%></a>]
<% end if %>
<%next%>
共<%=rs.recordcount%>条图书信息</p>
</body>
</html> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询