How can we get Database size through view column formula

How can we get Database size through view column formula.

Subject: It’s not pretty but…

…put this code in your view’s QueryOpen:

Sub Queryopen(Source As Notesuiview, Continue As Variant)

Dim ws As New NotesUIWorkspace



Dim view As NotesView

Dim db As NotesDatabase

Dim size As Long

Set view = Source.view

Set db = view.Parent

size = db.size



Forall c In view.columns

	If c.title = "Database Size" Then

		c.formula = Cstr(size)

		Goto found

	End If

End Forall

Call view.createcolumn(view.columncount + 1, "Database Size", Cstr(size))

found:

Call ws.ViewRefresh

End Sub

For it to be more effective, I set the view’s index to Automatic Refresh and Discard After Every Use, but it depends how often you want to update the db size in the view.

Hope this helps,

Phil

Subject: Thanks

Thank you Phil, i will try