日期:2014-05-17  浏览次数:20915 次

高手帮忙看个ASP小程序
表单代码
<form name="form1" method="post" action="exam81.asp">
请输入要修改的记录名称:
<input type="text" name="name">
<br>
<input type="submit" name="submit" value="提交">
</form>

ASP程序

<%
name=request.form("name")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data/guestbook.mdb")

exec="select * from guest where name='"name"'" '感觉这里有错误但不知错哪了。。。。!

set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<form name="form1" method="post" action="modifysave1.asp">
<table width="748" border="0" cellspacing="0" cellpadding="0">
<tr> 
<td>name</td>
<td>tel</td>
<td>message</td>
</tr>
<tr> 
<td>
<input type="text" name="name" value="<%=rs("name")%>">
</td>
<td>
<input type="text" name="tel" value="<%=rs("tel")%>">
</td>
<td>
<input type="text" name="message" value="<%=rs("message")%>">
<input type="submit" name="Submit" value="提交">
<input type="hidden" name="name" value="<%=request.form("name")%>">
</td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>





exec="select * from guest where name='"name"'" '感觉这里有错误但不知错哪了。。。。!
表单提交出现错误

------解决方案--------------------
exec="select * from guest where name='" & name & "'"