MsiRecordSetStream Function
MsiRecordSetStream Function

The MsiRecordSetStream function sets a record stream field from a file. Stream data cannot be inserted into temporary fields.

Syntax

UINT MsiRecordSetStream(
  __in  MSIHANDLE hRecord,
  __in  UNIT iField,
  __in  LPCTSTR szFilePath
);


Parameters

hRecord [in]

Handle to the record.

iField [in]

Specifies the field of the record to set.

szFilePath [in]

Specifies the path to the file containing the stream.

Return Value

The MsiRecordSetStream function returns the following values:

ERROR_BAD_PATHNAME

An invalid path was supplied.

ERROR_FUNCTION_FAILED

The function failed.

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

The contents of the file specified in the MsiRecordSetStream function is read into a stream object. The stream persists if the record is inserted into the database and the database is committed.

To reset the stream to its beginning you must pass in a Null pointer for szFilePath. Do not pass a pointer to an empty string, "", to reset the stream.

See also OLE Limitations on Streams.

If the function fails, you can obtain extended error information by using MsiGetLastErrorRecord.

Requirements

Version

Windows 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

Header

Msiquery.h

Library

Msi.lib

DLL

Msi.dll

Unicode and ANSI names

MsiRecordSetStreamW (Unicode) and MsiRecordSetStreamA (ANSI)

See Also

Record Processing Functions

 

 

Send comments about this topic to Microsoft

Build date: 2/4/2010

© 2010 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