以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  请教想删除数据完全相同的行  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=57391)

--  作者:有点甜
--  发布时间:2014/9/24 9:51:00
--  

 参考代码

 

Dim i As Integer
For i  = DataTables("表A").DataRows.Count-1 To 0 Step -1
    Dim dr As DataRow = DataTables("表A").DataRows(i)
    Dim dr2 As DataRow = DataTables("表A").Find("第一列=\'" & dr("第一列") & "\' and 第二列=\'" & dr("第二列") & "\' and _Identify <> " & dr("_Identify"))
    If dr2 IsNot Nothing Then
        dr2.Delete
    End If
Next