RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TClientDataSet.FileName Property

Specifies a file that stores the data of the client dataset.

Pascal
property FileName: string;
C++
__property AnsiString FileName;

Set FileName if the client dataset always reads its data from and writes its data to a single file. When FileName represents a valid file name, the client dataset automatically writes its data to that file when it is closed. When FileName specifies the name of an existing file, the client dataset automatically reads its data from that file when it is opened. 

Changes are not merged into the data when it is saved to the file. This allows an application that employs the "briefcase" model to set FileName without losing updates that are destined for a database server. Single-tiered applications should explicitly merge changes before closing the dataset and saving the data to disk.

Note: When client datasets write their data to a file, they overwrite the contents of the file. Any previous contents of the file are lost.
To read from or write to a different file, use the LoadFromFile and SaveToFile methods instead. These methods can also be used to load and save data at times other than when the Active property changes. 

 

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