asp中取自动循环变量的最大值问题
在程序中,我用i=0,i=i+1自动循环,最后怎样取i的最大值,即最后一次循环的值?i=0'数据库操作ifproductlist<>""then%><%sql="sele...
在程序中,我用i=0,i=i+1自动循环,最后怎样取i的最大值,即最后一次循环的值?
i=0
'数据库操作
if productlist<>"" then
%>
<%
sql="select * from product where id in ("&productlist&") order by id"
Set rs = conn.Execute( sql )
'response.write sql
else
end if
'On Error Resume Next
Sum = 0
While Not rs.EOF
i=i+1
%>
<tr>
<td height="18" width="18%">所买的商品种类<%=max(i)%></td> 展开
i=0
'数据库操作
if productlist<>"" then
%>
<%
sql="select * from product where id in ("&productlist&") order by id"
Set rs = conn.Execute( sql )
'response.write sql
else
end if
'On Error Resume Next
Sum = 0
While Not rs.EOF
i=i+1
%>
<tr>
<td height="18" width="18%">所买的商品种类<%=max(i)%></td> 展开
2个回答
展开全部
<%
sql="select * from product where id in ("&productlist&") order by id"
Set rs = conn.Execute( sql )
'response.write sql
else
end if
'On Error Resume Next
rs.movefirst
do While Not (rs.EOF and rs.bof )
rs.movenext
loop
%>
<tr>
<td height="18" width="18%">所买的商品种类<%rs.recordcount%></td>
试试看吧~
sql="select * from product where id in ("&productlist&") order by id"
Set rs = conn.Execute( sql )
'response.write sql
else
end if
'On Error Resume Next
rs.movefirst
do While Not (rs.EOF and rs.bof )
rs.movenext
loop
%>
<tr>
<td height="18" width="18%">所买的商品种类<%rs.recordcount%></td>
试试看吧~
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询