更新了编辑器,提交时出现 语法错误 (操作符丢失) 在查询表达式 'id=' 中。

zdjs00 2018-10-24 04:50:16
更新了编辑器,点提交的时候出现错误

Microsoft JET Database Engine 错误 '80040e14'
语法错误 (操作符丢失) 在查询表达式 'id=' 中。
/manage/service/service_add.asp,行 85

代码行是 conn.execute("update service set "&action&"='"&content&"' where id="&id)

下面是原代码,请高手帮看下
<!--#include file = "../Inc/Syscode.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../Inc/Admin_style.css" rel="stylesheet" type="text/css">
</head>
<body>
<%

set rs=server.CreateObject("adodb.recordset")
sql="select top 1 * from service"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
rs.addnew
rs.update
end if
action=request("action")
select case action
case "about"
title="关于我们"
content=server.HTMLEncode(rs("about")&" ")
case "map"
title="网站指南"
content=server.HTMLEncode(rs("map")&" ")
case "service"
title="服务条款"
content=server.HTMLEncode(rs("service")&" ")
case "guide"
title="网站地图"
if not isnull(rs("guide")) then
content=server.HTMLEncode(rs("guide"))
end if
case "charges"
title="资费标准"
content=server.HTMLEncode(rs("charges")&" ")
case "ads"
title="网站广告"
content=server.HTMLEncode(rs("ads")&" ")
case "contact"
title="联系我们"
content=server.HTMLEncode(rs("contact")&" ")
end select
%>
<form action="service_add.asp" method="post" name="myform">

<table width="650" align=center cellspacing=3>
<tr>
<td colspan="2" align="center"></td>
</tr>
<tr>
<td width="71" align="right"><%=title%>:</td>
<td width="564"> <input name="Content" type="hidden" value="<%=content%>">
<IFRAME ID="eWebEditor1" SRC="../Editor/ewebeditor.htm?id=Content&style=standard650" FRAMEBORDER="0" SCROLLING="no" WIDTH="650" HEIGHT="350"></IFRAME>
</td>
</tr>
</table>
<p align=center><input type=submit name=btnSubmit value=" 提 交 "> <input type=reset name=btnReset value=" 重 填 "></p>
<input type="hidden" name="action2" value="<%=action%>">
<input type="hidden" name="id" value="<%=rs("id")%>"
</form>
<%
rs.close
set rs=nothing
%>
</body>
</html>
<%
if request("action2")<>"" then
action=request("action2")
id=request("id")
content=request("content")
call modify(action,content,id)
end if
sub modify(action,content,id)
conn.execute("update service set "&action&"='"&content&"' where id="&id)
response.Write "<script>alert('修改成功');location.href='service_add.asp?action="&action&"';</script>"
'response.Redirect "service_add.asp?action="&action&""
end sub

%>



...全文
175 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zdjs00 2018-10-24
  • 打赏
  • 举报
回复
找到原因了
原来是这行后面少了一个>
<input type="hidden" name="id" value="<%=rs("id")%>"

28,391

社区成员

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

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