-- 移除重复的行
Dim idx As String = "-1,"
Dim idx_temp As String = ""
Dim pdr As DataRow = Nothing
Dim count As Integer = 0
Dim cs As String = "SPDM,GG1DM"
For Each dr As DataRow In DataTables("SPCKB").Select("", "SPDM,GG1DM")
Dim flag As Boolean = False
If pdr IsNot Nothing Then
For Each c As String In cs.split(",")
If pdr(c) <> dr(c) Then
flag = True
Exit For
End If
Next
End If
If flag OrElse pdr Is Nothing Then
If count > 1 Then
idx &= idx_temp
End If
count = 1
idx_temp = ""
Else
count += 1
idx_temp &= dr("_Identify") & ","
End If
pdr = dr
Next
If count > 1 Then
idx &= idx_temp
End If
Tables("SPCKB").filter = "_Identify in (" & idx.trim(",") & ")"
DataTables("SPCKB").RemoveFor("_Identify In (" & idx.trim(",") & ")") \'移除重复行
外部表,没有_Identify这个字段我
此主题相关图片如下:52.png
该怎么修改呢