记数器为什么不会自动增加?
我写了个新闻阅读的网页
网页内容可以正常显示,但是记数器不自动添加,
请帮忙看看是哪里错了,先谢谢了,
代码如下
<!--#include file="conn.asp" -->
<%
sSql="Select D_Count From NewsData Where D_ID="&id
oRs.Open sSql,oConn,1,3
If Not oRs.Eof Then
oConn.execute "update NewsData set D_Count=D_Count+1 where D_ID="&id
End If
oRs.Close
%>
<%
SQL="Select * from Newsdata Where D_ID="&id
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open SQL,con,1,1
%>
<table width="80%" >
<tr>
<td ><%=rs("D_Title")%> '新闻标题
<br>该新闻已被浏览过<%=rs("D_Count")%>次
</td>
</tr>
<tr>
<td>
<%=rs("D_Content")%> '新闻内容
</td>
</tr>
</table>
<%
rs.Close
Set rs=nothing
%>