Obtaining A Database Handle
[This is preliminary documentation and subject to change.]
Before working with a database you must first obtain a handle to it.
To access information about an installer database
-
You obtain a handle to the database in one of two ways:
-
If an installation is in progress, you get a handle to the active database by calling the MsiGetActiveDatabase function.
-
Otherwise, to open any specified database, call the MsiOpenDatabase function.
-
Once you have a database open, you can call a variety of functions to obtain information about the database or to manipulate the database. For example, you can:
-
Obtain a record that contains all primary keys of the specified database by calling the MsiDatabaseGetPrimaryKeys function.
-
Check the current state of a database by calling the MsiGetDatabaseState function. With the MsiGetDatabaseState function, you can determine the read/write status for a database or if the handle is valid.