Usability - Productivity - Business - The web - Singapore & Twins

Comparing document changes

From time to time I have the need to compare the documents of two databases for changes:
  • Before I clean-up a Domino configuration I create a backup copy (File - Application - New Copy). Once I'm done I generate the report of changes made - reliably without missing a field
  • We suspect data was altered by a rookie user. Using a backup copy all the changes made need to be highlighted
  • Suspecting that a replication went awry I want to compare two instances of one database on different servers
For these use cases I wrote a class that allows me to blend out certain fields or documents based on certain forms. The code is a rough cut and you might need to adjust it to specific needs. Anyway enjoy:
Public Class CompareEnging
    Sub New (sServer As String, sDB As String, tServer As String, tDB As String )
    Public Property Set reportOnlyChangedFields As Boolean
    Public Property Set eMailResults As Boolean
    Public Sub addExcludedForm (formName As String )
    Public Sub addExcludedField (fieldName As String )
    Private Function fixTextforHTML (orgText As String ) As String
    Public Function report
    Sub reportNewDocuments (targetDB As NotesDatabase )
    Sub compareTargetDoc (tDoc As NotesDocument )
    Sub compareSourceDoc (sDoc As NotesDocument, tDB As NotesDatabase )
    Function documentSingleDoc (doc As NotesDocument, txtStatus As String )
    Public Sub compareTwoDocuments (sDoc As NotesDocument, tDoc As NotesDocument )

End Class

Function ReplaceSubstring (sourcestr As String, fromstr As String, tostr As String ) As String
Download the Full Source code. As usual - YMMV

Posted by on 27 March 2011 | Comments (2) | categories: Show-N-Tell Thursday


  1. posted by Roy Rumaner on Monday 28 March 2011 AD:
    Sounds like you wrote a very basic version of ScanEZ from Ytria.
  2. posted by Stephan H. Wissel on Monday 28 March 2011 AD:
    @Roy: Yes, absolutely right. 3 differences:
    - it is way more basic
    - the output is a HTML table only
    - I can leave it behind with a customer