constr=...
set cn=...
set rs=...
cn.open constr
sql="select * from table order by id"
rs.open sql,cn,1,1
if rs.eof and rs.bof then
response.write"data-system overflow"
end if
'定义数组,数组长度为记录的个数
l=rs.recordcount
dim c(l)
i=1
'将id值逐个赋值到数组中
do while not(rs.eof and rs.bof)
c(i)=rs("id")
rs.movenext
i=i+1
loop
'从数组中取出id值作为查询条件查询数据库
sqll="select * from table where id='"&c(i)&"' "
for i=1 to l
rs.open sql,cn,1,1
next
rs.close
cn.close
set rs=nothing