The OpenDatabase method of the Installer object opens an existing database or creates a new one, returning a Database object. It generates an error if the Database object cannot be successfully created and opened.
Installer.OpenDatabase( name, openMode )
Required string that contains the path name of the database. If an empty string is supplied, a temporary database is created that is not persisted.
A parameter from the following list or a string that contains the path name of the new output database file that is to be written to upon commit.
Opens a database read-only, no persistent changes.
Opens a database read/write in transaction mode.
Opens a database direct read/write without transaction.
Creates a new database, transact mode read/write.
Creates a new database, direct mode read/write.
Opens a database to view advertise script files, such as the files generated by the CreateAdvertiseScript method.
Adds this flag to indicate a patch file.
A Database object that represents the existing or new installer database that was opened.
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 is not persisted with the database. To create or modify the summary information for the output database it must be closed and reopened.
To make and save changes to a database first open the database in transaction (msiOpenDatabaseModeTransact), create (msiOpenDatabaseModeCreate or msiOpenDatabaseModeCreateDirect), or direct (msiOpenDatabaseModeDirect) mode. After making the changes, always call the Commit method before closing the database handle. The Commit method flushes all buffers.
Always call the Commit method on a database that has been opened in direct mode (msiOpenDatabaseModeDirect or msiOpenDatabaseModeCreateDirect) before closing the database. Failure to do this may corrupt the database.
Because the OpenDatabase method initiates database access, it cannot be used with a running installation.
If the method fails, you can obtain extended error information by using the LastErrorRecord method.
||Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP
||IID_IInstaller is defined as 000C1090-0000-0000-C000-000000000046