比如我的数据库里有5条记录,我将他们查询出来,然后用一个变量保存所有的id
像这样:sumid=1,2,3,4,5 sumid是变量,后面的5个数字是id值,(asp网站)
set rs=server.CreateObject("adodb.recordset")
sql="select * from Lei "
rs.open sql,conn,1,1
counts=rs.recordcount
for i=0 to counts
aaa(i)=rs("Lid")
next
response.Write aaa(i)
rs.close
set rs=nothing
上面是我用数组做的,可是说aaa类型不匹配
for i=0 to counts
ii=ii+rs("Lid")+"|"
next
aaa=split(ii,"|")
for j=1 to counts
response.write aa(j)
next
Dim aaa()
set rs=server.CreateObject("adodb.recordset")
sql="select * from Lei "
rs.open sql,conn,1,1
counts=rs.recordcount
for i=0 to counts - 1
ReDim Preserve aaa(i)
aaa(i)=rs("Lid")
next
response.Write aaa(i)
rs.close
dim aaa()
set rs=server.CreateObject("adodb.recordset")
sql="select * from Lei "
rs.open sql,conn,1,1
counts=rs.recordcount
for i=0 to counts
aaa(i)=rs("Lid")
response.Write aaa(i)
next
rs.close
set rs=nothing
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息