ASP查询分页显示问题
<table width="528" border="0" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<tr>
<td height="25" colspan="5" bgcolor="#666666"><div align="left" class="tit"> >>以下是你查询的“<%=request.form("datename")%>”结果:</div></td>
</tr>
<tr>
<td height="15" colspan="5"><BR>
<%
dim dataname,leixing
dataname=trim(request.form("datename"))
leixing=Cint(request.Form("select"))
set rs3=server.CreateObject("adodb.recordset")
if dataname="" and leixing="" then
response.Write("<SCRIPT language=JavaScript>alert('请输入你要查询的关键字,谢谢!');history.go(-1);</script>")
end if
if leixing=1 then
sql3="select * from soft where dataname like '%"&dataname&"%' order by ID desc"
rs3.open sql3,conn,1,1
if rs3.eof and rs3.bof then
response.write "<p align='center' > 没 有 找 到 你 想 要 的 源 码!!! </p>"
else
rs3.PageSize=11
count=1
if Request("count")<>"" then
count=Cint(Request("count"))
if count<1 then
count=1
end if
if count>rs3.PageCount then
count=rs3.PageCount
end if
end if
%>
<%
if not rs3.Bof and not rs3.Eof then
rs3.ABSolutePage=count
end if
for i=1 to rs3.PageSize-1
if rs3.Eof then
exit for
end if
%>
<table width="528" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="312" height="25" bgcolor="#EEEEEE"><div align="left"><a href="<%=rs3("fname")%>" target="_blank" class="liebiao"><%=rs3("dataname")%></a></div></td>
<td width="132" bgcolor="#EEEEEE" class="pt"><%=rs3("Size")%></td>
<td width="84" bgcolor="#EEEEEE" class="pt"><%=rs3("update")%></td>
</tr>
<tr>
<td height="5" colspan="3" class="pt"> </td>
</tr>
<tr>
<td colspan="3" class="pt"> <%=left(rs3("Introduction"),120)%>...</td>
</tr>
</table>
<div align="center"><img src="images/line.gif" width="520" height="9" align="absmiddle">
<%rs3.movenext
next
end if
%>
</div></td>
</tr>
<tr>
<td height="50" colspan="5" valign="bottom">
<%
elseif leixing=2 then
sql3="select * from news where dataname like '%"&newsname&"%' order by id desc"
rs3.open sql3,conn,1,1
if rs3.eof and rs3.bof then
response.write "<p align='center'> 没 有 找 到 你 想 要 的 文 章!!! </p>"
else
rs3.PageSize=11
count=1
if Request("count")<>"" then
count=Cint(Request("count"))
if count<1 then
count=1
end if
if count>rs3.PageCount then
count=rs3.PageCount
end if
end if
%>
<%
if not rs3.Bof and not rs3.Eof then
rs3.ABSolutePage=count
end if
for i=1 to rs3.PageSize-1
if rs3.Eof then
exit for
end if
%>
<table width="528" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="444" height="25" bgcolor="#EEEEEE"><div align="left"><a href="<%=rs3("fname")%>" target="_blank" class="liebiao"><%=rs3("newsname")%></a></div></td>
<td width="84" bgcolor="#EEEEEE" class="pt"><%=rs3("update")%></td>
</tr>
<tr>
<td height="5" colspan="3" class="pt"> </td>
</tr>
<tr>
<td colspan="3" class="pt"> <%=left(rs3("Content0"),120)%>...</td>
</tr>
</table>
<div align="center"><img src="images/line.gif" width="520" height="9" align="absmiddle">
<%rs3.movenext
next
end if
end if
%>
</div></td>
</tr>
<tr>
<td height="50" colspan="5" valign="bottom">
<table width="528" border="0">
<tr>
<td><div align="right"><span class="pt">[<a href="search.asp?count=1" class="h2a">首页</a>] [<a href="search.asp?count=<%=count-1%> class="h2a">上一页</a>][<a href="search.asp?count=<%=count+1%>" class="h2a">下一页</a>][<a href="search.asp?count=<%=rs3.PageCount%>" class="h2a">尾页</a>]</span></div></td>
</tr>
</table>
</td>
</tr>
</table>
以上为我写的查询页面的代码,但是查询出来的数据很多,我想分页显示,每页显示10条数据。可是不知道该怎么写分页代码。
我想用下面的这种方法表示,可是前面的代码又该怎么改呢?
<tr>
<td><div align="right"><span class="pt">[<a href="search.asp?count=1&dataname=<%=dataname%>&leixing=<%=leixing%>" class="h2a">首页</a>] [<a href="search.asp?count=<%=count-1%>&dataname=<%=dataname%>&leixing=<%=leixing%>" class="h2a">上一页</a>][<a href="search.asp?count=<%=count+1%>&dataname=<%=dataname%>&leixing=<%=leixing%>" class="h2a">下一页</a>]
[<a href="search.asp?count=<%=rs3.PageCount%>&dataname=<%=dataname%>&leixing=<%=leixing%>" class="h2a">尾页</a>]</span></div></td>
</tr>
希望各位高手帮帮忙!!!如果有更简单的方法也帮忙介绍介绍。