黄岛王台最新招聘信息:对象不支持此属性或方法: 'eofResponse'

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 17:39:46
<!--#include file="conn.asp"-->
<%
'------------------------------------
'函数:TopNews
'作用:调用最新几条新闻
'参数:num最新几条classname新闻分类titlelen新闻标题字数
'------------------------------------
Function TopNews(num,classname,titlelen)
dim rs_top
set rs_top=conn.execute("select top "&num&" * from news where art_id='"&classname&"' order by ctime desc")
if rs_top.bof and rs_top.eof then
Response.write("当前没有新闻!")
else
Response.Write ("<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">")
do while not rs_top.eofResponse.Write (" <tr>")
Response.Write (" <td width=""5%"">标题</td>")
Response.Write (" <td width=""90%"" align=""left""> <a href=show.asp?news_id="&rs_top("news_id")&" target=_blank>"&left(rs_top("art_name"),titlelen)&"</a></td>")
Response.Write (" </tr>")
rs_top.movenext
loop
Response.Write ("</table>")
end if
rs_top.close
set rs_top=nothing
End Function
%>

<%call TopNews (10,"新闻",30) %>

do while not rs_top.eof
Response.Write (" <tr>")
10行左右吧
打个回车

嘿嘿~~~~~~~~~~~~~~~~

else
Response.Write ("<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">")

do while not rs_top.eof

Response.Write (" <tr>")
Response.Write (" <td width=""5%"">标题</td>")
Response.Write (" <td width=""90%"" align=""left""> <a href=show.asp?news_id="&rs_top("news_id")&" target=_blank>"&left(rs_top("art_name"),titlelen)&"</a></td>")
Response.Write (" </tr>")
rs_top.movenext
loop