The Database object accesses an installer database.
The Database object is released when it is either taken out of scope or when the object variable associated with it is set to null. The Commit method must be called before the Database object is released to write out all persistent changes. If the Commit method is not called, the installer performs an implicit rollback upon object destruction.
The client can use the following procedure for data access.
To Query API Sequencing
- Obtain a Database object by calling the OpenDatabase or the Installer object.
- Initiate a query using a SQL string by calling the OpenView method of the Database object.
- Set query parameters in a Record object and execute the database query by calling the Execute method of the View object. This produces a result that can be fetched or updated.
- Call the Fetch method of the View object repeatedly to return Record objects.
- Update database rows of a Record object obtained by the Fetch method using the Modify method of the View object.
- Release the query and any unfetched records by calling the Close method of the View object.
- Persist any database updates by calling the Commit method of the Database object.
Methods
The Database object defines the following methods.
Method | Description |
---|---|
Applies the transform to this database. |
|
Finalizes the persistent form of the database. |
|
Creates and populates the summary information stream of an existing transform file. |
|
Facilitates the authoring of dialog boxes and billboards by providing the support needed to view user interface dialog boxes stored in the installer database. |
|
Copies the structure and data from a specified table to a text archive file. |
|
Creates a transform. |
|
Imports a database table from a text archive file. |
|
Merges the reference database with the base database. |
|
Returns a View object representing the query specified by a SQL string. |
Properties
The Database object defines the following properties.
Property | Access type | Description |
---|---|---|
Read-only | Returns the persistence state of the database. |
|
Read-only | Returns a Record object containing the table name and the column names (comprising the primary keys). |
|
Read-only | Returns a SummaryInfo object that can be used to examine, update, and add properties to the summary information stream. |
|
Read-only | Returns the persistence state of the table. |
Requirements
Version | Windows Installer 5.0 on 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, Windows XP, and Windows 2000 |
---|---|
DLL | Msi.dll |
IID | IID_IDatabase is defined as 000C109D-0000-0000-C000-000000000046 |
See Also
Send comments about this topic to Microsoft
Build date: 8/13/2009
© 2009 Microsoft Corporation. All rights reserved.