急救,在线等待啊,解决了一定给高分,谢谢!

zblby 2003-08-30 01:23:41
sql=" update article set hits=hits+1 where articleid="&request("id")
这一句有什么错误啊,下面是浏览是的提示。


Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'articleid=' 中。

/bing/article/list.asp,行13
...全文
64 28 打赏 收藏 转发到动态 举报
写回复
用AI写文章
28 条回复
切换为时间正序
请发表友善的回复…
发表回复
Bullforg 2003-09-03
  • 打赏
  • 举报
回复
跟你说先在查询分析器里调试你的SQL语句!有什么错误报的很清楚!
aloxy 2003-08-31
  • 打赏
  • 举报
回复
hit?
articleid="'&cint(request("id"))&'"?
bigspook 2003-08-31
  • 打赏
  • 举报
回复
提醒你一个最简单的可能性,数据库是只读的,把文件属性该为EVERYONE完全控制!
formatkm 2003-08-31
  • 打赏
  • 举报
回复
你看看你的if或者是for,select……case等语句加了end if或end……什么了吗,错误是这产生的和数据库操作没有关系
pazll 2003-08-31
  • 打赏
  • 举报
回复
你的程序写出来也有漏洞啊,注意了哦;
奉送你一个ID边界检查的函数,防范SQL injection攻击啊;
function Num_id(getID)
dim ID,lID,tID:ID=getID
if ID="" or isnull(ID) then Num_id="":exit function
lID=len(ID)
for i = 1 to lID
tID=left(ID,i)
if not isnumeric(tID) then Num_id=INT(left(ID,i-1)):exit function
next
Num_id=INT(tID)
end function
pazll 2003-08-31
  • 打赏
  • 举报
回复
晕啊,你们怎么都不问问hits的字段类型是什么呢?
还有就是那个什么缺少end,不关程序的事,是asp的错误提示页面自身问题;不要理他;
其实,就是字段类型的问题;
自己好好检查每个字段的类型,如果是字符窜类型就要用引号。
记住这些,包你一分钟内排除错误;
lions911 2003-08-31
  • 打赏
  • 举报
回复
自己打印出SQL语句,在查询分析器里面调试!成功了在通过ASP调用!
lions911 2003-08-31
  • 打赏
  • 举报
回复
自己打印出SQL语句,在查询分析器里面调试!成功了在通过ASP调用!
奇玉 2003-08-31
  • 打赏
  • 举报
回复
我一般这样写,
sql=" update article set hits=hits+1 where articleid="'&request("id")&'"
zblby 2003-08-31
  • 打赏
  • 举报
回复
告诉你们:hits是“数字”型的,我实在找不出来啊。你们说的我都试了
dgm8 2003-08-30
  • 打赏
  • 举报
回复
转换一下cint(request("id"))

sql="update article set hits=hits+1 where articleid="&cint(request("id"))

还有集合名重复
liuxiaobo 2003-08-30
  • 打赏
  • 举报
回复
ID的值没有取到!
如果是真的少了'end'的话,
“/iisHelp/common/500-100.asp,行242

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'articleid=' 中。

/bing/article/list.asp,行13 ”这些提示是不会出现的!
wuhaihua 2003-08-30
  • 打赏
  • 举报
回复
可能是字段名错误吧 [articleid]
chjpeng 2003-08-30
  • 打赏
  • 举报
回复
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="code.asp"-->
<%
dim sql
dim rs
dim rstype
dim typesql
dim typeid,typename,classname,classid,Nclassname,Nclassid
dim title
set rs=server.createobject("adodb.recordset")
sql="update article set hits=hits+1 where articleID="&request("id")
rs.open sql,conn,1,3
sql="select Aclass.class,ANclass.Nclass,article.title,article.classid,article.Nclassid from article,Aclass,ANclass where article.classid=Aclass.classid and article.Nclassid=ANclass.Nclassid and article.articleID="&request("id")
rs.open sql,conn,1,1
if not rs.eof then
title=rs("title")
classid=rs("classid")
Nclassid=rs("Nclassid")
classname=rs("class")
Nclassname=rs("Nclass")
end if
rs.close
%>

好像是通用文章管理里面的一段代碼,上面是我在用的,沒有問題
檢查一下數據庫有沒問題~
Brookes 2003-08-30
  • 打赏
  • 举报
回复
应该是你的id没有正确设定

try:
id=cint(request("id"))
if id="" then id=1
sql="update article set hits=hits+1 where articleid="&id

or just try:
sql=" update article set hits=hits+1 where articleid=1"
Bullforg 2003-08-30
  • 打赏
  • 举报
回复
把SQL输出到查询分析器里运行看看!
CTBOK 2003-08-30
  • 打赏
  • 举报
回复
试试把update前面的空格去掉?
emilchan6k 2003-08-30
  • 打赏
  • 举报
回复
ben, 很明显哪个if 语句什么的没end if嘛~(btw:前提是articleid是int类型)
stefli 2003-08-30
  • 打赏
  • 举报
回复
看起来好象没有什么错误啊,
你看看先去掉sql语句中update前面的空格.
我实在是找不到错误,所以就看这个了.
liaijian 2003-08-30
  • 打赏
  • 举报
回复
上面的还不能解决,只能是request("id")没有取到值了,即sql语句根本不成立,可以查看上一页
加载更多回复(8)

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧