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
PublicClass CompareEnging
SubNew(sServer AsString, sDB AsString, tServer AsString, tDB AsString)
PublicPropertySet reportOnlyChangedFields AsBoolean
PublicPropertySet eMailResults AsBoolean
PublicSub addExcludedForm (formName AsString)
PublicSub addExcludedField (fieldName AsString)
PrivateFunction fixTextforHTML (orgText AsString)AsString
PublicFunction report
Sub reportNewDocuments (targetDB AsNotesDatabase)
Sub compareTargetDoc (tDoc AsNotesDocument)
Sub compareSourceDoc (sDoc AsNotesDocument, tDB AsNotesDatabase)
Function documentSingleDoc (doc AsNotesDocument, txtStatus AsString)
PublicSub compareTwoDocuments (sDoc AsNotesDocument, tDoc AsNotesDocument)
EndClass
Function ReplaceSubstring (sourcestr AsString, fromstr AsString, tostr AsString)AsString
Download the Full Source code. As usual - YMMVSubNew(sServer AsString, sDB AsString, tServer AsString, tDB AsString)
PublicPropertySet reportOnlyChangedFields AsBoolean
PublicPropertySet eMailResults AsBoolean
PublicSub addExcludedForm (formName AsString)
PublicSub addExcludedField (fieldName AsString)
PrivateFunction fixTextforHTML (orgText AsString)AsString
PublicFunction report
Sub reportNewDocuments (targetDB AsNotesDatabase)
Sub compareTargetDoc (tDoc AsNotesDocument)
Sub compareSourceDoc (sDoc AsNotesDocument, tDB AsNotesDatabase)
Function documentSingleDoc (doc AsNotesDocument, txtStatus AsString)
PublicSub compareTwoDocuments (sDoc AsNotesDocument, tDoc AsNotesDocument)
EndClass
Function ReplaceSubstring (sourcestr AsString, fromstr AsString, tostr AsString)AsString
Posted by Stephan H Wissel on 27 March 2011 | Comments (2) | categories: Show-N-Tell Thursday