用asp修改数据库中某条记录并保存回数据库中出现的问题!!

henrylaw 2006-05-21 11:38:02
从数据库中货物表(hw)里读取一条记录,修改某些属性后存回数据库中,代码如下,但最后显示"Success!Back",但货品修改内容仍然不能保存到数据库中,且不显示任何提示,请高手指点原因,先谢谢了!

<%
set rs=server.createobject("adodb.recordset")
if request("action")="save" then
hw_id=request("hw_id")
if not(isnumeric(request("hw_price1"))) or not(isnumeric(request("hw_price2"))) or not(isnumeric(request("hw_kucun"))) or not(isnumeric(request("hw_jifen"))) then
errmsg="<br>"+"<li>价格、库存、积分必须为数字且不能为空"
founderr=true
end if

if request("hw_name")="" then
errmsg=errmsg+"<br>"+"<li>名称不能为空"
founderr=true
end if

if not(isnumeric(request("hw_buys"))) then
errmsg=errmsg+"<br>"+"<li>够买数量不能为除数字之外的其它字符"
founderr=true
end if

if not(isnumeric(request("hw_xu"))) then
errmsg=errmsg+"<br>"+"<li>排列序号不能为除数字之外的其它字符"
founderr=true
end if

if request("hw_content2")="" then
errmsg=errmsg+"<br>"+"<li>详细介绍不能为空"
founderr=true
end if

if request("hw_pic")<>"" and instr(request("hw_pic"),"*")=0 then
errmsg=errmsg+"<br>"+"<li>商品图片必须以*号分割,否则将会出错"
founderr=true
end if

hw_content=request("hw_content")
hw_content=replace(hw_content," "," ")
hw_content=replace(hw_content,chr(13)&chr(10)," ")
sql="select * from hw where hw_id="&hw_id&""
rs.open sql,conn,1,3
rs("pinpai_id")=request("pinpai_id")
rs("sort_id")=request("sort_id")
rs("nsort_id")=request("nsort_id")
rs("hw_name")=request("hw_name")
rs("hw_buys")=request("hw_buys")
rs("hw_price1")=request("hw_price1")
rs("hw_price2")=request("hw_price2")
rs("hw_kucun")=request("hw_kucun")
rs("hw_jifen")=request("hw_jifen")
rs("hw_sn")=request("hw_sn")
rs("hw_xu")=request("hw_xu")
rs("hw_content")=hw_content
rs("hw_content2")=request("hw_content2")
rs("kxaa")=request("kxaa")
rs("kxab")=request("kxab")
rs("kxba")=request("kxba")
rs("kxbb")=request("kxbb")
rs("hw_pic")=request("hw_pic")
rs("tjindex")=request("tjindex")
rs("tjsort")=request("tjsort")
rs("tejia")=request("tejia")
rs("hw_date")=now()
rs.update
rs.close
set rs=nothing
response.write "Success!Back"
response.end

else
hw_id=request("hw_id")
sql="select * from hw where hw_id="&hw_id&""
rs.open sql,conn,1,3
sort=rs("sort_id")
nsort=rs("nsort_id")
%>
...全文
102 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
look4sword 2006-05-22
  • 打赏
  • 举报
回复
光这点内容,谁也帮不了你啊。你那errmsg管founderr是啥东东都没人知道。

28,391

社区成员

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

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