32
We set the property of hgdatabase. It sets the database title property as
“New Title”. HTDATABASE_TITLE specifies the database property to be
set. If it fails, the function will return a failure code to hgstatus.
hgstatus = HTDatabaseSetProperty(hgdatabase,
HTDATABASE_TITLE, ByVal "New Title")
We open the database specified by hgdatabase. The flag
HTDBCLOSEF_SAVE_DOCS is a constant defined by the HiTest API. It
means that the document has changed but is still open and will be closed
when the database is closed. If it cannot complete successfully, the function
will return a failure code (unvalid database) to hgstatus.
hgstatus = HTDatabaseClose(hgdatabase, HTDBCLOSEF_SAVE_DOCS)
We close the Notes session. Each HTInit function must be closed. If there is
a failure, the same failure code will be returned as for HTInit.
hgstatus = HTTerm(0)
Opening and Closing a Database
The HTDatabaseOpen function opens a Notes database and returns the
handle. The handle represents an active connection to the indicated
database file. Multiple databases may be open at one time, including
multiple connections to a single database. Access to the database’s data and
metadata can only occur in the context of an open database.
For more information, refer to the example on how to access Notes
database properties further on in this chapter.
Creating a Notes Database
The HTDatabaseCreate function creates a new database. The database may
be created from scratch or from an existing database template. The local
Notes user will be added to the new database Access Control List (ACL) as
the manager.
For more information, refer to the example in Chapter 5 on how to create a
new database called TEST in HiTest.
Chapter 7
:
Accessing Notes Databases 125