我目前的代码是这样的: 会不会很土啊??? sql="select ID from 表 where ...." rs.open......... do while not rs.eof itemid=rs("ID") if idstring="" then idstring=itemid else idstring=idstring&"|"&itemid end if rs.movenext loop
shuzu=split(idstring,"|") '我的目的是得到这个数组
有没有更好的方法?
[解决办法] 直接给数组不可以吗 [解决办法]
但没必要拼成字符串再分隔成数组呀,直接装进数组不得了 [解决办法] good!!!!!!!!!! [解决办法] 楼主,也有别的方法,就是可以试试把sql文改一下,比如说你用的数据库是SQL server的话,可以用For XML Path()这种语法, 查出来的数据像这样 ID ---------------------- 001,002,003,004 ---------------------- 然后在split(','). [解决办法]