如何解决:语法错误 (操作符丢失) 在查询表达式 'id=' 中 /web/public/disp.asp, 第 42 行

来源:百度知道 编辑:UC知道 时间:2024/06/20 13:34:55
<%
set rs=server.createobject("adodb.recordset")
sql="SELECT * from body where id="&request("id")&""
rs.open sql,conn,1,3
%>
<td width="40">主题:</td>
<td width="200">
<%=server.htmlencode(rs("title"))%>
<%if session("board_admin")<>"" then%>
<img src="images/delete.gif" alt="删除" width="12" height="12" border="0" onClick="if(confirm('您确定要删除此留言和相关回复吗?')){location='admin_delete.asp?id=<%=rs("id")%>'}else{return(false)}" onMouseMove="this.style.cursor='hand'">
<%end if%> </td>
<td width="100">作者:<%=server.htmlencode(rs("writer"))%></td>
<td>时间:<%=rs("posttime")%>

前面那几行改一下:
<%
id=request("id")
if id="" then response.end
set rs=server.createobject("adodb.recordset")
sql="SELECT * from body where id="&id
rs.open sql,conn,1,3
%>