asp中双循环判断

来源:百度知道 编辑:UC知道 时间:2024/05/25 21:17:24
rs和rs1分别是从两个数据表中读取数据,其中rs中有rs1中的数据,也就是rs是rs1的子集,如何用判断语句找出rs1中数,但不是rs中的数,并输出这些数。用asp实现,请写出详细代码,谢谢了!

Sql1="Select * From biao1"
Rs1.Open Sql1,Conn,1,1
IF Rs1.Recordcount>0 Then
Do While Not Rs1.Eof
Sql="Select * From BIAO2 Where ziduan="&Rs1("ziduan")
Rs.Open Sql,Conn,1,1
IF Rs.Recordcount=0 Then
Response.write Rs1("ziduan")&"<br>"
End IF
Rs.close
rS.Movenext
Loop
End IF
Rs1.cLOSE

set rs1=conn.execute("....")
set rs=conn2.execute(".....")
do while not rs1.eof

do while not rs.eof

if rs.fields("字段")=rs1.fields("字段") then
....
else
....
end if

rs.movenext
loop

rs.MoveFirst

rs1.movenext
loop