首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

asp的写法,比较简单,但小弟我比较笨

2012-03-18 
求一个asp的写法,比较简单,但我比较笨sql2 selectgsidfromduizhaobiaowherezyid &cname& 语句执行的

求一个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
这也是一种方式

热点排行