MsiDatabaseCommit function

The MsiDatabaseCommit function commits changes to a database.

Syntax


UINT MsiDatabaseCommit(
  _In_  MSIHANDLE hDatabase
);

Parameters

hDatabase [in]

Handle to the database obtained from MsiOpenDatabase.

Return value

The MsiDatabaseCommit function returns one of the following values:

ERROR_FUNCTION_FAILED

The function failed.

ERROR_INVALID_HANDLE

An invalid or inactive handle was supplied.

ERROR_INVALID_HANDLE_STATE

The handle is in an invalid state.

ERROR_SUCCESS

The function succeeded.

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

Version

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

Header

Msiquery.h

Library

Msi.lib

DLL

Msi.dll

See also

General Database Access Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft