求助,一次插入多条记录,为什么老是报错?
<% for i=1 to 25
call inseartinto
next
%>
<%
end if
%>
<%
qh = request.Form("qh")
zh = request.Form("zh")
v2 = date
sub inseartinto()
if request("act")="add" then
vv1 = requests2("NSRSBH"," must=true ")
set rs1=rsSrch("select * from cominf where NSRSBH='"&vv1&"'")
if rs1.eof and rs1.bof then showErr "该纳税人资料不在数据库!"
nsrName = rs1("NSRMC")
de = rs1("HDSE")
SL = rs1("sl")
SWJG_DM = rs1("SWJG_DM")
rs1.close
SL = replace(sl,"%","")
if NOT isnumeric(sl) then showErr "该纳税人税率无效,请立即纠正格式为:10%"
sl = sl*0.01
vv4 = requests2("yjkprq"&i," must=true ")
vv5 = requests2("yjje"&i,"must=true ")
vv6 = cmoney2(vv5/(1-SL)*SL)
vv7 = requests2("yjrq","")
vv8 = requests2("yjr","" )
vv9 = requests2("yjzf"&i," ")
sql="select * from "&theuserforTable6&" where 0=1"
id = request("id")
if id <>"" then
sql="select * from "&theuserforTable6&" where id = "& checkid2(id )
set rs=rsopen(sql)
else
set rs=rsopen(sql)
rs.addNew
end if
rs("NSRSBH") = vv1
rs("yjkprq") =vv4
rs("yjje") = vv5
if vv6 <> "" then
rs("yjse") = vv6
end if
rs("rjrq") = vv7
rs("SWJG_DM") = SWJG_DM
rs("yjr") =vv8
if vv9 <> "" then
rs("yjzf") = vv9
end if
rs.update
response.write "<scri"&"pt>alert('成功,合计金额为:');location.href='?';</scr"&"ipt>"
response.end
end sub
end if
%>