|
|
|
|
|
|
|
|
|
|
|
|
|
|
Build your own database analysis tool (continued)
- I created two fields with the same date information (such as the date created or modified) and then used the settings on the Notes form to format the first one to show just the date and the second one to show just the time. This way I can put them on separate lines, one on top of the other.
- A computed field on the form shows the database size in thousands of bytes and punctuates it with commas to make it easier to read.
The "meaty" part of the Database Information form are the three rich-text fields that reveal information about the forms, views and agents in the database. For the forms and views, the agent will supply the alias if there is one. For the agents, it will let you know who the owner (the last person to modify the agent) is. You can see a filled-in version of the Database Information Form in Figure B.
FIGURE B
 
Here is what the Database Information Form looks like filled in. Roll over picture for a larger image.
Are you a good little array? The tricky part about retrieving and processing the form, view, and agent properties of a database is making sure that you check to see if the properties have any elements. Since each one of these properties is an array, you can save yourself a lot of grief (and hair) by doing a simple test to help determine if the property is indeed an array (and therefore has values in it). If it is an array, you can proceed to put the name of the element and the alias (form or view) or owner (agent only) into an array that you will sort. Here's an example:
If Isarray(dbDirectory.Forms) Then
dbInfoForm.NumberOfForms = Ubound(dbDirectory.Forms) + 1
Dim formArray() As String
form_index% = 0
Forall form In dbDirectory.Forms
Redim Preserve formArray(form_index%)
If Isarray(form.Aliases) Then
aliasName$ = " | " + form.Aliases(0)
Else
aliasName$ = ""
End If
formArray(form_index%) = form.Name + aliasName$
form_index% = form_index% + 1
End Forall
'-Agent continues to bubble sort
|
The magical bubble sort: don't leave home without it After I completed an earlier version of the agent I noticed that the forms, views and agent names were not in alphabetical order. Notes does not retrieve these in alphabetical order but rather in whatever order it finds them in the database. In the past, this would have just discouraged me and I would just think that that was the best I could do. But that was before I had the magical bubble sort in my bag of tricks.
You can find more information on the magical bubble sort by going to the Lotus support site (http://support.lotus.com) and searching for "sort array." But this is such an important part of the usefulness of this agent that I want to also list the code here as well. This code is deceptively simple: You just need to insert the name of the array that you are trying to sort everywhere it says "formArray." It will then sort either text or numbers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
- Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
- User friendly aproach, using a point and click access to features
- Reports from any Lotus Notes databases
- Runs reports through a Notes client, web browser and scheduled basis
- Allows use of LotusScript for advanced data manipulation
- Enables self service reporting capabilities to end-users
Learn more at www.integra4notes.com. |
|
|
|
|
|
|
|
|
|
|