今天做了一天的循环表单写值。一直都没成功。
如何一次性提交表单,写多条记录。循环表单。为什么我下面的语句只能修改到第一条。其它的无效。
<%
select case act
case "upaccess"
new_access=Server.HTMLEncode(request.form("new_access"))
menu_id=Server.HTMLEncode(trim(request.form("menu_id")))
menu_name=Server.HTMLEncode(trim(request.form("menu_name")))
old_access=Server.HTMLEncode(trim(request.form("old_access")))
taxofficialcode=Server.HTMLEncode(trim(request.form("taxofficialcode")))
dim a_newaccess,a_oldaccess,a_menuid,i
a_newaccess=split(new_access,",",-1,1)
a_oldaccess=split(old_access,",",-1,1)
a_menuid=split(menu_id,",",-1,1)
for i=0 to UBound(a_menuid)
if a_newaccess(i)<>a_oldaccess(i) then
if a_newaccess(i)=0 then
'删除原有权限
sql="delete tb_user_access where taxofficialcode='"&taxofficialcode&"' and menu_id='"&a_menuid(i)&"'"
conn.execute(sql)
conn.close
set conn=nothing
else
'增加新权限
sql="insert into tb_user_access(TaxOfficialCode,menu_id) values ('"&taxofficialcode&"','"&a_menuid(i)&"')"
conn.execute(sql)
conn.close
set conn=nothing
end if
end if
next
case else
%>
[此贴子已经被作者于2007-2-7 19:12:04编辑过]