MsiRecordSetInteger function (msiquery.h)

The MsiRecordSetInteger function sets a record field to an integer field.

Syntax

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

Parameters

[in] hRecord

Handle to the record.

[in] iField

Specifies the field of the record to set.

[in] iValue

Specifies the value to which to set the field.

Return value

This function returns UINT.

Remarks

In the MsiRecordSetInteger function, attempting to store a value in a nonexistent field causes an error. Note that the following code returns 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);  

To set a record integer field to NULL_INTEGER, set iValue to MSI_NULL_INTEGER.

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

See also

Record Processing Functions