Sunday 6 March 2011

Get all dbs on the server

Use the following code to get all dbs on the server and create a document for each with the Title, Path, ReplicaID and Server information.

Sub Initialize
Dim s As New Notessession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim currdb As NotesDatabase

Set currdb = s.currentdatabase
Dim dbdir As New NotesDbDirectory(currdb.Server)
Set db = dbdir.GetFirstDatabase(DATABASE)

While Not(db Is Nothing)
Set doc = currdb.CreateDocument
With doc
.form = "FMain"
.Title = db.Title
.path = db.FilePath
.replicaid = db.ReplicaID
.server = db.Server
End With
Call doc.save(True,True)
Print db.Title, , db.FileName
Set db = dbdir.GetNextDatabase
Wend
End Sub

No comments:

Post a Comment