Save Method (ADO Recordset)

      Applies To   

Saves (persists) the Recordset in a file.

Syntax

recordset.Save FileName, PersistFormat

Parameters

FileName   Optional. Complete path name of the file where the Recordset is to be saved.

PersistFormat   Optional. The format in which the Recordset is to be saved. Currently the default, and only, valid value is adPersistADTG.

Remarks

The Save method can only be invoked on an open Recordset. Use the Open method to later restore the Recordset from FileName.

If the Filter property is in effect for the Recordset, then only the rows accessible under the filter are saved. If the Recordset is hierarchical, then the current child recordset and its children are saved, but not the parent recordset.

The first time you save the Recordset, specify FileName. If you subsequently invoke Save, omit FileName or else a run-time error will occur. If you subsequently invoke Save with a new FileName, the Recordset is saved to the new file. However, the new file and the original file will both be open.

Save does not close Recordset or FileName, so you can continue to work with the Recordset and save your most recent changes. FileName remains open until the Recordset is closed, during which time other applications can read but not write to FileName.

For reasons of security, the Save method cannot be used from a script executed by Microsoft Internet Explorer.

If the Save method is called while an asynchronous Recordset fetch, execute, or update operation is in progress, then Save waits until the asynchronous operation is complete.

When the Save method is done, the current row position will be the first row of the Recordset.