This simple script would check for duplicate values in a database & delete them.
Sub Initialize
Dim s As New notessession
Dim db As notesdatabase
Dim doc As notesdocument
Dim view As notesview
Dim temp As Variant
Dim temp1 As Variant
Dim dc As NotesDocumentCollection
Set db=s.currentdatabase
Set dc = db.AllDocuments
Set doc = dc.GetFirstDocument()
temp=""
For j = 1 To dc.Count
temp1=doc.KeyFieldValue
If temp1=temp Then
Call doc.remove(True)
End If
temp=temp1
Set doc = dc.GetNthDocument(j)
Next
End Sub
This was first published in November 2000