DdfCreateTable
Applies to
VAccess
Description
Adds a table definition to the dictionary and creates an empty data file using the path and file information specified in the Location property and the attributes defined by FieldList and IndexList.
Syntax
object. DdfCreateTable bOverwrite
The DdfCreateTable method syntax has these parts:
 
Return Value
DdfCreateTable returns a two-byte integer that holds the status of the VAccess control. If this is zero, the operation completed successfully.
Remarks
This method first calls DdfAddTable to add the table definition to the dictionary. If this call fails for any reason, i.e. the table definition already exists and overwrite is False, DdfCreateTable will also fail. If DdfAddTable succeeds, this method will attempt to create a new, empty data file using Location. The bOverwrite parameter also controls whether or not an existing data file at the same Location will be overwritten.
Unlike many of the other dictionary methods and properties, DdfCreateTable does not check RefreshLocations. Since it does not affect the VAccess memory image, 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, write them to the DDF, and create the table in one pass (see PSQL Programmer's Guide).
Example
'assume that fields, indexes, tableName and 'location are already set
VAEngine.RefreshLocations = False
VAEngine.FieldList = fields
VAEngine.IndexList = indexes
VAEngine.TableName = tableName
VAEngine.Location = location
status = VAEngine.DDFCreateTable(True)
See Also
DdfAddTable