|
<%
set conn=server.createobject("adodb.connection")
conn.provider="microsoft.jet.oledb.4.0"
conn.open"f:/asp练习/test.mdb"
sql="select * from test where id="&request.querystring("id")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<form name="form1" method="post" action="list-xiugaisave.asp">
<table width="748" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>aa</td>
<td>bb</td>
</tr>
<tr>
<td>
<input type="text" name="aa" value="<%=rs("aa")%>">
</td>
<td>
<input type="text" name="bb" value="<%=rs("bb")%>">
<input type="submit" name="Submit" value="提交">
<input type="hidden" name="id" value="<%=request.querystring("id")%>">
</td>
</tr>
</table>
</form>
<%
rs.close
conn.close
%>
list-xiugaisave.asp 代码:
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("test.mdb")
exec="select * from test where id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
rs("aa")=request.form("aa")
rs("bb")=request.form("bb")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "list.asp"
%>
Description: [Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'id=' 中。 |
|