日期:2014-05-16  浏览次数:20940 次

表单传过来的数据为何修改不了 ,提示修改成功,但没有新数据更新,sql server 2000
1.asp  
表单传过来的数据为何修改不了 ,提示修改成功,但没有新数据更新,,请大侠帮忙查看错在哪里。。数据库为sql server 2000

<form method="POST" name="myform"  onsubmit="return check()" action="QT.asp" target="_self">
<table width="700" border="0" class="table_southidc">
<tr><td>
........
........
........
<input name="ArticleID" type="hidden" id="ArticleID" value="<%=rsArticle("ArticleID")%>">
<input  style="border:1px solid #000080; BACKGROUND-COLOR: #D9ECFF; color:#000000" name="myform" type="submit"  id="myform" value="保存修改"></td>
<td><a href="javascript:history.go(-1)">返回列表</a></td>
</tr>
</table>
QT.asp  内容如下

<%
'定义变量,接受从表单中传送来的数据

dim FoundErr,ArticleID,Product_Id,BigClassName,SmallClassName,Title,Content,UpdateTime,shuliang,WanChen,username
dim zt,zb,zb2,QuXiao,wcgh,wctime,Spec,Unit
Dim sql 'sql语句字符串
Dim rs  '记录集变量
FoundErr=false
ArticleID=Trim(Request.Form("ArticleID"))
Product_Id=trim(request.form("Product_Id"))
BigClassName=trim(request.form("BigClassName"))
SmallClassName=trim(request.form("SmallClassName"))
Title=trim(request.form("Title"))
Spec=trim(request.form("Spec"))
Unit=trim(request.form("Unit"))
QuXiao=trim(request.form("QuXiao"))
zb=trim(request.form("zb"))
zb2=trim(request.form("zb2"))
WanChen=trim(request.form("WanChen"))
wcgh=trim(request.form("wcgh"))
shuliang=trim(request.form("shuliang"))
wctime=trim(request.form("wctime"))
UpdateTime=trim(request.form("UpdateTime"))
zt=trim(request.form("zt"))
username=trim(request.form("username"))
content=trim(request.form("content"))
if founderr=false then
   set rs=server.createobject("adodb.recordset")
   if ArticleID<>"" then
sql="select * from Products where articleid=" & ArticleID
rs.open sql,conn,1,3
if not (rs.bof and rs.eof) then
call SaveData()
rs.update
rs.close
set rs=nothing
  else
founderr=true
errmsg=errmsg+"<li>找不到此记录,可能已经被删除。</li>"
call WriteErrMsg()
end if
else
founderr=true
errmsg=errmsg+"<li>不能确定ArticleID的值</li>"
call WriteErrMsg()
end if
else
WriteErrMsg
end if

sub SaveData()

rs("ArticleID") = ArticleID
rs("Title") = Title
'rs("Content") = rqtContent
rs("Content") = Content
rs("UpdateTime") = UpdateTime
rs("UserName") = Session("UserName")
rs("zt") = zt
rs("Product_Id")=Product_Id
rs("BigClassName") = BigClassName
rs("SmallClassName") = SmallClassName
rs("Spec") = Spec
rs("Unit") = Unit
rs("Memo") = Memo
rs("zb") = zb
rs("zb2") = zb2
rs("WanChen") = WanChen
rs("wcgh") = Session("wcgh")
rs("shuliang") = shuliang
rs("wctime") = wctime
rs("QuXiao") = QuXiao

end sub

response.write"<SCRIPT language=JavaScript>alert('修改成功,请返回!');"
response.write"this.location.href='ProductManageQB.asp';</SCRIPT>"
%>