Condividi tramite


MODIFY STRUCTURE Command

Displays the Table Designer, making it possible for you to modify the structure of a table.

MODIFY STRUCTURE

Remarks

In previous versions of FoxPro, MODIFY STRUCTURE opens the Table Structure dialog box.

If a table isn't open in the currently selected work area, the Open dialog box is displayed, making it possible for you to choose a table to modify.

Changes you can make to a table's structure include adding and deleting fields; modifying field names, sizes, and data types; adding, deleting, or modifying index tags; and specifying null value support for fields.

You can also modify the structure of a table using the interface. For more information, see Modifying the Table Structure.

Caution   Changing a field from one data type to another may not transfer the contents of the field correctly, or at all. For example, if you convert a field of date type to a numeric type, the field contents do not transfer.

Visual FoxPro automatically makes a backup copy of the current table before you change the table's structure. When the modifications are complete, the data contained in the backup copy of the table is appended to the newly modified table structure. If the table has a memo field, a memo backup file is also created. The table backup file has a .bak extension, and the memo backup file has a .tbk extension.

If you accept the structure changes and then interrupt the data-copying process, the new file will not contain all the records in the original table.

Remember that Visual FoxPro creates a .bak file for the original table file and, if the table has a memo field, a .tbk copy of the original memo file. If you have any problems with MODIFY STRUCTURE, you can delete the new file or files and rename the .bak file and .tbk file, if any, to the original file extensions (.dbf and .fpt).

When you modify the structure of a table that has a memo field, the blocksize of the memo file is set to the current blocksize setting. You can specify the memo file blocksize with SET BLOCKSIZE.

See Also

ALTER TABLE - SQL | CREATE | CREATE TABLE - SQL | SET BLOCKSIZE | Modifying the Table Structure