Hi,
habe den folgenden Code in einem andern Forum gefunden ( noch nicht getestet
)
by Sue Morgan
Description: Often after moving a database to production the customer wants to know who is looking at what. Sometimes this is in response to wanting to clean up ACL and unwanted views, sometimes it is to try and enhance the database based on what is working.
In response, I have written a utility that tracks who is going into a database, view, and when. The report is written to statistic database which can be monitored.,
Code: First, in the database to hold the statistics; build a Form that will hold 4 pieces of data
Text Field to contain the database name (DBOpened)
Text Field to contain the User opening a view (viewUserName)
Time Field to hold the date the view was opened (viewDateOpen)
Text Field to hold the name of the view that was opened (viewOpen)
Next, in the database you want to track usage, build a Script Library (I call mine TrackViewUse)
Sub TrackViewUse (Source As Notesuiview)
Dim ws As New notesuiworkspace
Dim session As New notessession
Dim view As NotesView
Set view = Source.View
Dim db As notesdatabase
Set db = session.currentdatabase
Dim db2 As New notesdatabase ("", "")
Dim doc As notesdocument
' OPEN THE DATABASE TO HOLD THE STATISTICS
Call db2.Open("MDDB1/BTV/A/IBMMD", "SHARED/IPD/pipestat.nsf")
'BUILD THE NEW DOC
Set doc=New notesdocument(db2)
doc.form = "viewUse"
doc.DBOpened = db.Title
doc.viewUserName = session.CommonUserName
doc.viewDateOpen = Now()
doc.viewOpen = view.Name
Call doc.save(True,False)
Call db2.Close
End Sub
Finally, in the database you want to track (you'll want to do this in each view)
In the Options for the views delecare the Subroutine
Use "TrackViewUse"
In the PostOpen Event of the views call the Subroutine
Sub Postopen(Source As Notesuiview)
TrackViewUse Source
End Sub
The results will be a document in the statistic database recording the database name, who entered and when,
and the name of the view.