Code:
Option Compare Database
Option Explicit
Sub RemoveDuplicates()
Dim CN As ADODB.Connection
Dim RST As New ADODB.Recordset
Dim strTable As String
Set CN = CurrentProject.Connection
strTable = "COMUNI_GEOCODE"
RST.Open strTable, CN, adOpenKeyset, adLockOptimistic, adCmdTableDirect
Do While Not RST.EOF
If DCount("*", strTable, "CF=" & Chr(34) & RST!CF & Chr(34)) > 1 Then
RST.Delete
End If
RST.MoveNext
Loop
End Sub
i have tested in vb6 ide but Dcount not exists in vb6
other way are welcome!