Partager via


How to: Extend Database Files

Each record in the database (.dbc) file has a Memo field named User. You can use this field to store additional information about each record in the database file. You can also add user-defined fields to the end of a database file.

Note

To modify the structure of a database file, you must open the database file exclusively.

Warning

Do not change any existing Visual FoxPro- defined fields in a database file. Any changes you make to a database file might affect the validity of your database.

To add a field to a database file

  1. Close the database.

  2. Use the USE command with the name of the database file, including the .dbc file name extension, and the EXCLUSIVE keyword.

  3. On the following line, use the MODIFY STRUCTURE command.

    The Table Designer opens for the database file.

You can now add fields to the database file.

Tip

When you add a new field to a database file, begin the field name with the letter "U" to designate it as a user-defined field. This designation prevents your field from conflicting with any future extensions to the database file.

For example, the following code first closes the database MyDatabase, opens the database file MyDatabase.dbc exclusively, and then opens the Table Designer for the database file so you can add fields:

CLOSE MyDatabase
USE MyDatabase.dbc EXCLUSIVE
MODIFY STRUCTURE

See Also

Tasks

How to: View Database Structure

Other Resources

Managing Databases

Developing Databases