已解决。代码修改为:
sql="select * from B3J where bianhao='"&nowbianhao&"' and zu=false"
set rs_shulian=conn.execute(sql)
nowjggr=0
nowpggr=0
do while rs_shulian.eof=false
nowjggr=nowjggr+rs_shulian("jggr")
nowpggr=nowpggr+rs_shulian("pggr")
rs_shulian.movenext
loop
set rs2=server.createobject("ADODB.RecordSet")
sql="select * from B3J where bianhao='"&nowbianhao&"'"
rs2.open sql,conn,1,3
do while rs2.eof=false
rs2.addnew
rs2("bianhao")=nowbianhao
rs2("title")="总计[工日小计+工日小计×工日系数"&nowgrxs&"]"
rs2("jggr")=nowjggr
rs2("pggr")=nowpggr
rs2("zu")=true
rs2.movenext
loop
sql="select * from B3J where bianhao='"&nowbianhao&"' and zu=false"
set rs_shulian=conn.execute(sql)
nowjggr=0
nowpggr=0
do while rs_shulian.eof=false
nowjggr=nowjggr+rs_shulian("jggr")
nowpggr=nowpggr+rs_shulian("pggr")
rs_shulian.movenext
loop
set rs2=server.createobject("ADODB.RecordSet")
sql="select * from B3J where bianhao='"&nowbianhao&"'"
rs2.open sql,conn,1,3
do while rs2.eof=false
rs2.addnew
rs2("bianhao")=nowbianhao
rs2("title")="总计[工日小计+工日小计×工日系数"&nowgrxs&"]"
rs2("jggr")=nowjggr
rs2("pggr")=nowpggr
rs2("zu")=true
rs2.movenext
loop