请问高人这段ASP代码,哪里出错了,谢谢

来源:百度知道 编辑:UC知道 时间:2024/09/22 13:33:21
<table border="0" width="97%" cellpadding="0" cellspacing="3" >
<tr>

<!--要符合是推荐、置顶、及审核的文章-->
<%set rst=server.createobject("adodb.recordset")
sql="select top 2 * from news where tj='推荐' and ontop=5 and sh=1 order by id desc"
rst.open sql,conn,1,1
title=rst("title")
content=rst("content")
if rst.eof and rst.bof then
response.write"该栏目还没有影片"
else
dim row_count51
row_count51=1
do while not rst.eof
%>

<td> ·<a href="<%=path%><%=hrefID(rst("ID"),rst("filename"))%>" target="_blank" title='<%=title%>'><font size=3><strong><%=Left(Rst("Title"),10)%></strong></font></a>

1.sql="select top 1 * from news where tj='推荐' and ontop=5 and sh=1 order by id desc"
top 2 改成 top 1
2.

<%if trim(rst("pic"))<>"" then
'显示20个文字content_20=left(rst("content"),20)
Response.Write "此新闻有图片,请点击查看..." '显示20个文字&content_20
elseif trim(rst("pic"))="" then
content_50=left(rst("content"),50)
Response.Write ""&content_50
%>
<%end if%>
去掉,改成:
<%
content_20=left(rst("content"),20)
Response.Write ""&content_20
%>