修改一条数据问题
修改一条数据问题,不懂这样写对不对,我提交后,出错,内部出错,不懂为什么,是不是语法用错了?
要用execute 还是用updata来呢?
<!--#include file="conn.asp"-->
<!--#include file="check_login.asp"-->
<link href="css.css" rel="stylesheet" type="text/css">
<%
dim id
id=request.QueryString("id")
if request.QueryString("action")="save" then
conn.execute "update news set theme='"&theme&"',content='"&content&"',link='"&link&"' where id=" & id
response.write "<script language=javascript>alert('更改成功!');history.go(-1);</script>"
response.End
end if
%>
<%
id=request("id")
set rs=server.createobject("ADODB.Recordset")
sql="select * from news where id=" & id
rs.open sql,conn,1,1
%>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
<tbody>
<tr>
<td valign=center> <img src="images/doc.gif" width="9" height="9">
<font color="#0066cc">当前位置→站内新闻→添加新闻</font></td>
</tr>
<tr>
<td valign=center height="200" align="center">
<table width="400" border="0" cellspacing="4" cellpadding="0">
<form name="form1" method="post" action="modify_news.asp">
<tr>
<td>标题:
<input type="text" name="theme" size="40" class="input" value=<%=trim(rs("theme"))%>> </td>
</tr>
<tr>
<td>链接:
<input name="link" type="text" class="input" size="40"value=<%=rs("link")%>></td>
</tr>
<tr>
<td>時间:
<input type="text" name="time" size="40" class="input" value=<%=rs("time")%>>
</td>
</tr>
<tr>
<td> <textarea name="content" cols="56" rows="14" style="font-family: '宋体'; font-size: 9pt; border: thin #FFFFFF groove; background-color: #DAEFFC" ><%=rs("content")%></textarea>
</td>
</tr>
<tr>
<td align="center"><input type="submit" name="bb" value="修改" class="input">
<input type="reset" name="bb2" value="重写" class="input">
<input type="hidden" name="action" value="save">
<input type="hidden" name="id" value="<%=rs("id")%>">
<input type="hidden" name="theme" value="<%=rs("theme")%>">
<input type="hidden" name="content" value="<%=rs("content")%>">
<input type="hidden" name="link" value="<%=rs("link")%>">
</td>
</tr>
</form>
</table>
</td>
</tr>
</tbody>
</table>