| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Creates a new database based on the current database structure.
DbCopyStruct( <cDatabase>, [<aFieldList>] ) --> NIL
The return value is always NIL.
Function DbCopyStruct() create a new, empty database file with a structure that is based on the database currently open in a work area. If <aFieldList> is empty, the new file has the same structure as the open database. Otherwise, the new file contains only the fields listed in <aFieldList>.
DbCopyStruct() can be used to create a subset of the currently open database, based on a given field list.
| See also: | COPY STRUCTURE, COPY STRUCTURE EXTENDED, DbCopyExtStruct(), DbCreate(), DbStruct() |
| Category: | Database functions , xHarbour extensions |
| Source: | rdd\dbstrux.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example creates a new database holding only two fields of
// the Customer database.
PROCEDURE Main
USE Customer
DbCopyStruct( "Test.dbf", { "Firstname", "Lastname" } )
USE Test
APPEND FROM Customer
Browse()
USE
RETURN
http://www.xHarbour.com