Create an empty database file with field definitions from another database file.
XSharp.RT (in XSharp.RT.dll) Version: 2.18
Syntax Request Example
cTargetFile AS STRING,
acStruct AS ARRAY
) AS LOGIC
public static bool DbCopyStruct(
[DefaultParameterValueAttribute(null, 0)] Array acStruct
- Type: String
The name of the target database file, including an optional drive, directory, and extension. See SetDefault() and SetPath() for file searching and creation rules.
The default extension for database files is determined by the RDD .
If cTargetFile does not exist, it is created.
If it exists, this function attempts to open the file in exclusive mode and, if successful, the file is overwritten without warning or error.
If access is denied because, for example, another process is using the file, NetErr() is set to TRUE.
DBCopyStruct() creates the specified file in ANSI or OEM character set format, based on the SetAnsi() setting. (For more information, refer to the SetAnsi() function.)
- Type: Array
A one-dimensional array of field names to copy to the new database file.
The default is all fields.
TRUE if successful; otherwise, FALSE.
By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying
it within an aliased expression
DBCopyStruct() is the functional equivalent of the COPY STRUCTURE command.
The following example copies the structure of the current database file to a new database file:
1USE Test NEW