MsiRecordSetInteger Function
MsiRecordSetInteger Function

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

Syntax

UINT MsiRecordSetInteger(
  __in  MSIHANDLE hRecord,
  __in  unsigned int iField,
  __in  int iValue
);


Parameters

hRecord [in]

Handle to the record.

iField [in]

Specifies the field of the record to set.

iValue [in]

Specifies the value to which to set the field.

Return Value

ERROR_INVALID_FIELD

An invalid field of the record was supplied.

ERROR_INVALID_HANDLE

An invalid or inactive handle was supplied.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function.

ERROR_SUCCESS

The function succeeded.

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

VersionWindows Installer 5.0 on 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, Windows XP, and Windows 2000
HeaderMsiquery.h
LibraryMsi.lib
DLLMsi.dll

See Also

Record Processing Functions

Send comments about this topic to Microsoft

Build date: 11/12/2009

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View