请假ASP代码问题

来源:百度知道 编辑:UC知道 时间:2024/06/05 09:09:21
</tr>
</table>
<%
classid=2
set rs=conn.execute("SELECT top 14 newsid,title,mode,weburl,inputtime,commend From Hg_news where classid="&classid&" and mood=1 and commend=1 order by inputtime desc")
if not(rs.eof and rs.bof) then
%>
<table width="96%" border="0" cellspacing="5" cellpadding="0" class="hui02" align="center">
<%do while not rs.eof%>
<tr>
这些代码是自动更新么

set rs=conn.execute("SELECT top 14 newsid,title,mode,weburl,inputtime,commend From Hg_news where classid="&classid&" and mood=1 and commend=1 order by inputtime desc") '这不是自动更新,这只是一个查询语句,查询出满足条件的前14条记录。
if not(rs.eof and rs.bof) then '如果上面的查询结果不是空的那么就用<%do while not rs.eof%> 循环显示出来,否则就执行<%else%>后面的代码.
更新语句是 update 表名 set …… while ……

这是根据条件读取数据库中的数据,并显示表中的符合条件的前十四条记录,不过代码不全。后台添加了符合条件的新纪录,前台就自动更新。

ASP做的网页是动态显示的,上面代码是显示数据库里的内容,只要数据库里内容改变,网页信息刷新一下就会发生变化。