List Dbs On A Server That Are Templates

This is an agent that creates a text list of databases which are also design
templates with their template names. This is to help resolve template name
conflicts and clean up old design templates from a server.
'DB is a template (list)|DbIsTempNames:

Option Public
Option Declare

Sub Initialize
' Creates a textfile list of databases that are templates for a 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, "Only databases that are templates on this server are
listed"
Print #filenum,servername
Print #filenum, pad("filename", 20) & pad("title", 30) & pad("Design
Template Name (Is Template)", 40) & pad("filepath", 60)
Dim db As notesdatabase
Set db = DbDir.getfirstdatabase(TEMPLATE_CANDIDATE)
Do Until db Is Nothing
Print db.filename
If Not Cstr(db.TemplateName)="" Then
Print #filenum, pad(db.filename, 20) & pad(db.title, 30) &
pad(Cstr(db.TemplateName), 40) & pad(Cstr(db.filepath), 60)
End If
Set db = DbDir.getnextdatabase
Loop
Close #filenum
'open Notepad with the textfile - only works on Windows
Dim taskid%
taskid% = Shell("notepad.exe DbProps.TXT",1)
End Sub

Function pad(word As String, width1 As Integer)
' this function is just to format text on the report
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 last published in November 2000

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

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

SearchDataCenter

SearchExchange

SearchContentManagement

Close