asp代码如何控制显示的记录数
<%setrs=server.createobject("adodb.recordset")sql="select*fromnewswhereshenhe=trueord...
<%
set rs=server.createobject("adodb.recordset")
sql="select* from news where shenhe=true order by NewsID desc"
rs.open sql,conn,1,1
do while not rs.eof
response.write "<img src=images/addani.gif><a href=news/newscontent.asp?id="+Cstr(rs("NewsID"))&" title="&rs("otitle")&" target=_self>"
if len(rs("otitle"))>14 then
response.write left(rs("otitle"),12)&"..."
else
response.write rs("otitle")
end if
response.write "</a> <span style=""FONT: 10px , Verdana"">[加入日期:"&rs("odate")&"]</span>"
if rs("odate")+2>=DateValue(date) then
response.write " <img src=images/new01.gif>"
end if
response.write"<br>"
rs.movenext
loop
rs.close
%>
要求显示6条记录 展开
set rs=server.createobject("adodb.recordset")
sql="select* from news where shenhe=true order by NewsID desc"
rs.open sql,conn,1,1
do while not rs.eof
response.write "<img src=images/addani.gif><a href=news/newscontent.asp?id="+Cstr(rs("NewsID"))&" title="&rs("otitle")&" target=_self>"
if len(rs("otitle"))>14 then
response.write left(rs("otitle"),12)&"..."
else
response.write rs("otitle")
end if
response.write "</a> <span style=""FONT: 10px , Verdana"">[加入日期:"&rs("odate")&"]</span>"
if rs("odate")+2>=DateValue(date) then
response.write " <img src=images/new01.gif>"
end if
response.write"<br>"
rs.movenext
loop
rs.close
%>
要求显示6条记录 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询