语法错误 (操作符丢失) 在查询表达式 'id=' 中
语法错误(操作符丢失)在查询表达式'id='中。/我的创作/企业网站/asp/publish_Chg.asp,第38行以下是代码:id=request.querystri...
语法错误 (操作符丢失) 在查询表达式 'id=' 中。
/我的创作/企业网站/asp/publish_Chg.asp, 第 38 行
以下是代码:
id=request.querystring("id")
response.write(id)
set cpyconn=server.createobject("adodb.connection")
cpyconn.open "company"
set cpyrs=server.createobject("adodb.recordset")
sql="select * from publish where id="&id
cpyrs.open sql,cpyconn
if not cpyrs.eof and not cpyrs.bof then
id=cpyrs("id")
title=cpyrs("title")
name1=cpyrs("name")
publisher=cpyrs("publisher")
content=cpyrs("content")
end if
<form method="post" action="publish1.asp?id=<%=id%>" name="form1" onsubmit="return submitt()">
<%response.write(id)%>
<table width="83%" height="318" border="1" bgcolor="#33FFFF">
<tr>
<td width="10%" height="55">标题</td>
<td width="90%" align="left"><input type="text" name="title" value="<%=title%>"></td>
</tr>
<tr>
<td height="55" >发布人</td>
<td align="left"><input type="text" name="publisher" value="<%=publisher%>"></td>
</tr>
<tr>
<td height="55" >图片名称</td>
<td align="left"><input type="text" name="name" value="<%=name1%>"></td>
</tr>
<tr>
<td height="161" >发布内容</td>
<td align="left"><textarea name="content" cols="50" rows="8"><%=content%></textarea></td>
</tr>
</table>
<table bgcolor="#00FFFF">
<tr>
<td width="537" height="36" align="right" ><input name="submit" type="submit" value="确定" ></td>
<td width="85" align="right"><input name="submit" type="button" value="取消" ></td>
<td width="85" align="right"><input type="hidden" value="<%=cpyrs("id")%>" ></td>
</tr>
</table>
</form>
</center>
</body>
<%
detail=request.form("content")
title=request.Form("title")
name1=request.Form("name")
publisher=request.Form("publisher")
sql="update publish set title='"&title&"',name='"&name1&"',content='"&content&"',publisher='"&publisher&"' where id="&id
cpyconn.execute sql
cpyrs.close
set cpyrs=nothing
cpyconn.close
set cpyconn=nothing
%>
第三十八行是:cpyrs.open sql,cpyconn
各大哥大姐麻烦了
先说个THANK YOU!!!! 展开
/我的创作/企业网站/asp/publish_Chg.asp, 第 38 行
以下是代码:
id=request.querystring("id")
response.write(id)
set cpyconn=server.createobject("adodb.connection")
cpyconn.open "company"
set cpyrs=server.createobject("adodb.recordset")
sql="select * from publish where id="&id
cpyrs.open sql,cpyconn
if not cpyrs.eof and not cpyrs.bof then
id=cpyrs("id")
title=cpyrs("title")
name1=cpyrs("name")
publisher=cpyrs("publisher")
content=cpyrs("content")
end if
<form method="post" action="publish1.asp?id=<%=id%>" name="form1" onsubmit="return submitt()">
<%response.write(id)%>
<table width="83%" height="318" border="1" bgcolor="#33FFFF">
<tr>
<td width="10%" height="55">标题</td>
<td width="90%" align="left"><input type="text" name="title" value="<%=title%>"></td>
</tr>
<tr>
<td height="55" >发布人</td>
<td align="left"><input type="text" name="publisher" value="<%=publisher%>"></td>
</tr>
<tr>
<td height="55" >图片名称</td>
<td align="left"><input type="text" name="name" value="<%=name1%>"></td>
</tr>
<tr>
<td height="161" >发布内容</td>
<td align="left"><textarea name="content" cols="50" rows="8"><%=content%></textarea></td>
</tr>
</table>
<table bgcolor="#00FFFF">
<tr>
<td width="537" height="36" align="right" ><input name="submit" type="submit" value="确定" ></td>
<td width="85" align="right"><input name="submit" type="button" value="取消" ></td>
<td width="85" align="right"><input type="hidden" value="<%=cpyrs("id")%>" ></td>
</tr>
</table>
</form>
</center>
</body>
<%
detail=request.form("content")
title=request.Form("title")
name1=request.Form("name")
publisher=request.Form("publisher")
sql="update publish set title='"&title&"',name='"&name1&"',content='"&content&"',publisher='"&publisher&"' where id="&id
cpyconn.execute sql
cpyrs.close
set cpyrs=nothing
cpyconn.close
set cpyconn=nothing
%>
第三十八行是:cpyrs.open sql,cpyconn
各大哥大姐麻烦了
先说个THANK YOU!!!! 展开
2个回答
展开全部
如果id是数字的话
id=request.querystring("id")
response.write(id)
set cpyconn=server.createobject("adodb.connection")
cpyconn.open "company"
set cpyrs=server.createobject("adodb.recordset")
sql="select * from publish where id="&cint(id)
cpyrs.open sql,cpyconn 1,3
如果id是字符串的话
id=request.querystring("id")
response.write(id)
set cpyconn=server.createobject("adodb.connection")
cpyconn.open "company"
set cpyrs=server.createobject("adodb.recordset")
sql="select * from publish where id='"&cint(id)&"'"
cpyrs.open sql,cpyconn 1,3
id=request.querystring("id")
response.write(id)
set cpyconn=server.createobject("adodb.connection")
cpyconn.open "company"
set cpyrs=server.createobject("adodb.recordset")
sql="select * from publish where id="&cint(id)
cpyrs.open sql,cpyconn 1,3
如果id是字符串的话
id=request.querystring("id")
response.write(id)
set cpyconn=server.createobject("adodb.connection")
cpyconn.open "company"
set cpyrs=server.createobject("adodb.recordset")
sql="select * from publish where id='"&cint(id)&"'"
cpyrs.open sql,cpyconn 1,3
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询