[/COLOR][/COLOR]
[COLOR=rgb(255, 0, 0)][COLOR=rgb(0, 0, 0)]Sub SQLDuplicate(SQLD As SQL, TableName As String)
SQLD.BeginTransaction
SQLD.ExecNonQuery("DELETE FROM "&TableName &" WHERE rowid Not IN (Select Max(rowid) FROM "& TableName & " GROUP BY SiteName, Longitude, Latitude)")
' SQLD.ExecNonQuery("CREATE TABLE table_temp AS SELECT DISTINCT * FROM "& TableName)
' SQLD.ExecNonQuery("DROP TABLE "& TableName)
' SQLD.ExecNonQuery("ALTER TABLE table_temp RENAME TO "& TableName)
SQLD.TransactionSuccessful
SQLD.EndTransaction
End Sub