新微赢技术网

标题: 游览次数问题? [打印本页]

作者: 30岁就改变    时间: 2010-1-8 05:49
标题: 游览次数问题?
各位大侠好!
小一个问题想问一下:就是想在ID递过来显示文章的那一页可以记录那一页被一共游览多少次?

我在写代码出现了这样的错误:
2007年9月6日 19:45:47 星期四 设为首页 | 加入收藏 | 联系我们



·首页 · 学习 · 技术流交 · 学习 · 留言·
  你的位置:首页>>
Microsoft OLE DB Provider for ODBC Drivers '80040e14'
[Microsoft][ODBC Microsoft Access Driver] UPDATE 语句的语法错误。
\wwwroot\zjaaz\show.asp, line 23
--------------------------------------------------------------------------------
Host by NetBox Version 2.8 Build 4128




那一页代码是:
<%startTime=timer()%>
<!-- #include file="conn.asp" -->
<!-- #include file="config.asp" -->
<%id=saferequest("id",1)%>
<%set showbbs=conn.execute("select*from bbs where id="&id&"")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>欢迎光临--<%=titlename%></title>
<link href="images/type.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- #include file="webtop.asp" -->
 
<table borderColor="#d8d8f0" cellSpacing="0" cellPadding="0" width="730" align="center" bgColor="#ffffff" border="1" id="table1">
<tr align="left">
<td height="22" class="tr" align=center>
<p align="left">你的位置:<a href=index.asp>首页</a>>>
<%
dchsql="update [bbs] set number=number+1 where id="&cint(request.querystring("id"))
conn.execute(dchsql)
%>
<%
set rs2 = server.CreateObject("adodb.recordset")
rs2.open "[cls] where typeid="&showbbs("typeid"),conn,1,3
if not rs2.eof then
%><%=rs2("typename")%>
<%else%>
无此类别
<%end if
rs2.close
%>>><%=showbbs("title")%>
</td>
</tr>
<tr>
<th> </th>
</tr>
<tr>
<td class="td" align="middle" width="727" height="36">
<font size=4><%=showbbs("title")%></font></td>
</tr>
<tr>
<td class="td" align="middle" width="727" height="24">
发表时间:<%=showbbs("date")%>&nbsp;&nbsp;&nbsp; 发表IP: <%=showbbs("ip")%> 游览次数:<%=showbbs("number")%></td>
</tr>
<tr>
<td width="727" height="139" valign="top" style="padding-left: 15px; padding-right: 15px; padding-top: 10px; padding-bottom: 20px">
 &nbsp;&nbsp;&nbsp;&nbsp;<%=showbbs("bz")%></td>
</tr>
<tr>
<td class="td" align="middle" width="727" height="24" valign="top">
<img src="images/pn.gif" width="18" height="18" align="middle" border="0">
 <a href="javascript:window.print();" style="text-decoration: none; font-size: 12px; color: #000000"><img src="images/print.gif" width="19" height="16" align="absmiddle" border="0"> 打印本文</a> 
 <a href="javascript:window.external.AddFavorite('<%=url%>/show.asp?id=<%=id%>','<%=showbbs("title")%>')" class="white"><img src="images/sc.gif" width="22" height="14" align="absmiddle" border="0"> 加入收藏</a> <a href="#top" style="text-decoration: none; font-size: 12px; color: #000000"><img src="images/top.gif" width="12" height="11" align="absmiddle" border="0"> 返回顶部</a> <a href="javascript:window.close()" style="text-decoration: none; font-size: 12px; color: #000000"><img src="images/gb.gif" width="23" height="18" align="absmiddle" border="0"> 关闭窗口</a></td>
</tr>
</td>
</tr>
</table>
<p align="center"><!-- #include file="aaz_bottom.asp" -->
<%response.end%>
 <table borderColor="#d8d8f0" cellSpacing="0" cellPadding="0" width="730" align="center" border="1" id="table11">
<tr>
<td class="tr" align="middle" height="22" width="492">
<p align="left">&nbsp;<font face="Wingdings">
<font color="#008000">v</font> </font> <b>相关评论</b></td>
<td class="tr" align="middle" height="22" width="235">
<a href="comment.asp?id=<%=id%>">点击查看更多评论&gt;&gt;&gt;</a></td>
</tr>
<tr>
<th colSpan="2"> </th>
</tr>
<tr>
<td align="middle" bgColor="#ffffff" height="248" colspan="2" style="padding-top: 5px; padding-bottom: 5px">
<%
set rs3 = server.CreateObject("adodb.recordset")
sql="select * from comment where com_typeid="&id&" order by com_id desc"
rs3.open sql,conn,1,1
if rs3.bof and rs3.eof then
%><table borderColor="#d8d8f0" border="1" cellpadding="0" cellspacing="0" width="98%" id="table13">
<tr>
<td height="22" style="padding-left: 5px; padding-right: 5px">暂无回复</td>
</tr>
</table><br><%else
for i=1 to 5
if rs3.eof or rs3.bof then exit for
%>
<table borderColor="#d8d8f0" border="1" cellpadding="0" cellspacing="0" width="98%" id="table13">
<tr>
<td class="tr" height="22"><span lang="en">&nbsp;&nbsp; </span>评论人:<%=Replace(Replace(rs3("com_name"),"<","&lt;"),">","&gt;")%>&nbsp; 评论时间:<%=rs3("com_date")%>&nbsp; <%if session("adminlogin")=true then%>IP:<%=rs3("com_ip")%>&nbsp;<font size="3"><a href=delcom.asp?id=<%=rs3("com_id")%>>×</a><%
end if%></font></td>
</tr>
<tr>
<td height="22" style="padding-left: 5px; padding-right: 5px"><%=Replace(Replace(rs3("com_content"),"<","&lt;"),">","&gt;")%></td>
</tr>
</table>
<br><%rs3.movenext
next
end if
rs3.close%>
<table borderColor="#d8d8f0" border="1" cellpadding="0" cellspacing="0" width="98%" id="table12">
<tr>
<td height="22" colspan="3">&nbsp;
<font face="Wingdings" color="#008000">v
</font><a name="comment">发表评论</a>
</td>
</tr><tr>
<th colSpan="3" height="6"></th>
</tr>
<script laugeage="vbscript">

</script>
<form method="POST" name="svcomment" action="svcomment.asp?id=<%=id%>">
<script language=vbscript>
function svcomment_onsubmit()
if len(trim(window.document.svcomment.com_name.value))<1 then
window.alert("请输入您姓名!")
window.document.svcomment.com_name.focus()
svcomment_onsubmit=false
end if
exit function
if len(trim(window.document.svcomment.com_content.value))<1 then
window.alert("请输入评论内容!")
window.document.svcomment.com_content.focus()
svcomment_onsubmit=false
end if
exit function
end function
</script>
<tr>
<td height="22" valign="middle" width="12%" align="right">&nbsp;&nbsp;
姓名:</td>
<td height="22" width="38%" style="padding-left: 5px; padding-right: 5px">
<input type="text" name="com_name" size="20"></td>
<td width="46%" style="padding:5px; line-height: 150%" align="left" valign="top" rowspan="3">
&nbsp;<font face="Wingdings">
v</font><span lang="en"><font face="Wingdings"> </font></span>
请遵守《互联网电子公告服务管理规定》及中华人民共和国其他各项有关法律法规。<br>
&nbsp;<font face="Wingdings">
v</font><span lang="en"><font face="Wingdings"> </font></span>
严禁发表危害国家安全、损害国家利益、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的评论 。<br>
&nbsp;<font face="Wingdings">
v </font> 用户需对自己在使用本站服务过程中的行为承担法律责任(直接或间接导致的)。<br>
&nbsp;<font face="Wingdings">
v </font> 本站管理员有权保留或删除评论内容。<br>
&nbsp;<font face="Wingdings">
v </font> 评论内容只代表网友个人观点,与本网站立场无关。</td>
</tr>
<tr>
<td height="139" valign="middle" width="12%" align="right">评论内容:</td>
<td height="139" width="38%" style="padding-left: 5px; padding-right: 5px">
<textarea rows="7" name="com_content" cols="36"></textarea></td>
</tr>
<tr>
<td height="22" valign="middle" width="52%" align="right" colspan="2">
<p align="center"><input type="submit" value="提交评论" name="B1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="重置" name="B2"></td>
</tr></from>
</table>
</td>
</tr>
</table>
<p align="center"><!-- #include file="aaz_bottom.asp" -->
</p>
</body>
</html>
作者: 独臂神军    时间: 2010-1-8 05:49
number这个字段为什么要加[]中括号?
作者: 爱情tp乞丐    时间: 2010-1-8 05:50
看的
作者: 三弓厶    时间: 2010-1-8 05:50
修改成
number=showbbs("number")+1
dchsql="update [bbs] set number=number where id="&cint(request.querystring("id"))




欢迎光临 新微赢技术网 (http://bbs.weiying.cn/) Powered by Discuz! X3.2