Function To Create A List Of All Database Replica Ids Which Use A Specified Template

Create a list of all database replica ids which use a specified template
' Create a list of all database replica ids which use a specified template
' Run in script thus...
' Dim AllReplicaIDs() As String
' Call GetAllDBReplicaIDs ( "MYSERVER", "MyTemplate", AllReplicaIDs)
' Routine to find IDS
Sub GetAllDBReplicaIDs( sServerName As String, sTemplateName As String,
ReplicaIDs() As String )
On Error Goto ErrorHandler

Dim session As New NotesSession
Dim dbFind As NotesDatabase
Dim directory As NotesDbDirectory
Dim counter As Integer

Set directory = session.GetDbDirectory( sServerName )
counter = -1
' Get first database
Set dbFind = directory.GetFirstDatabase( DATABASE )
While Not( dbFind Is Nothing )
If ( Ucase(dbFind.DesignTemplateName) = Ucase(sTemplateName)) Then
counter = counter + 1
Redim Preserve ReplicaIDs(counter)
ReplicaIDs(counter) = dbFind.ReplicaID
End If
' Get next database
Set dbFind = directory.GetNextDatabase

Exit Sub

Resume TheEnd
End Sub

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials'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 ...