List Dbs On A Server With The Name Of The Template Name They Inherit From

This is an agent that creates a text file listing the database files on a given
server with the name of the template they inherit their design from. This
allows an audit to be done of design inheritance if there are many dbs
inheriting from the same template.
'DB inherit from template (list)|DbTempNames:

Option Public
Option Declare

Sub Initialize
' Creates a textfile list of databases with the names of templates they
inherit from for a given server
Dim counter%
Dim filenum As Integer
filenum = Freefile()
Dim DbDir As NotesDBDirectory
Dim session As New notessession
Dim servername As String
servername = Inputbox("Server name","Input the server
name.","NATS7/CMHC-SCHL/CA")
Set DbDir = session.GetDbDirectory( servername )
Open "DbProps.txt" For Output As #filenum
Print #filenum, pad("filename", 20) & pad("title", 30) & pad("Design
Template Name (Inherits From)", 40) & pad("filepath", 60)
Dim db As notesdatabase
Set db = DbDir.getfirstdatabase(TEMPLATE_CANDIDATE)
Do Until db Is Nothing
Print db.filename
Print #filenum, pad(db.filename, 20) & pad(db.title, 30) &
pad(Cstr(db.DesignTemplateName), 40) & pad(Cstr(db.filepath), 60)
Set db = DbDir.getnextdatabase
Loop
Close #filenum
'open Notepad with the textfile - only works on Windows
Dim taskid As Integer
taskid = Shell("notepad.exe DbProps.TXT",1)
End Sub

Function pad(word As String, width1 As Integer)
Dim prepad As String
Dim padcount As Integer
prepad = Left(word + String(width1, " "),width1)
For padcount = 1 To Len(prepad)
If Mid(prepad,padcount,1)={"}Then
Mid(prepad,padcount,1)={ }
End If
Next
pad = prepad
End Function
This was first published in November 2000

Dig deeper on Domino Resources - Part 5

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.uk

Close