从数据库中提取新闻标题,在前台页面连续向上滚动显示(不能有空白区的),谢谢!
哪位高手指点下,以下是源程序文件:(补充:我在网上搜了很多,但嵌进来要么不行要么显示上破坏了之前的布局,)谁指点指点,百万分感谢!
<%
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function%>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 5 * from news where BigClassName='行业科技' order by AddDate desc "
rs_news.open sqltext4,conn,1,1
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%i=0
do while not rs_news.eof
strr=year(rs_news("AddDate"))&"-"&month(rs_news("AddDate"))&"-"&day(rs_news("AddDate"))%>
<tr align="center">
<td width="28" align="left" style='BORDER-bottom: #C2C2C2 1px dashed'><img src="images/newdot.jpg" width="4" height="7" /></td>
<td style='BORDER-bottom: #C2C2C2 1px dashed' width="747" height="25" align="left" ><a class="txt" href="shownew.asp?id=<%=rs_news("id")%>&title=媒体报道" target="_blank">
<%=cutstr(rs_news("title"),15)%></a> </td>
<td style='BORDER-bottom: #C2C2C2 1px dashed' width="224" align="right" ><a class="txt" href="shownew.asp?id=<%=rs_news("id")%>&title=媒体报道媒体报道" target="_blank">[<%=strr%>]</a></td>
</tr>
<%rs_news.movenext
i=i+1
loop
rs_news.close %>
</table></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
[ 本帖最后由 kyle_mao 于 2012-2-20 10:50 编辑 ]