SDAC

TCustomMSDataSet.GetFileStreamForField Method

Used to create the TMSFileStream object for working with FILESTREAM data.

Class

TCustomMSDataSet

Syntax

function GetFileStreamForField(const FieldName: string; const DesiredAccess: TMSSqlFilestreamDesiredAccess = daReadWrite; const OpenOptions: TMSSqlFilestreamOpenOptions = []; const AllocationSize: Int64 = 0): TMSFileStream;

Parameters
FieldName
Contains the existing field name of a VARBINARY(MAX) column.
DesiredAccess

Determines the mode that is used to access FILESTREAM data.

The following values can be used:

OpenOptions

Determines file attributes and flags. By default, the file is being opened or created with no special options. The following values can be used:

AllocationSize
Determines the initial allocation size of the data file in bytes. It is ignored in read mode. If this parameter is 0, the default file system behavior is used.
Return Value
The TMSFileStream object for working with FILESTREAM data.

Remarks

Creates the TMSFileStream object for working with FILESTREAM data of specified column. Transaction must be started before calling this method.

Note that this method requests server to obtain the Win32 compatible file handle for a FILESTREAM data.

To obtain the file handle, the following steps are performed:

  1. getting the current transaction context of a session by calling the GET_FILESTREAM_TRANSACTION_CONTEXT Transact-SQL function. ( http://msdn.microsoft.com/en-us/library/bb934014.aspx )
  2. obtaining the Win32 file handle by executing the OpenSqlFilestream API. ( http://msdn.microsoft.com/en-us/library/bb933972.aspx )

Note: You can find more information about working with FILESTREAM data in MSDN at http://msdn.microsoft.com/en-us/library/cc949109(v=sql.100).aspx

See Also

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback