主题:  分页显示问题?无法正确分页

yidixiaoyu

职务:普通成员
等级:1
金币:1.0
发贴:190
#12003/12/1 10:44:27
这是出现的问题,开始的时候说是第0页。
下面是程序,还有就是这句话错在那里,怎么改<td><a href="jidian.asp?id="<%=rs("id"%>"><%=rs("name"%></a>不能显示出内容,就是name字段对应的。

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>机电</title>
</head>

<body>
<p>&nbsp;</p><table width="778" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="775" height="45">
<param name="movie" value="bbjd.swf">
<param name="quality" value="high">
<embed src="bbjd.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="775" height="45"></embed></object></td>
</tr>
</table>
<p>&nbsp;</p>
<table width="778" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
<td colspan="2">
<%
dim conn
dim connstr
connstr="DBQ="+server.mappath("database/m188.mdb"+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION"
conn.open connstr
%>
<%
set rs=server.createobject("adodb.recordset"
sql="select * from zc"
rs.open sql,conn,1,3
page=cint(request.querystring("page")
rs.pagesize=3
pgcount=rs.pagecount
if page="" then

rs.absolutepage=1
end if
rs.CacheSize =rs.pagesize
if page>0 then
rs.absolutepage=page
end if
'rs.CacheSize =rs.pagesize
%>
<table width=400 align=center>
<%
count=1
do while not rs.eof and count<4
%>
<tr>
<td><a href="jidian.asp?id=<%=rs("id"%>"><%=rs("name"%></a>
</td>
</tr>

<tr><td colspan="2" height=20></td></tr>
<%
count=count+1
rs.movenext
loop
%>
</table>
<p align="center"><font size="2"> 共<font color="#FF0000"><%=rs.pagecount%></font>页
第 <font size="4" color="blue">
<% =page %>
</font> 页 </font><a href=jidian.asp?page=1><font color="#FF0000" size="2">第一页</font></a>
<% pgcount=rs.pagecount %>
<% if page<pgcount then %>
<a href=jidian.asp?page=<%=page+1%>><font color="#FF0000" size="2">下一页</font></a>
<% else %>
<font color="#333333" size="2">下一页</font>
<% end if %>
<% if page >1 then %>
<a href=jidian.asp?page=<%=page-1%>><font color="#FF0000" size="2">上一页</font></a>
<% else %>
<font color="#333333" size="2">上一页</font>
<% end if %>
<% if page<pgcount then%>
<a href=jidian.asp?page=<%=pgcount%>><font color="#FF0000" size="2">最后一页 </font>
</a>
<%else%>
<font color="#333333" size="2"></font>
<%end if%>

<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>



yidixiaoyu

职务:普通成员
等级:1
金币:1.0
发贴:190
#22003/12/2 8:58:28
已经解决,谢谢 lemontree。