再给你20分!!
<%Response.Expires =0
On Error Resume Next
%>
<%Response.Buffer=true%>
<!--#include file = "connect.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改商品信息</title>
</head>
<body>
<%
sqls ="select * from shangpin where product_id ="&request("id")
response.write sqls
rs1.open sqls,conn,3,1
%>
<form name="form1" method="post" action="xiugaiproductinfo.asp" onSubmit="CheckValue()">
<table align="center" width="444" border="1" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="37" colspan="2" valign="center"><div align="center">修改商品信息</div></td>
</tr>
<tr>
<td height="35" valign="center"><div align="right">货号: </div></td>
<td valign="center">
<input type ="text" height = "20" name = "product_id" value =<%=request("id")%>>
</td>
</tr>
<tr>
<td height="35" valign="center"><div align="right">货名: </div></td>
<td valign="center">
<input type="text" height="20" name="product_name" value = <%=rs1("product_name")%>></td>
</tr>
<tr>
<td height="35" valign="center"><div align="right">品牌: </div></td>
<td valign="center">
<input type="text" height="20" name="brand" value = <%=rs1("brand")%>></td>
</tr>
<tr>
<td height="35" valign="center"><div align="right">单价: </div></td>
<td valign="center">
<input type="text" height="20" name="price" value =<%=rs1("price")%>></td>
</tr>
<tr>
<td height="44" colspan="2" align="center" valign="center">
<input type="submit" name = "button1" value="提交">
<input type="reset" name="Submit2" value="取消"> </td>
</tr>
<tr>
<td height="2"></td>
<td></td>
</tr>
</table>
</form>
<%
rs1.Close
Set rs1 = nothing
%>
<script language ="VBscript">
<!--
Sub CheckValue()
if document.all.product_name.value ="" then
window.alert("请写入货名!")
window.event.returnvalue = false
end if
if isnumeric(document.all.price.value)<>true then
window.alert("单价必须为实数!")
window.event.returnvalue = false
end if
End Sub
//-->
</script>
<%if request.Form("product_id")<>"" and request.form("product_name")<>"" and request.form("brand")<>"" and request.form("price")<>"" then
sqlstr = "select * from shangpin where product_id ='"& request.form("product_id") &"'"
rs2.open sqlstr,conn,3,2
rs2.Update
rs2("product_id")=Trim(Request.form("product_id"))
rs2("product_name")=Trim(Request.form("product_name"))
rs2("brand")=Trim(Request.form("brand"))
rs2("price")=int(Trim(Request("price")))
rs2("addtime")=FormatDateTime(Now,0)
rs2.Update
rs2.Close
set rs2 = nothing
end if
%>
</body>
</html>
<%
if Err.number <> 0 then
Response.write err.description
end if
%>
为什么总出现对象关闭时,操作被拒绝??!
估计是有关rs2这里出错了。