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

各位前辈,帮小弟看看
循环控制变量 'for' 无效
For j = 1 to 2
代码:
<td valign="top" width="53%">
<%
set myrs_root=server.CreateObject("adodb.recordset")
myrs_root.Open "select * from t_taobao_catalog where mever='" & current_ver & "' order by InfoClsIndex",conn,1,1
if not myrs_root.eof then
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><td>
</tr>
<%For j = 1 to 7
If myrs_root.EOF Then Exit For
%>
<tr>
<%
for x=1 to 2
%>
<td>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>

<td height="28" ><a href="../web/docc/taobao1.asp?catalogid=<%=myrs_root("catalogID")%>"><%=myrs_root("catalogname")%></a></td>

<td align="right"> <img alt="" style="border:0px;" src="" /> </td>

</tr>
<tr>
<td colspan="2" style="text-align: left; height:18px;">
<%
sql="select t.id,t.catalogid,t.typename from t_taobao_type t,t_taobao_catalog p where t.mever='cn' and t.catalogid=p.CatalogID"
set myrs=server.CreateObject("adodb.recordset")
myrs.open sql,conn,1,1
if not myrs.eof then
%>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<%For j = 1 to 2
If myrs.EOF Then Exit For
%>

<tr>
<%
for x=1 to 4
%>

<td>
<%if myrs("catalogid")=myrs_root("catalogid") then%>
<a href="docc/taobao2.asp?type_id=<%=myrs("id")%>"><%=myrs("typename")%></a>|
<%end if%>
</td>
<%
myrs.MoveNext
If myrs.EOF Then Exit For
next
%>
</tr>
<%

'myrs.MoveNext
'If myrs.EOF Then Exit For
next
%>
</table>
<%end if
myrs.close
set myrs=nothing
%>
</td>
</tr>
</table>

</td>
<td width="5%"></td>
<%
myrs_root.MoveNext
If myrs_root.EOF Then Exit For
next
%>
</tr>
<%

'myrs_root.MoveNext
'If myrs_root.EOF Then Exit For
next
%>


</table>
<%end if
myrs_root.close
set myrs_root=nothing
%>
</td>

搜索更多相关主题的帖子: 语句 root myrs 
2006-10-07 13:25
cxyang
Rank: 1
等 级:新手上路
帖 子:73
专家分:0
注 册:2006-8-10
收藏
得分:0 
各位大侠帮忙看看,怎么也改不出来
2006-10-07 16:08
渚薰
Rank: 6Rank: 6
等 级:贵宾
威 望:22
帖 子:1132
专家分:0
注 册:2006-8-6
收藏
得分:0 

嵌套的循环体要区分循环变量,不要都是同一个


个人ajax技术专题站: " target="_blank">http://www. 我不会闲你烦,只会闲你不够烦!
2006-10-07 17:56
雷雷
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2006-10-1
收藏
得分:0 
代码应该整理一下,这样别人看着也舒服些。

我就是我,走猪的路,让猫狗们去说吧…… Http://www./
2006-10-08 17:44
andynil
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-10-8
收藏
得分:0 
for 出错了。无结束语!你先一段一段测试,就能发现问题!!
2006-10-08 18:17
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
程序思想有问题,自己重新学习一下如何写好程序

http://www./
2006-10-09 09:14
快速回复:求助:for循环语句
数据加载中...
 
   



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

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