RAD Studio VCL Reference
TCustomADODataSet.SaveToFile Method

Saves a recordset to a file.

procedure SaveToFile(const FileName: WideString = ''; Format: TPersistFormat = pfADTG);
__fastcall SaveToFile(const BSTR FileName = '', TPersistFormat Format = pfADTG);

Call SaveToFile to save the current recordset to a file. If the destination file already exists, it is overwritten. 

FileName is a string containing the name of the destination file. This file remains open from the first call to SaveToFile until the dataset is closed. This file can be read by other applications while it is open, but they cannot write to the file. 

Format specifies the file format for the saved recordset. By default, Format is pfADTG (Advanced Data TableGram format).

Note: Microsoft recommends using a client-side cursor (the dataset is opened with a CursorLocation property value of clUseClient). This way, if the provider used does not support saving the recordset the client cursor will provide the necessary functionality.


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!