msirecordSetStringA 函数 (msiquery.h)

MsiRecordSetString 函数将字符串复制到指定的字段中。

语法

UINT MsiRecordSetStringA(
  [in] MSIHANDLE hRecord,
  [in] UINT      iField,
  [in] LPCSTR    szValue
);

参数

[in] hRecord

记录的句柄。

[in] iField

指定要设置的记录的字段。

[in] szValue

指定字段的字符串值。

返回值

此函数返回 UINT。

注解

MsiRecordSetString 函数中,空字符串指针和空字符串均将字段设置为 null。 尝试将值存储在不存在的字段中会导致错误。

若要将记录字符串字段设置为 null,请将 szValue 设置为 null 字符串或空字符串。

注意

msiquery.h 标头将 MsiRecordSetString 定义为别名,该别名根据 UNICODE 预处理器常量的定义自动选择此函数的 ANSI 或 Unicode 版本。 将非特定编码别名的使用与非非特定编码的代码混合使用可能会导致不匹配,从而导致编译或运行时错误。 有关详细信息,请参阅 函数原型的约定

要求

要求
最低受支持的客户端 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 Server 2003 或 Windows XP 上的 Windows Installer
目标平台 Windows
标头 msiquery.h
Library Msi.lib
DLL Msi.dll

另请参阅

记录处理函数