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
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
MsgBox Err.Description, , Err.Number
End Sub