Version: 2.5
The ADO Stream object provides access to a stream of binary data or text. By access, we mean the ability to read, write, and manage the stream.
For example, you can use the Record and Recordset objects to gain access
to files on a Web server,
and then use the Stream object to gain access and manipulate the actual contents of those files.
There are three major ways to obtain a Stream object:
Syntax: streamobject.CharSet = string
string = streamobject.CharSet
Sets or returns a string value that specifies into which character set the contents of a text Stream are to be translated.
Syntax: boolean = streamobject.EOS
Returns a Boolean value indicating whether or not the current position is at the end of the stream.
Syntax: streamobject.LineSeparator = LineSeparatorsEnum
LineSeparatorsEnun = streamobject.LineSeparator
Sets or returns a LineSeparatorEnum value that specifies which binary character to use as the line separator in a text Stream object.
Syntax: streamobject.Mode = ConnectModeEnum
ConnectModeEnun = streamobject.Mode
Sets or returns a ConnectModeEnum value that specifies the available permissions for modifying data.
Syntax: streamobject.Position = long
long = streamobject.Position
Sets or returns a long value that specifies the current position, measured in bytes, from the beginning of the stream.
Syntax: long = streamobject.Size
Returns a long value that is the size in bytes of an opened Stream object.
Syntax: ObjectStateEnum = streamobject.State
Returns a long value describing if the Stream object is open or closed.
Syntax: streamobject.Type = StreamTypeEnum
StreamTypeEnum = streamobject.Type
Sets or returns a StreamTypeEnum value defining if the data is binary or text.
Syntax: streamobject.Cancel
Cancels the execution of a pending Open call.
Syntax: streamobject.Close
Close a Stream object.
Syntax: streamobject.CopyTo DestStream, NumChars
Copies the specified number of characters or bytes from one Stream object to another Stream object.
Syntax: streamobject.Flush
Sends the contents of the Stream object to the underlying object that is the source of the Stream object.
Syntax: streamobject.LoadFromFile FileName
Loads the contents of an existing file into an open Stream object.
Syntax: streamobject.Open Source, Mode, OpenOptions, UserName, Password
Opens a Stream object from a URL or Record object.
Syntax: variant = streamobject.Read (NumBytes)
Reads the specified number of bytes from a binary Stream object andreturns the data as a variant.
Syntax: string = streamobject.ReadText (NumBytes)
Reads the specified number of bytes from a text Stream object andreturns the data as a string.
Syntax: streamobject.SaveToFile FileName, SaveOptions
Copies (saves) the contents of an opened Stream object to a specified file.
Syntax: streamobject.SetEOS
Sets the value of the EOS property to be the current position.
Syntax: streamobject.SkipLine
Skips all of the characters on one entire line, including the next line separator, while reading a text stream.
Syntax: streamobject.Write Buffer
Writes a specified number of bytes of binary data to an opened Stream object without adding any intervening spaces.
Syntax: streamobject.WriteText Data, Options
Writes a specified text string to an opened Stream object without adding any intervening spaces or characters.