MsiDatabaseCommit function (msiquery.h)

The MsiDatabaseCommit function commits changes to a database.

Syntax

UINT MsiDatabaseCommit(
  [in] MSIHANDLE hDatabase
);

Parameters

[in] hDatabase

Handle to the database obtained from MsiOpenDatabase.

Return value

The MsiDatabaseCommit function returns one of the following values:

Remarks

The MsiDatabaseCommit function finalizes the persistent form of the database. All persistent data is then written to the writable database. No temporary columns or rows are written. The MsiDatabaseCommit function has no effect on a database that is opened as read-only. You can call this function multiple times to save the current state of tables loaded into memory. When the database is finally closed, any changes made after the database is committed are rolled back. This function is normally called prior to shutdown when all database changes have been finalized.

If the function fails, you can obtain extended error information by using MsiGetLastErrorRecord.

Requirements

Requirement Value
Minimum supported client 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
Target Platform Windows
Header msiquery.h
Library Msi.lib
DLL Msi.dll

See also

General Database Access Functions