OpenDatabase Method

[This is preliminary documentation and subject to change.]

This is the OpenDatabase method of the MsiInstall object. This method opens an existing database or creates a new one, returning an MsiDatabase object. It generates an error if the database object cannot be successfully created and opened.

Syntax

object.OpenDatabase(name, openMode)

Parts

object
MsiInstall object.
name
Required string containing the path name of the database. If an empty string is supplied, a temporary database is created that is not persisted.
openMode
Required enum from the following listed or a string containing the path name of the new output database file to be written to upon commit.
idoReadOnly = 0 Open database read-only; no persisted changes.
idoTransact = 1 Open database; read-write in transaction mode.
idoDirect = 2 Open database direct; read-write without transaction.
idoCreate = 3 Create new database; read-write in transaction mode.
idoCreateDirect = 4 Create new database; read-write without transaction mode.

Remarks

Database Specifications

The database type is determined by examining path and file content as specified below:

An MSI package if a doc file with the correct CLSID, .msi extension is typical.

Note  When a database is opened as the output of another database, the summary information stream of the output database is actually a read-only mirror of the original database and thus cannot be changed. Additionally, it will not be persisted with the database. To create or modify the summary information for the output database it must be closed and re-opened.