LOTUSSCRIPT/COM/OLE CLASSES


Examples: NotesDatabase class
1. This script creates a NotesDatabase object called db and uses New to assign a database to it. The database is located at the top level of the Domino data directory on server Barcelona. If the database exists, New automatically opens the database, so you can access the database properties and methods immediately.
2. This script achieves the same result as the example above, but declares a NotesDatabase object db and calls New in one line.
3. This script uses IsOpen to test if the database QUACK.NSF exists on the current computer. If not, it uses the Create method to create a new database on disk.
4. This script calls New while declaring the db object. It assigns db to a database located in a directory called SOUNDS, inside the directory SENSES. (The SENSES directory, in turn, is located inside the Domino data directory.)
5. This script gives Brian Flokka Editor access to the current database. The current database is the one in which the script is running. Using the CurrentDatabase property in NotesSession avoids the need to use file names in scripts and makes scripts easily portable from one database to another.
6. This script uses the Open method to check if a database exists on the server Asuncion. If the database exists, the script adds the Supervisors group to the ACL; if it doesn't exist, the script does nothing.
7. This script shows how you can use New in combination with the OpenIfModified method to open a database only if it's been modified after a certain date. The script checks if SALESDOCS.NSF on the current server has been modified since yesterday--if so, it opens the database and compacts it.
8. This script uses New in combination with the CreateFromTemplate method to create a new discussion database on the server Juno.
See Also