|
<< Click to Display Table of Contents >> Modifying table structure |
![]() ![]()
|
After a table has been created, the application can modify it using BDE functions in the following ways:
•Add, delete, or regenerate indexes
•Restructure the table
Adding indexes
The application can add an index to a table by calling DbiAddIndex and supplying the IDXDesc structure, with the appropriate fields filled in (the fields required vary by driver and index type). For a complete description of these fields by driver and index type, see DbiAddIndex.
Deleting and regenerating indexes
The application can delete an index by calling DbiDeleteIndex. The application can either specify the table by name or by opening a cursor on the table. The index to be deleted cannot be active.
The application can bring dBASE, FoxPro, Access, or Paradox indexes up to date by calling either of two BDE functions. DbiRegenIndex regenerates a single out-of-date index. DbiRegenIndexes regenerates multiple out-of-date indexes on a table. The application specifies the index name.
Restructuring a table
Currently, for Paradox, dBASE, FoxPro, and Access tables (local table types) only, the application can call DbiDoRestructure to modify existing field types or sizes, add new fields, delete a field, rearrange fields, change indexes, security passwords, or referential integrity. Other tables are restructured using the SQL statement ALTER TABLE. Local table types may be restructured using ALTER TABLE as an alternative to the DbiDoRestructure function. However, in Local SQL this statement is limited in what metadata it can add or delete.
The application passes the table descriptor structure, CRTblDesc.