METHOD:  Stream::Write

Implemented in version 2.5

streamobject.Write Buffer

The Write method can be used to append or add binary data to a Stream object. To add text data, use the similar WriteText method.

It is wise to use this method very carefully.

If there already is binary data (bytes) in the Stream object and the current position is set to EOS, the new binary data will be appended onto the end of the existing data. However, if the current position is not at EOS, then the existing data will be overwritten.

If you write past the current EOS, the size of the Stream will be implicitly increased, the new EOS will become the last byte in the Stream; and the current position will be set at EOS.

If you do not write past the current EOS, the current position will be set at the next byte after the newly written data. You will also be left with truncated, previously existing data starting at the new current position and continuing out to EOS. You can call the SetEOS method to truncate.

There is one mandatory parameter.

The Buffer parameter is a variant that contains the binary data to write to the Stream.

Code (VBScript):
If (objStream.Type = adTypeBinary) Then
   objStream.Write Recordset.Fields("GuruChants").Value
   objStream.SaveToFile strFileName
End If

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information