msiDatabaseCommit 函式 (msiquery.h)

MsiDatabaseCommit 函式會將變更認可至資料庫。

語法

UINT MsiDatabaseCommit(
  [in] MSIHANDLE hDatabase
);

參數

[in] hDatabase

MsiOpenDatabase 取得之資料庫的句柄。

傳回值

MsiDatabaseCommit 函式會傳回下列其中一個值:

備註

MsiDatabaseCommit 函式會完成資料庫的永續性形式。 然後,所有永續性數據都會寫入至可寫入的資料庫。 不會寫入暫存資料行或數據列。 MsiDatabaseCommit 函式對開啟為唯讀的資料庫沒有任何作用。 您可以多次呼叫此函式,以儲存載入記憶體的數據表目前狀態。 當資料庫最後關閉時,認可資料庫之後所做的任何變更都會回復。 當所有資料庫變更都完成時,通常會在關機之前呼叫此函式。

如果函式失敗,您可以使用 MsiGetLastErrorRecord 來取得擴充的錯誤資訊。

規格需求

需求
最低支援的用戶端 Windows Server 2012、Windows 8、Windows Server 2008 R2 或 Windows 7 上的 Windows Installer 5.0。 Windows Server 2008 或 Windows Vista 上的 Windows Installer 4.0 或 Windows Installer 4.5。 Windows Server 2003 或 Windows XP 上的 Windows Installer
目標平台 Windows
標頭 msiquery.h
程式庫 Msi.lib
Dll Msi.dll

另請參閱

一般數據庫存取函式