一个RS排列例子

以上省份排列导航是在实际运用中常碰到。现总结代码于下面:
sql="select top 30 * from [In_provinces] where fid=0"
     set rs=server.createobject("adodb.recordset")
     rs.open sql,conn,1,1
     b=1
     do while not rs.eof
     i=1
    
     response.Write"<li>"
     while not rs.eof and i<=8
     response.Write "<a href=""career_units_list.asp?Placeid="&rs("id")&""">"&left(rs("province_city"),2)&"</a>"
     if i<8 and b<rs.recordcount then
      response.Write"&nbsp;|&nbsp;"
      end if
     rs.movenext
     i=i+1
     b=b+1
     wend
     response.Write"</li>"
     loop
     rs.close
     set rs=nothing
posted on 2011-11-28 14:13  anyi2000  阅读(163)  评论(0)    收藏  举报