MsiRecordSetString Function

Windows Installer

MsiRecordSetString Function

The MsiRecordSetString function copies a string into the designated field.

Syntax

C++UINT MsiRecordSetString(
  __in  MSIHANDLE hRecord,
  __in  unsigned int iField,
  __in  LPCTSTR szValue
);

Parameters

hRecord [in]

Handle to the record.

iField [in]

Specifies the field of the record to set.

szValue [in]

Specifies the string value of the field.

Return Value

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 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.

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
Unicode and ANSI namesMsiRecordSetStringW (Unicode) and MsiRecordSetStringA (ANSI)

See Also

Record Processing Functions

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.