Examples: OpenDatabaseByReplicaID method

This Visual Basic code opens a database on a server that is a replica of a local database.

Private Sub OpenByRepID_Click()
On Error GoTo errorHandler
Dim s As New NotesSession
s.Initialize
Dim dir As NotesDbDirectory
Dim db As NotesDatabase
Dim repID As String
Set dir = s.GetDbDirectory("")
Set db = dir.OpenDatabase("quack.nsf")
repID = db.ReplicaID
Set dir = s.GetDbDirectory("Snapper")
Set db = dir.OpenDatabaseByReplicaID(repID)
MsgBox db.Title, , db.FilePath
Exit Sub
errorHandler:
MsgBox Err.Description, , Err.Number
End Sub