<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods > CopyFile |
Declaration
function CopyFile( sToFileName: String ): WordBool;
Description
Copies the current data table to another file. Any filters in use on the source file and the setting of SetDeleted are respected. The records are copied in the order of the current index in use. If memos are attached to the source data table, a memo file is created and memos are copied as well.
WARNING: If a file exists with the same name as the target data table, it is overwritten without warning.
The progress of the function may be visually monitored if a gauge hook has been set with SetGaugeHook.
Parameters
sToFileName: The name of the target data table including full path and extension information if desired. The default extension is DBF. If a memo file must be created, the SDENTX driver will create a file of the same name with an extension of DBT. The extensions for the SDEFOX and SDENSX drivers are FPT and SMT respectively.
When working with a remote table via Apollo Database Server, you may only copy the table into a new table name within the same Database directory as the source table. The remote client cannot specify a physical server drive/path location and must use the defined server alias instead. Any physical drive/path included in the sToFileName parameter will be ignored for remote tables.
Return Value
True or False depending upon the outcome of the operation.
Delphi Example
{Build a test subset of a master data table}
with ApTbl do
begin
Open;
Query( 'upper(trim(place))="CHINA" .and. left(LAST, 1)>" "' );
GoTop;
bRet := CopyFile( 'c:\Apollo\test.dbf' );
end;
See Also