Name

Stream.Write Method — (Versions 2.5, 2.6)

Synopsis

stream.Write Buffer
                  

The Write method writes a number of bytes to a binary stream.

Arguments

Buffer (Variant)

Contains an array of Byte values to be written to the current binary stream.

Description

After writing the specified bytes to the Stream object, the Position property is set to the next byte following the last byte written. If there is existing data past the end of what has been written, it is not truncated. If you want to truncate this data, call the SetEOS method.

If the written data exceeds the length of the Stream object, the new data is appended to the Stream object, the length of the stream is increased, and the EOS pointer is moved to the new end of the stream.

The Write method is used to write to binary streams (Stream.Type property is equal to adTypeBinary), while the WriteText method is used to write textual streams (Stream.Type property is equal to adTypeText).

See Also

Stream.EOS Property, Stream.SetEOS Method, Stream.Type Property, Stream.WriteText Method, StreamWriteEnum Enumeration

Get ADO: ActiveX Data Objects 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.