求一个asp的写法,比较简单,但我比较笨
sql2= "select gsid from duizhaobiao where zyid= "&cname& " "
语句执行的结果如下所示:
gsid
-----------
454
457
我想把结果变成如:454,457 这种形式,在ASP中要如何写啊
------解决方案--------------------用一个循环就可以了
------解决方案--------------------是不是这样:
while not rs.eof
response.write rs( "zyid ")
rs.movenext
if not rs.eof then
response.write ", "
end if
wend
------解决方案--------------------dim str ,spl2
sql2= "select gsid from duizhaobiao where zyid= "&cname& " "
str=conn.execute(sql2).getstring (,,, ", ")
------解决方案-------------------- do while not rs.eof
response.write rs( "gsid ")& ", "
next
------解决方案--------------------do while not eof
str=rs( "gsid ")& ", "
------解决方案-------------------- while not rs.eof
response.write rs( "zyid ")
rs.movenext
if not rs.eof then
response.write ", "
end if
wend
楼上某同志写法思想很特别!我喜欢 呵呵 同意这种写法!
------解决方案--------------------do whil not rs.eof
response.write rs( "zyid ")
rs.movenext
if not rs.eof then
response.write ", "
end if
loop
这也是一种方式