电饭煲线和电脑电源线:修改不了表”Product"里“SmallClassName"的内容

来源:百度文库 编辑:高校问答 时间:2024/04/29 17:41:07
dim SmallClassID,Action,BigClassName, SmallClassName, OldSmallClassName,rs,FoundErr,ErrMsg
SmallClassID=trim(Request("SmallClassID"))
Action=trim(Request("Action"))
BigClassName=trim(Request.form("BigClassName"))

SmallClassName=trim(Request.form("SmallClassName"))
SmallClassName_e=trim(Request.form("SmallClassName_e"))
OldSmallClassName=trim(request.form("OldSmallClassName"))

if SmallClassID="" then
response.Redirect("ClassManage.asp")
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from SmallClass where SmallClassID="&SmallClassID&"",conn,1,3
if rs.Bof or rs.EOF then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>此文章小类不存在!</li>"
else
if Action="Modify" then
if SmallClassName="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>文章小类名不能为空!</li>"
end if
if FoundErr<>True then
rs("SmallClassName")=SmallClassName
rs("SmallClassName_e")=SmallClassName_e
rs.update
rs.Close
set rs=Nothing
if SmallClassName<>OldSmallClassName then
conn.execute ("Update Product set SmallClassName='" & SmallClassName & "' where pro_name='" & BigClassName & "'")
end if

Conn.Close
Response.Redirect "ClassManage.asp"
end if
end if
if FoundErr=True then
call WriteErrMsg()
else
%>