RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSQLBlobStream.Create Constructor

Creates and initializes an instance of TSQLBlobStream.

Pascal
constructor Create(Field: TBlobField; Mode: TBlobStreamMode = bmRead);
C++
__fastcall TSQLBlobStream(TBlobField Field, TBlobStreamMode Mode = bmRead);

Call Create to obtain an instance of TSQLBlobStream for reading from a specific TBlobField object in a TCustomSQLDataSet descendant. 

Field specifies the BLOB field from which to read data. 

The Mode parameter is provided for compatibility with other BLOB stream constructors. However, in TSQLBlobStream, the Mode parameter is ignored because dbExpress datasets are read-only. SQL Blob streams can only be used to read BLOB data.  

Create links the TSQLBlobStream to the field object specified by the Field parameter. It then calls ReadBlobData to read the information from the BLOB field into a memory buffer, where it is available for reading.

Warning: If you write to the SQLBlobStream using inherited methods, you are overwriting the in-memory buffer that is filled by the constructor. This will cause subsequent read operations to provide inaccurate information, because the BLOB stream no longer accurately reflects the contents of the BLOB field.
Instead of calling the TSQLBlobStream constructor, you can also use the dataset's CreateBlobStream method. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!