GetDatabase (NotesSession - LotusScript®)

Creates a NotesDatabase object that represents the database located at the server and file name you specify, and opens the database, if possible.

Defined in

NotesSession

Syntax

Set notesDatabase = notesSession .GetDatabase( server$ , dbfile$ [, createonfail ] )

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: if the script runs on the workstation, the empty string indicates a local database; if the script runs on a server, it indicates a database on that server.

dbfile$

String. The file name and location of the database within the Notes® data directory. Use a full path name if the database is not within the Notes® data directory. Use empty strings for both dbfile$ and server$ if you want to create a Database object not yet associated with a database.

createonfail

Note: This parameter is new with Release 5.

Boolean. Optional. Specify True (default) to create a Database object even if the specified database cannot be opened. Specify False to return Nothing (the Database object is not created) if the database cannot be opened.

Return value

notesDatabase

A NotesDatabase object that can be used to access the database you've specified, or Nothing if the database cannot be opened and createonfail is False. If the database cannot be opened and createonfail is True or omitted, IsOpen is false for the NotesDatabase object.

Example