open (NotesDatabase - JavaScript)

Opens a database.

Defined in

NotesDatabase

Syntax

open() : boolean
Return value Description
boolean
  • true if the database exists and is opened
  • false if no database with this name exists

Usage

A database must be open to use the NotesDatabase properties and methods with some exceptions. Most methods that access a database open it, but some do not. See isOpen for details.

An error is returned if the user does not have access rights to the database or server.

Examples

This button opens each address book to get its modification date.
try {
	var books = session.getAddressBooks().iterator();
	while (books.hasNext()) {
		var book:NotesDatabase = books.next();
		if (book.open()) {
			requestScope.status += "\"" + book.getTitle() + "\" is open\n";
			requestScope.status += "\tmodified: " + book.getLastModified().getLocalTime() + "\n";
		} else {
			requestScope.status += "\"" + book.getTitle() + "\" failed to open\n";
		}
	}
} catch(e) {
	requestScope.status = e.toString();
}