Opens a Stream object to manipulate streams of binary or text data.
Stream.Open Source, Mode, OpenOptions, UserName, Password
When a Record object is passed in as the source parameter, the UserID and Password parameters are not used because access to the Record object is already available. Similarly, the Mode of the Record object is transferred to the Stream object.When Source is not specified, the Stream opened contains no data and has a Size of zero (0). To avoid losing any data that is written to this Stream when the Stream is closed, save the Stream with the CopyTo or SaveToFile methods, or save it to another memory location.
An OpenOptions value of adOpenStreamFromRecord identifies the contents of the Source parameter to be an already open Record object. The default behavior is to treat Source as a URL that points directly to a node in a tree structure, such as a file. The default stream associated with that node is opened.
While the Stream is not open, it is possible to read all the read-only properties of the Stream. If a Stream is opened asynchronously, all subsequent operations (other than checking the State and other read-only properties) are blocked until the Open operation is completed.
In addition to the options discussed above, by not specifying Source, you can simply instantiate a Stream object in memory without associating it with an underlying source. You can dynamically add data to the stream simply by writing binary or text data to the Stream with Write or WriteText, or by loading data from a file with LoadFromFile.
Open Method (ADO Connection) | Open Method (ADO Record) | Open Method (ADO Recordset) | OpenSchema Method | SaveToFile Method
Applies To: Stream Object