CopyStructure

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods >

CopyStructure

Declaration

function CopyStructure( sFileName: String ): WordBool;

Description

Creates a data table that has the same structure as the current data table. The new file is created but is not left open.

Parameters

sFileName: The name of the target file qualified with a complete path and extension.

image\tip.gif When working with a remote table via Apollo Database Server, you may only create the new table 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 sFileName parameter will be ignored for remote tables.

Return Value

True or False depending upon the outcome of the operation.

Delphi Example

{Copy structure of current table to FOO.DBF}

if ApTbl.CopyStructure( 'c:\Apollo\Data\foo.dbf' ) = True then

 ShowMessage( 'Successful!' ) 

else

 ShowMessage( 'Failed!' ); 

C++Builder Example

// Copy structure of current table to FOO.DBF

if (ApTbl->CopyStructure( "c:\\Apollo\\Data\\foo.dbf" ))

 ShowMessage( "Successful!" ); 

else

 ShowMessage( "Failed!" ); 

See Also

CopyStructureExtended, AppendFrom, CopyFile, CreateExec, CreateField, CreateNew