Open (NotesDatabase - LotusScript®)

Opens a database. A database must be open in order to access all its properties and methods. For details on accessing the properties and methods of a database, see the Usage section in NotesDatabase.

Note: COM supports the Open method only as a Sub with no parameters. To open a database with parameters in COM, see OpenDatabase in NotesDbDirectory. LotusScript® supports the Open method only with parameters.

Defined in

NotesDatabase

Syntax

Note: The following syntax is for LotusScript®.

flag = notesDatabase .Open( server$ , dbfile$ )

Note: The following syntax is for COM.

Call notesDatabase .Open()

Parameters

server$

String. The name of the server on which the database resides. Use an empty string ("") to indicate a database on the current computer, or for a NotesDatabase that's already assigned to a database.

dbfile$

String. The file name of the database to open. Use an empty string for a NotesDatabase that's already assigned to a database.

Return value

  • True indicates that the database exists and was opened
  • False indicates that there is no database at the location specified

Usage

Use the Open method as follows:

  • In LotusScript®, use Open to open a NotesDatabase object that's already assigned to an existing database. Both parameters must be empty strings (or they must match the server and file name of the existing database):

    db.Open( "", "" )

    The script returns an error if you try to reassign its server or file name using Open.

  • In COM, use Open to open a NotesDatabase object that's already assigned to an existing database. No parameters are allowed.

  • In LotusScript®, use Open to open a NotesDatabase object not yet assigned to an existing database. You must specify a server and a file name. The server name parameter can be an empty string (to indicate a database on the current computer), but the file name parameter cannot be empty.

Access level to a database

You need at least Reader access to a database to call Open. An error is returned if you do not have access.

Example