日期:2014-05-17  浏览次数:21130 次

字段循环读出,放在一个变量中..
<%set   rs=server.createobject( "adodb.recordset ")
sql= "select   *   from   pic   order   by   smt_id   desc "
rs.open   sql,conn,1,1
if   rs.eof   and   rs.bof   then   %>
pics= "Uservod/1.jpg|Uservod/2.jpg|Uservod/3.jpg|Uservod/4.jpg|Uservod/5.jpg|Uservod/6.jpg "
<%else   %>
<%do   while   not   rs.eof%>  
pics=pics& <%=rs( "smt_pics ")%>
<%
rs.movenext
response.write   pics
loop
rs.close
set   rs=nothing
%>
<%end   if%>

为什么读出来的pics   不是一个一个字段加起来呢????
请指教,,在线等...郁闷.给分.


------解决方案--------------------
<%
pics = " "
do while not rs.eof
pics = pics & rs( "smt_pics ") & "| "
rs.movenext
loop
If pics <> " " Then pics =Left(pics,Len(pics)-1)
&>
pics = " <%=pics%> ";