| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 616 人关注过本帖
标题:[求助]LOOP 的问题?
只看楼主 加入收藏
alanbelive
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-6-12
收藏
 问题点数:0 回复次数:2 
[求助]LOOP 的问题?

<%
dim rs
set Rs=server.CreateObject("ADODB.RecordSet")
'if id<>"" then
'sql="select * from product where id="&id
'else
sql="select * from product where typeid=447 order by Id desc"
'end if
Rs.Open sql,conn,1,1
if rs.eof then
response.write "<tr><td align=center>目前还没有内容。<br></td></tr>"
else
rs.pagesize=5
'顯示10條信息
ipage=clng(request("page"))
'response.write ipage
if ipage<=0 then
ipage=1
end if

if ipage>=rs.pagecount then
ipage=rs.pagecount
end if

rs.absolutepage=ipage
rowcount=rs.pagesize
do while not rs.eof and rowcount>0
if rowcount>8 then

end if
%>
<tr>
<td width="47%" valign="top" class="biank">
<% if not Rs.eof then%>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="t1Copy2"><a href="products_detail.asp?id=<%=Rs("id")%>&fid=<%=Rs("typeid")%>" class="t5" style="cousor:hand;"><img id="Main_Img" src="<%if Rs("Main_Img") <> "" then
response.Write(replace(Rs("Main_Img"),"../../upimages","manage/upimages"))
else
response.Write("images/nopic_e.jpg")
end if%>" border="0" width="90"></a></td>
</tr>
</table>
<table width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td class="t1Copy2"><span class="biankCopy"><span class="t7"><%=Rs("no")%></span></span> </td>
</tr>
</table>

</td>
</tr>

</table></td>
</tr>
<tr valign="top">
<td height="120" colspan="3"><span class="biank">
<%
rs.movenext()
rowcount=rowcount-1
loop
%>
为什么还是错误显示缺少DO

搜索更多相关主题的帖子: LOOP 
2006-06-12 18:08
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
do while not rs.eof and rowcount>0
改成这样呢?
do Until rs.eof
2006-06-12 21:33
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
你自己写代码的问题,

[QUOTE]

<%
dim rs
set Rs=server.CreateObject("ADODB.RecordSet")
'if id<>"" then
'sql="select * from product where id="&id
'else
sql="select * from product where typeid=447 order by Id desc"
'end if
Rs.Open sql,conn,1,1
if rs.eof then
response.write "<tr><td align=center>目前还没有内容。<br></td></tr>"
else
rs.pagesize=5
'顯示10條信息
ipage=clng(request("page"))
'response.write ipage
if ipage<=0 then
ipage=1
end if

if ipage>=rs.pagecount then
ipage=rs.pagecount
end if

rs.absolutepage=ipage
rowcount=rs.pagesize
do while not rs.eof and rowcount>0
if rowcount>8 then

end if
%>
<tr>
<td width="47%" valign="top" class="biank">
<% if not Rs.eof then%> 这句先不管是否多余,你先看看是不是少了End IF
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="t1Copy2"><a href="products_detail.asp?id=<%=Rs("id")%>&fid=<%=Rs("typeid")%>" class="t5" style="cousor:hand;"><img id="Main_Img" src="<%if Rs("Main_Img") <> "" then
response.Write(replace(Rs("Main_Img"),"../../upimages","manage/upimages"))
else
response.Write("images/nopic_e.jpg")
end if%>" border="0" width="90"></a></td>
</tr>
</table>
<table width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td class="t1Copy2"><span class="biankCopy"><span class="t7"><%=Rs("no")%></span></span> </td>
</tr>
</table>

</td>
</tr>

</table></td>
</tr>
<tr valign="top">
<td height="120" colspan="3"><span class="biank">
<%
rs.movenext()
rowcount=rowcount-1
loop
%>

[/QUOTE]

以上也只是我所认为,不知是否正确,呵呵~~


http://www./
2006-06-13 09:11
快速回复:[求助]LOOP 的问题?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011185 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved