ADO Stream object: SaveToFile Method

Home | About me | EXCEL VB Programming (XL97-2003) | ACCESS Programming | EXCEL VB.Net Programming | EXCEL Spreadsheet Functions Material Management  |  Guestbook
 

ADO Stream object: SaveToFile Method

The SaveToFile method can be called when you want to save the binary contents of a Stream object to a local file. This can be an already existing file or a newly created file. After the save is accomplished, the position will be set to zero (Position=0). If you save to an existing file, all existing bytes contained in the file will be completely overwritten.

This method does not change or affect the Stream object in any way.

There is one mandatory and one optional parameter.

Syntax

objStream.SaveToFile filename,opt

Example


objStream.SaveToFile RSL.txt, adSaveCreateOverwrite

 
Parameter

Description

filename Required. The name of the file to save the contents of the Stream object
option Optional. A SaveOptionsEnum value that specifies whether a file should be created if it does not exist or overwritten. Default is adSaveCreateNotExist. The values can be combined with the AND operator
 

SaveOptionsEnum Values

Constant Value

Description

adSaveCreateNotExist 1 Default. Creates a new file if the file does not already exist
adSaveCreateOverWrite 2 Overwrites the file with the data from the currently open Stream object, if the file already exists