Stream Object

The Stream object represents a stream of text or data. It allows you to persist a set of records or data in memory. Although typically used with OLE DB data providers and semi-structured data, it can also be used for simple data from a Recordset object by specifying a valid Stream object in the Recordset's Destination property. By setting the Destination property to a valid Stream object, all data in the Recordset is then stored in the Stream object and can be manipulated, copied, or saved to a file. This method of saving data allows more flexibility than the Recordset object's Save method. Table 12.23 and Table 12.24 list the Stream object's properties and methods, respectively.

Table 12.23. Stream Object Properties

Property

Description

Charset

Identifies which character set is used by the Stream.

EOS

Evaluates to True if the current character or byte is the end of the Stream. This is a read-only property.

LineSeparator

Indicates what character or character sequence should be evaluated as the end of a line. The default is carriage-return + linefeed (vbCrLf).

Mode

Indicates the permissions available for changing data in a Connection object.

Position

Specifies the current byte or character position in the current Stream object.

Size

Indicates the length in bytes of the current Stream. This is a read-only property.

State

Indicates whether the current Stream is open or closed. If the current Stream is open, this property also indicates the state ...

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.