次の Visual Basic のサブルーチンは、URL を構成するさまざまな方法を示すデータベース URL を解析します。Private Sub Command1_Click()
Dim s As New NotesSession
Dim db As NotesDatabase
Dim target As NotesDatabase
Dim theURL As String
s.Initialize
Set db = s.GetDatabase("", "Document examples 2.nsf")
Rem Construct URL using NotesURL
theURL = db.NotesURL
MsgBox theURL, , "NotesURL"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
Rem Construct URL using FileName
theURL = "notes:///" + db.FileName + "?OpenDatabase"
MsgBox theURL, , "FileName"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
Rem Construct URL using ReplicaID
theURL = "notes:///" + db.ReplicaID + "?OpenDatabase"
MsgBox theURL, , "ReplicaID"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
Rem Construct URL using constant database name
theURL = "notes:///Document examples 2?OpenDatabase"
Rem Also OK: "notes:///Document examples 2.nsf?OpenDatabase"
Rem Also OK: "notes:///Document+examples+2?OpenDatabase"
Rem Also OK: "notes:///Document+examples+2.nsf?OpenDatabase"
MsgBox theURL, , "Constant database name"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
Rem Construct URL using constant replica ID
theURL = "notes:///8525690D006AC34D?OpenDatabase"
Rem Also OK: "notes:///__8525690D006AC34D.nsf?OpenDatabase"
MsgBox theURL, , "Constant replica ID"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
End Sub