ADO » Stream » Write

Version: 2.5

Syntax:
streamobject.Write Buffer
Buffer
The Buffer parameter is a variant that contains the binary data to write to the Stream.

Writes a specified number of bytes of binary data to an opened Stream object without adding any intervening spaces.

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.

Examples

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

See Also: