Examples: GetNextDatabase method

  1. This LotusScript® agent gets all the databases on the server Snapper.
    Sub Initialize
      Dim dbdir As New NotesDbDirectory("Snapper")
      Dim db As NotesDatabase
      Set db = dbdir.GetFirstDatabase(DATABASE)
      While Not(db Is Nothing)
        Msgbox db.Title, , db.FileName
        Set db = dbdir.GetNextDatabase
      Wend
    End Sub
  2. This Visual Basic code using COM gets all the databases on the server Snapper.
    Private Sub GetNext_Click()
    Dim s As New NotesSession
    s.Initialize
    Dim dir As NotesDbDirectory
    Dim db As NotesDatabase
    Set dir = s.GetDbDirectory("Snapper")
    Set db = dir.GetFirstDatabase(NOTES_DATABASE)
    While Not (db Is Nothing)
      MsgBox db.Title, , db.FileName
      Set db = dir.GetNextDatabase
    Wend
    End Sub