MsiRecordSetStringA function (msiquery.h)

The MsiRecordSetString function copies a string into the designated field.

Syntax

UINT MsiRecordSetStringA(
  MSIHANDLE hRecord,
  UINT      iField,
  LPCSTR    szValue
);

Parameters

hRecord

Handle to the record.

iField

Specifies the field of the record to set.

szValue

Specifies the string value of the field.

Return value

This function returns UINT.

Remarks

In the MsiRecordSetString function, a null string pointer and an empty string both set the field to null. Attempting to store a value in a nonexistent field causes an error.

To set a record string field to null, set szValue to either a null string or an empty string.

Note

The msiquery.h header defines MsiRecordSetString as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

   
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. Windows Installer on Windows Server 2003 or Windows XP
Target Platform Windows
Header msiquery.h
Library Msi.lib
DLL Msi.dll

See also

Record Processing Functions