请问为什么运行此页ok后部分数据却没有被修改成功?很急!在线等待!
MMXMJ 2002-05-13 09:52:52 <%Response.Expires=0
Response.Buffer=true
sjjh_id=Session("sjjh_id")
sjjh_name=Session("sjjh_name")
sjjh_grade=Session("sjjh_grade")
sjjh_jhdj=Session("sjjh_jhdj")
if sjjh_name="" then Response.Redirect "../error.asp?id=440"
if session("sjjh_adminok")<>true then Response.Redirect "../chat/readonly/bomb.htm"
if sjjh_grade<>10 or instr(Application("sjjh_admin"),sjjh_name)=0 then Response.Redirect "../error.asp?id=439"
userid=Request.Form("id")
Response.Write "<body text='#000000' background='../jhimg/bk_hc3w.gif' link='#0000FF' vlink='#0000FF' alink='#0000FF'>"
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rst=Server.CreateObject("ADODB.RecordSet")
conn.open Application("sjjh_usermdb")
sqlstr="SELECT * FROM 用户 where id="&userid
rst.Open sqlstr,conn,1,2
if Request.Form("submit")="新增" then rst.AddNew
if Request.Form("submit")="删除" then
sqlstr="delete * from 用户 where id="&userid
conn.Execute sqlstr
Response.Write "成功删除id="&userid&"的用户"
else
hy=0
for i=1 to rst.Fields.Count-1
if Request.Form(i+1)="" then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]的数据不能为空!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.Fields(i).type=11 and lcase(Request.Form(i+1))<>"true" and lcase(Request.Form(i+1))<>"false" then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]为逻辑型如:True或False!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.Fields(i).type=3 and (not isnumeric(Request.Form(i+1))) then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]请使用数字输入!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.Fields(i).type=135 and (not isdate(Request.Form(i+1))) then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]日期数据类型不正确!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.fields(i).Type=202 then strtype="字符"
if rst.fields(i).Type=3 then strtype="数字"
if rst.fields(i).Type=135 then strtype="日期"
if rst.fields(i).Type=11 then strtype="逻辑"
if rst.Fields(i).Name="会员等级" then hy=clng(Request.Form(i+1))
if rst.Fields(i).Name="会员日期" and hy>0 then
if DateDiff("d",date(),cdate(Request.Form(i+1)))<10 then
Response.Write "<script Language=Javascript>alert('提示:["&rst.Fields(i).Name&"]会员日期不正确!当设\n置会员等级时,会员日期应大于10天!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
end if
if rst.Fields(i).Name="门派" then mp=cstr(Request.Form(i+1))
if rst.Fields(i).Name="身份" then sf=cstr(Request.Form(i+1))
if lcase(rst.Fields(i).Name)="grade" then dj=clng(Request.Form(i+1))
if dj<>0 then
if mp="官府" and dj<6 then
Response.Write "<script Language=Javascript>alert('提示:当门派为官府时,[管理级]应大于6!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if mp<>"官府" and dj>=6 then
Response.Write "<script Language=Javascript>alert('提示:当门派不为官府时,[管理级]应小于6!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="掌门" and mp<>"官府" and dj<>5 then
Response.Write "<script Language=Javascript>alert('提示:[身份]掌门的管理等级为5级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="长老" and mp<>"官府" and dj<>4 then
Response.Write "<script Language=Javascript>alert('提示:[身份]长老的管理等级为4级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="护法" and mp<>"官府" and dj<>3 then
Response.Write "<script Language=Javascript>alert('提示:[身份]护法的管理等级为3级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if sf="堂主" and mp<>"官府" and dj<>2 then
Response.Write "<script Language=Javascript>alert('提示:[身份]堂主的管理等级为2级!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
end if
if rst.Fields(i).Name="论谈身份" and Request.Form(i+1)<>"/" and Request.Form(i+1)<>"版主" and Request.Form(i+1)<>"站长" then
Response.Write "<script Language=Javascript>alert('提示:[论谈身份]只能为:/ 版主 站长,/表示由发贴数定!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
if rst.Fields(i).Name="银两" then yin=clng(Request.Form(i+1))
if rst.Fields(i).Name="存款" then
yin=yin+clng(Request.Form(i+1))
if yin>2000000000 then
Response.Write "<script Language=Javascript>alert('提示:[银两、存款]总合不可以超过20亿!!');location.href = 'javascript:history.go(-1)';</script>"
Response.End
end if
end if
Response.Write "<font size=-1>"&rst.Fields(i).Name&"(<font color=blue>"&strtype&"</font>):"&rst.Fields(i).Value&"---->"&Request.Form(i+1)&"<font color=blue>(……资料正确!)</font></font><br><br>"
if rst.Fields(i).type=202 then
rst.Fields(i).Value=cstr(Request.Form(i+1))
elseif rst.Fields(i).type=3 then
rst.Fields(i).Value=clng(Request.Form(i+1))
elseif rst.Fields(i).Type=7 then
rst.Fields(i).Value=cdate(Request.Form(i+1))
end if
next
rst.Update
end if
conn.execute "insert into l(a,b,c,d,e) values (now(),'"& sjjh_name &"','"& Request.ServerVariables("REMOTE_ADDR") &"','管理记录','["&Request.Form("submit")&"]ID="&userid&"的记录!')"
rst.Close
set rst=nothing
conn.Close
set conn=nothing
%>
恭喜,用户资料修改完成!
<a href="fine.asp">返回</a>