日期:2014-05-17  浏览次数:20961 次

[求助]问题不难,主要是转换
sql= "select   top   20   Content   from   PE_Article "
for   i=0   to   2
html=rs( "Content ")
result=Mid(html,Instr(html, "2 "),9)
rs.movenext
for   j=1   to   2
html2=rs( "Content ")
result2=Mid(html2,Instr(html2, "2 "),9)
if   result=result2   then
Response.write   true
else
Response.write   false
end   if
rs.movenext
next
next
请问一下如何把FOR语句根据结果集(RS)的长度进行循环.我试过几次都出现错误,请大家帮我修改一下..谢谢.

------解决方案--------------------
用do...loop循环哎~
------解决方案--------------------
实在想要结果集长度的话......
RecordSet的RecordCount属性
------解决方案--------------------
你上面的结果集是rs.recordcount=20
i=1
do while not rs.eof and i <=rs.recordcount
....
rs.movenext
i=i+1
loop