数据集rst
a1   x1   x2  x3  y1   y2  y3
mm   0    6   0    0   36  0
mm   0   6   0   80   6   0
mm   80   6   0    0   6   0
数据集rst2
xx1   xx2  xx3 yy1  yy2  yy3
0      6    0    80   6    0
条件判断
rst1.Fields("X1")=rst2.Fields("xx1") and ..
或着
rst1.Fields("Y1")=rst2.Fields("xx1") and ..
请问各位大侠,上面需求的数据集判断有几种写法.谢谢

解决方案 »

  1.   

    找出在rst1满足rst2的记录
    条件判断如下 
    rst1.Fields("X1")=rst2.Fields("xx1") and .. 
    或着 
    rst1.Fields("Y1")=rst2.Fields("xx1") and .. 
      

  2.   

    while not rs.eof
        if rst1.Fields("X1")=rst2.Fields("xx1") and ... then
        ...
        end if
        rs1.movenext
    wend
      

  3.   

    while not rst1.eof 
        if rst1.Fields("X1")=rst2.Fields("xx1") and ... then 
        ... 
        end if 
        rst1.movenext 
    wend
      

  4.   

    with rst2
      tt1 = .Fields(1): tt2 = .Fields(2): tt3 = .Fields(3)
      t1 = .Fields(4): t2 = .Fields(5): t3 = .Fields(6)
      rst1.Filter = "lineStartPoint0 = " & t1 & " And lineStartPoint1 = " & t2 & " And " & _
          "lineendPoint0 = " & tt1 & " And lineendPoint1 = " & tt2
    end with
      

  5.   

    晕死,我看错问题....
    sorry.....