首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

[]有关问题不难,主要是转换

2012-02-22 
[求助]问题不难,主要是转换sql selecttop20ContentfromPE_Article fori0to2htmlrs( Content )resul

[求助]问题不难,主要是转换
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

热点排行