Initial Release 6

Function : Database
NSFDbOpenTemplate - Opens an existing Domino database or database template in either the private or shared data directory.
----------------------------------------------------------------------------------------------------------

#include <nsfdb.h>

STATUS LNPUBLIC NSFDbOpenTemplate(
const char far *PathName,
DBHANDLE far *rethDB
);

Description :

This function takes a pathname to an existing Domino database or database template (whether on a Lotus Domino Server or a local database), opens the database, and returns a handle to it. All subsequent access to the database is carried out via this handle. Use NSFDbClose to close the database file handle and deallocate the memory associated with it.

This function can also be used to open a directory. The resulting handle can be passed to NSFSearch to find the contents of the directory. To open the local data directory, use OSGetEnvironmentString with the VariableName set to "Directory" to get the pathname of the local data directory or if NULL is specified, the local data directory (the value of the "Directory=" environment variable from notes.ini) will be opened.

Because this function can open a directory or a database, do not use this function to test for the existence of a database. To test a handle to distinguish a database handle from a directory handle, use NSFDbModeGet. NSFDbModeGet takes a DBHANDLE as input and returns a pointer to a USHORT that specifies whether the handle is associated with a database or with a directory. The USHORT values are defined in DB_xxx (NSFDbModeGet).

Parameters :

See Also :

NSFDbClose
----------------------------------------------------------------------------------------------------------