云蝠大厦有什么好吃的:asp中取自动循环变量的最大值问题
来源:百度文库 编辑:中科新闻网 时间:2024/05/15 10:42:03
在程序中,我用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>
<%
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>
试试看吧~
Response.Write (i-1)