|
Adds the current table defined by the values of the TableName, Location, FieldList and IndexList to the current DDF.
object.DdfAddTable bOverwrite
The DdfAddTable method syntax has these parts:
|
Part
|
Description
|
|
object
|
Required. The name of a valid VAccess control.
|
|
bOverwrite
|
Required. Boolean specifying whether the VAccess control should overwrite an existing table definition if one exists.
|
DdfAddTable returns a two-byte integer that holds the status of the VAccess control. If this is zero, the operation completed successfully.
DdfAddTable writes the information in the current memory image of the VAccess control to the DDF file itself. If bOverwrite is True, the control will overwrite an existing table with the same name. Otherwise, this method will fail if a table with the same name is found to exist in the current DDF (as specified by the DdfPath property).
This function does not manipulate the VAccess memory image of the metadata or the data file itself in any way. To create a new, blank table in the VAccess memory image of the metadata, use the DdfAddTableName method. Use the DdfCreateTable method to create a new table in the DDF and corresponding empty data file in the location specified.
Unlike many of the other dictionary methods and properties, DdfAddTable does not check RefreshLocations. Since its only purpose is to write DDF information, it assumes that it should write directly to the DDF. This behavior means that you do not have to switch RefreshLocations if you plan to use the VAccess memory image to store DDF changes and write them to the DDF in one pass (see Pervasive PSQL Programmer's Guide).
If DdfTransactionMode is True, the DDF writing will be performed inside a transaction.
'assume that fields, indexes, tableName and location 'are already set VAEngine.FieldList = fields VAEngine.IndexList = indexes VAEngine.fileName = tableName VAEngine.location = location status = VAEngine.DDFAddTable(True)
DdfAddTableName, DdfCreateTable, DdfTransactionMode
|
Chapter contents
Prev topic: DdfAddIndex
|