[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 '编号=' 中。
<html><body><%replayid=request("replay编号")setnewconn=server.createobject("adodb.conne...
<html>
<body>
<%
replayid=request("replay编号")
set newconn=server.createobject("adodb.connection")
dbpath=server.mappath("student.mdb")
newconn.open"driver={microsoft access driver (*.mdb)};dbq="&dbpath
sqlcmd="select * from news where 编号="&replayid&""
set rs=newconn.execute(sqlcmd)
%>
<center>
<form method="post" action="update2.asp">
<table>
<tr>
<td>编号:<%=rs("编号")%></td>
<td><input type="hidden" name="txth" value="<%=rs("编号")%>">
<td>标题:</td>
<td><input type="text" name="txtb" value="<%=rs("标题")%>">
<td>内容:</td>
<td><input type="text" name="txtn" value="<%=rs("内容")%>">
<td>日期:<%=rs("日期")%></td>
<td><input type="hidden" name="txtr" value="<%=rs("日期")%>">
</tr>
</table>
<input type="submit" value="修改信息" >
</form></center>
</body>
</html>
<%
hoo=replace(request("txth"),"'","''")
biao=replace(request("txtb"),"'","''")
nei=replace(request("txtn"),"'","''")
set newconn=server.createobject("adodb.connection")
dbpath=server.mappath("student.mdb")
newconn.open"driver={microsoft access driver (*.mdb)};dbq="&dbpath
sqlcmd="update news set 标题='"&biao&"', 内容='"&nei&"' where 编号="&hoo&" "
newconn.execute sqlcmd
newconn.close
%>
上述代码执行后出错,请高手指点!!!!! 展开
<body>
<%
replayid=request("replay编号")
set newconn=server.createobject("adodb.connection")
dbpath=server.mappath("student.mdb")
newconn.open"driver={microsoft access driver (*.mdb)};dbq="&dbpath
sqlcmd="select * from news where 编号="&replayid&""
set rs=newconn.execute(sqlcmd)
%>
<center>
<form method="post" action="update2.asp">
<table>
<tr>
<td>编号:<%=rs("编号")%></td>
<td><input type="hidden" name="txth" value="<%=rs("编号")%>">
<td>标题:</td>
<td><input type="text" name="txtb" value="<%=rs("标题")%>">
<td>内容:</td>
<td><input type="text" name="txtn" value="<%=rs("内容")%>">
<td>日期:<%=rs("日期")%></td>
<td><input type="hidden" name="txtr" value="<%=rs("日期")%>">
</tr>
</table>
<input type="submit" value="修改信息" >
</form></center>
</body>
</html>
<%
hoo=replace(request("txth"),"'","''")
biao=replace(request("txtb"),"'","''")
nei=replace(request("txtn"),"'","''")
set newconn=server.createobject("adodb.connection")
dbpath=server.mappath("student.mdb")
newconn.open"driver={microsoft access driver (*.mdb)};dbq="&dbpath
sqlcmd="update news set 标题='"&biao&"', 内容='"&nei&"' where 编号="&hoo&" "
newconn.execute sqlcmd
newconn.close
%>
上述代码执行后出错,请高手指点!!!!! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询