<%set rs=server.CreateObject("adodb.recordset")
rs.open "select top 10 id,name,price2 from product where recommend=1 order by adddate desc",conn,1,1
dim icount
icount=rs.recordcount
if rs.eof and rs.bof then
response.write "无推荐商品"
else
i=0
do while not rs.eof
response.write " ·"
if len(trim(rs("name")))>12 then
response.write left(trim(rs("name")),10)&"..."
else
response.write trim(rs("name"))
end if
response.write " "&rs("price2")&"元 "
i=i+1
if i>=10 then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing%>
|