Save Method (ADO Recordset)

Saves (persists) the Recordset in a file.

Syntax

recordset.Save FileName, PersistFormat, SaveOptions

Parameters

FileName 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.

SaveOptions Optional. One of the following values.

AdSaveOverwrite If FileName exists, then overwrite it with the current state of recordset.
AdSaveFileIfExist (Default) If FileName exists, then Save fails.

Remarks

This method can be invoked only 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 only the current chapter is saved (that is, the set of children rows associated with a parent row).

You can continue to work on the Recordset after saving it. Invoking the Save method does not close the Recordset.