再给你20分!!

sexdoctor 2003-11-08 06:45:04
<%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这里出错了。
...全文
27 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sexdoctor 2003-11-08
  • 打赏
  • 举报
回复
没有close 过。
On Error Resume Next 去掉就没事,对。但不是解决问题的根本办法,数据库的操作目的没有达到啊!
请各位高手继续关注!
starboy1413 2003-11-08
  • 打赏
  • 举报
回复
On Error Resume Next

你把这个去掉
nchen123 2003-11-08
  • 打赏
  • 举报
回复
有可能前面已经 close 过了。
sexdoctor 2003-11-08
  • 打赏
  • 举报
回复
有人在帮忙解决了吗?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧