Dim strTemp
strTemp = objConn.execute("select id from table1 where age>18")结果出错了,我们获取不到其值!有时我们非常需要将结果排成"项目1,项目2,项目3,项目4"的格式怎么办?使用movenext一条一条输出再组合而成当然可以,但我们还有更简单的办法,就是用getString方法,如下:
Dim strTemp
strSql = "select id from table1"
Set objRs = Server.CreateObject("ADODB.RecordSet")
objRs.open strSql,objConn,1,2
strTemp = objRs.getstring(,,",",",","error")
objRs.close
set objRs = nothing注意将最后一个逗号去掉就可以了^_^
评论(0)
暂无评论。