How to: Add Fields to Tables
When opening the table in the Table Designer, the Fields tab displays a row for the first field and adds a field following the field as you define it. You can add additional fields to the table in the order that you want.
To add a field to a table
Open the table in the Table Designer.
On the Fields tab, insert the cursor in the field that follows the one you want to add.
Click Insert.
A new field appears preceding the selected field with a default field name, type, and width.
Change the attributes for the field to the ones you want.
When you are finished, click OK.
Visual FoxPro prompts you to confirm changes to table structure.
To confirm the table structure changes, click Yes.
To add a field to a table programmatically
- Use the SQL ALTER TABLE command and include the ADD COLUMN clause.
For more information, see ALTER TABLE - SQL Command.
For example, the following code adds a field named Fax with Character type and a field width of 10 characters to a customer table:
ALTER TABLE Customer ADD COLUMN Fax C(20)