< Back

Document Subject: Grab All databases details in a directory
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#grabDbs or http://A555F9/nn.nsf/ByAlias/grabDbs

I needed a way to grab all database details in a directory for a blanket ACL change.




Here is the code.

This will find all databases and put their details into fields db1, s1, t1 etc

 

Dim s As New notessession
 Dim db As notesdatabase
 Dim uiw As New notesuiworkspace
 Dim uidoc As notesuidocument
 Set uidoc=uiw.CurrentDocument
 Dim thisdb As notesdatabase
 dim c as integer

c=1

Dim directory As NotesDbDirectory
 'Dim db As NotesDatabase
 Set directory = s.GetDbDirectory( "ServerName" )
 Set db = directory.GetFirstDatabase( DATABASE )
 Do Until db Is Nothing

 
   Print "found " & db.title & "-- "& db.filepath
   Call uidoc.FieldSetText("db" & c, db.filepath)
   Call uidoc.FieldSetText("s" & c, dbserver)
   Call uidoc.FieldSetText("t" & c, db.title)
   c=c+1
  End If
  Set db = directory.GetNextDatabase
 Loop