求助,一次插入多条记录,为什么老是报错?

guoguo1009 2007-12-02 11:40:59

<% 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


%>
...全文
149 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
guoguo1009 2007-12-03
  • 打赏
  • 举报
回复
在线等,我的QQ32170611,可不可以直接告诉我
yangtzeu 2007-12-03
  • 打赏
  • 举报
回复
"&theuserforTable6&" 有问题吧?
guoguo1009 2007-12-02
  • 打赏
  • 举报
回复
sql="select * from "&theuserforTable6&" where id = "& checkid2(id )


应该是这一行,说是 where 附近有错误
liuyann 2007-12-02
  • 打赏
  • 举报
回复
报错信息是什么?第几行?

28,404

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧