asp取数据问题
我对asp不是很熟,大家帮我看下代码。数据库中只有14条。但我3个一行,最后一格没有就会出错
看看怎么解决
<!--#include file="init.asp"-->
<%
key_txt = ReplaceStr(Request.QueryString("key_txt"),0)
mymenu = "product"
myurl = "product.asp"
mytitle = "产品中心"
menuUrl = "product.asp?keyno="
pageUrl = "product_list.asp?key_txt="& key_txt &"&keyno="&keyno&"&pageno="
basclass = 11
mywebtype = 9
pagesize = 4
%>
<!--#include file="myasp_article.asp"-->
<%
wheretxt=" and pid="& id
if trim(key_txt)<>"" then wheretxt=" and title like '%"& key_txt &"%'"
sql="select id,title,picflag,content,creatdate from product3 where cnflag=1"& wheretxt &" order by xuhao"
rs.Open sql,cn,1,1
if not rs.EOF then
rs.PageSize=pagesize
pagecount=rs.PageCount
if pageno<1 then pageno=1
if pageno>pagecount then pageno=pagecount
rs.AbsolutePage=pageno
recordcount=rs.RecordCount
else
pagecount=0
recordcount=0
end if
i=0
do while not rs.EOF and i<pagesize
i=i+1
curdate=rs("creatdate")
url="view.asp?prono="&rs("id")&""" target=""_blank"
%>
<table height="120"><tr>
<td width="150">
<div align="center">
<table width="96%" border="0" cellpadding="00" cellspacing="0" class="link1">
<tr>
<%if rs("picflag")=1 then%>
<td width="90" height="90" align="center" bgcolor="ffffff"><a href="<%=url%>"><img src="./myasp_pic_display.asp?tablename=product3&code=&keyno=<%=rs("id")%>" width="90" height="90" border="0"></a></td>
<%else%>
<td width="90" height="90" align="center" bgcolor="ffffff"><font color=666666>暂无图片</font></td>
<%end if%>
</tr>
<tr><td><font color="#666666"><strong><a href="<%=url%>"><font color="986A01"><%=cutstr(rs("title"),8,0)%></font></a></strong></td></tr>
</table>
</div>
</td>
<%rs.movenext%>
<td width="150">
<div align="center">
<table width="96%" border="0" cellpadding="00" cellspacing="0" class="link1">
<tr>
<%if rs("picflag")=1 then%>
<td width="90" height="90" align="center" bgcolor="ffffff"><a href="<%=url%>"><img src="./myasp_pic_display.asp?tablename=product3&code=&keyno=<%=rs("id")%>" width="90" height="90" border="0"></a></td>
<%else%>
<td width="90" height="90" align="center" bgcolor="ffffff"><font color=666666>暂无图片</font></td>
<%end if%>
</tr>
<tr><td><font color="#666666"><strong><a href="<%=url%>"><font color="986A01"><%=cutstr(rs("title"),8,0)%></font></a></strong></td></tr>
</table>
</div>
</td>
<%rs.movenext%>
<td width="150">
<div align="center">
<table width="96%" border="0" cellpadding="00" cellspacing="0" class="link1">
<tr>
<%if rs("picflag")=1 then%>
<td width="90" height="90" align="center" bgcolor="ffffff"><a href="<%=url%>"><img src="./myasp_pic_display.asp?tablename=product3&code=&keyno=<%=rs("id")%>" width="90" height="90" border="0"></a></td>
<%else%>
<td width="90" height="90" align="center" bgcolor="ffffff"><font color=666666>暂无图片</font></td>
<%end if%>
</tr>
<tr><td><font color="#666666"><strong><a href="<%=url%>"><font color="986A01"><%=cutstr(rs("title"),8,0)%></font></a></strong></td></tr>
</table>
</div>
</td>
</tr></table>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<%
rs.movenext
loop
rs.close
%>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td>
<td >共有 <%=recordcount%> 条记录</td>
<td height="30" align="right"><a href="<%=pageUrl&pageno-1%>">上一页</a> <%=pageno%>/<%=pagecount%> <a href="<%=pageUrl&pageno+1%>">下一页</a></td>
<td width="20"></td>
</tr>
</table>
<table width="96%" height="8" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td align="center" height="30"> </td>
</tr>
</table>
</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
<!--#include file="end.asp"-->