怎么把ASP显示前10调新闻改成随机显示的,代码如下,求高手帮忙。
<%SetRs=server.createobject("ADODB.Recordset")Rs.Open"selecttop10*fromNewsTblwhereNew...
<%
Set Rs = server.createobject("ADODB.Recordset")
Rs.Open "select top 10 * from NewsTbl where NewsTypeId = 59 order by AddDate desc" , Conn , 1 , 1
j = 1
Do While Not Rs.Eof
Response.Write("<tr>" & vbCrLf)
Response.Write("<td height=""18""><span class=""red"">·<a href=""News_View.asp?NewsId="& Rs("NewsId") &""" target=""_blank"" class=""top_right"">")
If Len(Rs("NewsTitle")) > 10 Then
Response.Write(Left(Rs("NewsTitle") , 10) & "…")
Else
Response.Write(Rs("NewsTitle"))
End If
Response.Write("</a></td>" & vbCrLf)
Response.Write("</tr>" & vbCrLf)
Rs.MoveNext
j = j + 1
If j > 14 Then Exit Do
Loop
Rs.Close
%> 展开
Set Rs = server.createobject("ADODB.Recordset")
Rs.Open "select top 10 * from NewsTbl where NewsTypeId = 59 order by AddDate desc" , Conn , 1 , 1
j = 1
Do While Not Rs.Eof
Response.Write("<tr>" & vbCrLf)
Response.Write("<td height=""18""><span class=""red"">·<a href=""News_View.asp?NewsId="& Rs("NewsId") &""" target=""_blank"" class=""top_right"">")
If Len(Rs("NewsTitle")) > 10 Then
Response.Write(Left(Rs("NewsTitle") , 10) & "…")
Else
Response.Write(Rs("NewsTitle"))
End If
Response.Write("</a></td>" & vbCrLf)
Response.Write("</tr>" & vbCrLf)
Rs.MoveNext
j = j + 1
If j > 14 Then Exit Do
Loop
Rs.Close
%> 展开
2个回答
2011-12-01
展开全部
1231222222222222222222222222
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询