Datasnap.DBClient.TCustomClientDataSet.FileName

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property FileName: string read FFileName write SetFileName;

C++

__property System::UnicodeString FileName = {read=FFileName, write=SetFileName};

Properties

Type Visibility Source Unit Parent
property public
Datasnap.DBClient.pas
Datasnap.DBClient.hpp
Datasnap.DBClient TCustomClientDataSet

Description

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

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.

See Also