ADO » Stream » Type

Version: 2.5

streamobject.Type = StreamTypeEnum
StreamTypeEnum = streamobject.Type

Sets or returns a StreamTypeEnum value defining if the data is binary or text.

The Type property sets or returns a StreamTypeEnum constant that indicates whether the data in a Stream object is text or binary.

The default is text. However, when binary data is written to a new, empty Stream object, the Type will be implicitly set to binary.

You can set this property for a Stream object if it is open or closed, but if the object is open, the Position must be set to zero (the start of the stream). If the object is open and the Position is not at zero, this property is read-only (return).

For text data, the character set used for translation is set using the CharSet property.

StreamTypeEnum Constant

Constant Value Description
adTypeBinary 1 Binary data
adTypeText 2 Default, text data


If (objStream.Type = adTypeText) Then
   objStream.Charset = "ascii"
End If

See Also: