Script to find doc count

belowis the script to find doc count of all replicas in 2 servers.If both servers are running, no prob with script. but if anyone server is down, it should list the doc count in other servers…

how to implement the above???

Sub Click(Source As Button)

Dim ws As New NotesUIWorkspace

Dim ses As New NotesSession

Dim doc As NotesDocument

Dim dbdir As NotesDbDirectory

Dim db1 As NotesDatabase

Dim db2 As New NotesDatabase (“”, “”)

Dim repid As String

serv1$ = “”

serv2$ = “”

Set dbdir=ses.GetDbDirectory(serv1$)

Set db1 = dbdir.GetFirstDatabase(DATABASE)

While Not (db1 Is Nothing)

If Not db1.IsOpen Then

Call db1.Open(db1.Server, db1.FilePath)

End If

doccnt1% = db1.AllDocuments.Count

repid = db1.ReplicaID

If db2.OpenByReplicaID( serv2$, repid ) Then

doccnt2% = db2.AllDocuments.Count

Set db2 = ses.GetDatabase(“”, “”)

Else

doccnt2% = 0

End If

ask% = ws.Prompt(PROMPT_YESNO, db1.Title, _

serv1$ & "doc count: " & Cstr(doccnt1%) & Chr(13) & serv2$ & "doc count: " & Cstr(doccnt2%) & Chr(13) & Chr(13) & “Get next database - YES or NO?”)

If ask% = 0 Then

Print “process cancelled”

Exit Sub

End If

Set db1 = dbdir.GetNextDatabase

Wend

Print “process completed”

End Sub

Subject: script to find doc count

This is the third time you have asked this question but you won’t say what is really wrong with the script.

You should try to keep to one thread.

Subject: script to find doc count

You did not mention what problems there are with your script.

You could add a test after this line:

Set dbdir=ses.GetDbDirectory(serv1$)

like:

If Not dbdir is Nothing Then

End If

so you won’t be using something that is not available.