msiRecordSetInteger 函式 (msiquery.h)

MsiRecordSetInteger 函式會將記錄欄位設定為整數位段。

語法

UINT MsiRecordSetInteger(
  [in] MSIHANDLE hRecord,
  [in] UINT      iField,
  [in] int       iValue
);

參數

[in] hRecord

記錄的句柄。

[in] iField

指定要設定之記錄的欄位。

[in] iValue

指定要設定欄位的值。

傳回值

此函式會傳回UINT。

備註

MsiRecordSetInteger 函式中,嘗試將值儲存在不存在的欄位中會導致錯誤。 請注意,下列程式代碼會 傳回ERROR_INVALID_PARAMETER

MSIHANDLE hRecord;
UINT lReturn;  

//create an msirecord with no fields
hRecord = MsiCreateRecord(0); 

//attempting to set the first field's value gives you ERROR_INVALID_PARAMETER 
lReturn = MsiRecordSetInteger(hRecord, 1, 0);  

若要將記錄整數位段設定為 NULL_INTEGER,請將 iValue 設定為 MSI_NULL_INTEGER

規格需求

需求
最低支援的用戶端 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
標頭 msiquery.h
程式庫 Msi.lib
Dll Msi.dll

另請參閱

記錄處理函式