语法错误 (操作符丢失) 在查询表达式 'id=' 中
原来的编辑器在win7系统中不能用了,做了更新,显示正常,但是点提交时出现错误错误的行为conn.execute("updateserviceset"&action&"=...
原来的编辑器在win7系统中不能用了,做了更新,显示正常,但是点提交时出现错误
错误的行为
conn.execute("update service set "&action&"='"&content&"' where id="&id)
下面是原代码
</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
%>
找到原因了原来这行少了一个 >
<input type="hidden" name="id" value="<%=rs("id")%>" 展开
错误的行为
conn.execute("update service set "&action&"='"&content&"' where id="&id)
下面是原代码
</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
%>
找到原因了原来这行少了一个 >
<input type="hidden" name="id" value="<%=rs("id")%>" 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询