Get Database Replication Settings Information

Creates a list of replication settings. Modify to suit your needs.
Paste this into a Declarations section:

Type DBREPLICAINFO
ID As Double
Flags As Integer
CutoffInterval As Integer
Cutoff As Double
End Type

Dim db As NotesDatabase
Dim doc As NotesDocument
Dim RepInfoStruct As DBREPLICAINFO

Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval
dbName As String, hdb As Long ) As Integer
Declare Function W32_NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" ( Byval hdb
As Long ) As Integer
Declare Function W32_NSFDbReplicaInfoGet Lib "nnotes.dll" Alias
"NSFDbReplicaInfoGet" ( Byval hdb As Long, replInfoStruct As DBREPLICAINFO ) As
Integer

Const REPLFLG_DISABLE% = &H0004 '*** Disable replication */
Const REPLFLG_IGNORE_DELETES% = &H0010 '*** Don't propagate deleted notes when
Const REPLFLG_CUTOFF_DELETE% = &H0080 '*** Auto-Delete documents prior to
cutoff date */

Lotus Script Function:

Function GetRepInfo( TargetServer As String, TargetDb As String ) As String

Dim tempws As New NotesUIWorkspace
Dim Tdb As String
Dim hdb As Long

'*** Build the path for target database.
If TargetServer$ = "" Then
Tdb$ = TargetDb$
Else
Tdb$ = TargetServer$ & "!!" & TargetDb$
End If

status% = W32_NSFDbOpen( Tdb$, hdb& )
If status% <> 0 Then
Messagebox "Couldn't open database."
Call W32_NSFDbClose ( hdb& )
Exit Function
End If

status% = W32_NSFDbReplicaInfoGet( hdb&, RepInfoStruct)
If RepInfoStruct.CutOffInterval<>90 Then
IMsg$=" Cutoff Interval is"&Str(RepInfoStruct.CutOffInterval)&"
days." & Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_DISABLE% Then
RMsg$=" Replication is disabled."&Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_IGNORE_DELETES% Then
RMsg$=" Deleted documents are not replicated."&Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_CUTOFF_DELETE% Then
RMsg$=" Documents past cutoff date are deleted."&Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_DISABLE%+REPLFLG_IGNORE_DELETES% Then
RMsg$=" Replication is disabled."&Chr(13)&" Deleted documents are
not replicated."&Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_DISABLE%+REPLFLG_CUTOFF_DELETE% Then
RMsg$=" Replication is disabled."&Chr(13)&" Documents past cutoff
date are deleted."&Chr(13)
End If

If RepInfoStruct.Flags =
REPLFLG_DISABLE%+REPLFLG_IGNORE_DELETES%+REPLFLG_CUTOFF_DELETE% Then
RMsg$=" Replication is disabled."&Chr(13)&" Deleted documents are
not replicated."&Chr(13)&" Documents past cutoff date are deleted."&Chr(13)
End If

Call W32_NSFDbClose ( hdb& )
GetRepInfo=IMsg$&RMsg$

End Function
This was first published in November 2000

Dig deeper on Lotus Notes Domino Administration Tools

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