Tracking Down Orphans

This agent makes it easy to find orphan documents. It runs through all documents in the database and tests each response doc it finds to make sure its parent can be located. If an orphan is found the document is placed in a folder called Orphan for easy retrieval.


Sub Initialize
Dim Session As New NotesSession
Dim CurDB As NotesDatabase
Dim DocColl As NotesDocumentCollection
Dim Doc As NotesDocument
Dim Parent As NotesDocument

Set CurDB = Session.CurrentDatabase
Set DocColl = CurDB.AllDocuments
Set Doc = DocColl.GetFirstDocument
While Not(Doc Is Nothing)
If Doc.IsResponse Then
On Error Goto Orphan
Set Parent = CurDB.GetDocumentByUNID(Doc.ParentDocumentUNID)
End If
Set Doc = DocColl.GetNextDocument(Doc)
Wend

Orphan:
Doc.PutInFolder("Orphan")
Resume Next
End Sub

This was first published in November 2000
This Content Component encountered an error

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close