日期:2014-05-17 浏览次数:20779 次
delete from c insert into c select id,title from a delete from d insert into d select id,aid,title from b
------解决方案--------------------
dim temp_,id_,ors1,ors2,ors3
crers ors1,"select khid,jbtitle,jbfen,YearId,IsSh,AddDate from khjbnrbt2 order by khid asc"
do until ors1.eof
crers ors2,"select top 1 khid,jbtitle,jbfen,YearId,IsSh,AddDate from khjbnrbt"
ors2.addnew()
ors2(1)=ors1(1)
ors2(2)=ors1(2)
ors2(3)=zpId
ors2(4)=ors1(4)
ors2(5)=ors1(5)
ors2.Update()
temp_ = ors2.bookmark
ors2.Bookmark = Temp_
ID_ = ors2(0)
ors2.close
crers ors3,"select jbnrId,jbbtId,jbnrbt,YearId,jbnrfen,IsLock,AddDate,paixu from jbnrbt2 where jbbtId= "&ors1(0)
i=1
do until ors3.eof
crers ors2,"select top 1 jbnrId,jbbtId,jbnrbt,YearId,jbnrfen,IsLock,AddDate,paixu from jbnrbt"
ors2.addnew()
ors2(1)=ID_
ors2(2)=ors3(2)
ors2(3)=zpId
ors2(4)=ors3(4)
ors2(5)=ors3(5)
ors2(6)=ors3(6)
ors2(7)=ors3(7)
ors2.Update()
ors2.close
ors3.movenext
loop
ors3.close
ors1.movenext
loop
'echo 1
ors1.close
set ors1=nothing 参考下我这个吧,跟你那个差不多。