Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 2.1 KB

savetofile-method.md

File metadata and controls

49 lines (38 loc) · 2.1 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords apitype
SaveToFile Method
SaveToFile Method
rothja
jroth
01/19/2017
sql
ado
reference
_Stream::raw_SaveToFile
_Stream::SaveToFile
SaveToFile method [ADO]
COM

SaveToFile Method

Saves the binary contents of a Stream to a file.

Syntax

  
Stream.SaveToFile FileName, SaveOptions  

Parameters

FileName
A String value that contains the fully-qualified name of the file to which the contents of the Stream will be saved. You can save to any valid local location, or any location you have access to via a UNC value.

SaveOptions
A SaveOptionsEnum value that specifies whether a new file should be created by SaveToFile, if it does not already exist. Default value is adSaveCreateNotExists. With these options you can specify that an error occurs if the specified file does not exist. You can also specify that SaveToFile overwrites the current contents of an existing file.

Note

If you overwrite an existing file (when adSaveCreateOverwrite is set), SaveToFile truncates any bytes from the original existing file that follow the new EOS.

Remarks

SaveToFile may be used to copy the contents of a Stream object to a local file. There is no change in the contents or properties of the Stream object. The Stream object must be open before calling SaveToFile.

This method does not change the association of the Stream object to its underlying source. The Stream object will still be associated with the original URL or Record that was its source when opened.

After a SaveToFile operation, the current position (Position) in the stream is set to the beginning of the stream (0).

Applies To

Stream Object (ADO)

See Also

Open Method (ADO Stream)
Save Method