[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'BufDataset' (#fcl)


Saves the dataset to the specified file using the given data format


Source position: bufdataset.pas line 650

public procedure TCustomBufDataset.SaveToFile(

  AFileName: string = '';

  Format: TDataPacketFormat = dfBinary





File name where the dataset is stored`



Format for values written in the method


SaveToFile is a procedure used to save the content from the buffered dataset to the specified file name using a given data format.

AFileName is a String with the name of the file on the local file system. AFileName can contain optional path information, and should include the base name and extension for the file. For example:




The default value for AFileName is an empty string (''). When AFileName is omitted, the value in the FileName property will be used to save the content for the dataset. An Exception will be raised if both AFileName and FileName contain an empty String ('').

Format is a TDataPacketFormat enumeration value that indicates the storage format to use when writing the content for the file. The default value for Format is dfBinary, and indicates that the TFpcBinaryDatapacketReader should be used to write the values in the file. Other values in the TDataPacketFormat enumeration indicate a specific registered data packet handler supporting a specific format should be used.

SaveToFile creates a temporary TFileStream instance for the specified file name, and calls the SaveToStream method to store the dataset to the stream in the required Format.

See also



File name on the local file system used to load or store the dataset



Saves the dataset to the specified stream using the given data format

Documentation generated on: May 14 2021