Table and Database Differences

See Also

Visual FoxPro distinguishes between tables and databases. Although FoxPro 2.6 tables are fully functional in Visual FoxPro, if you modify the table structure of FoxPro tables, they are saved as Visual FoxPro tables.

FoxPro 2.6 feature or functionality Visual FoxPro feature or functionality
Character field with
NOCPTRANS characteristic
Character (BINARY) field type. See Data and Field Types.
Date fields Date data type,
DateTime data type
General field size Now 4 bytes. See General Field Type.
Memo field size Now 4 bytes. See Memo Field Type.
Memo field with
NOCPTRANS characteristic
Memo (BINARY) field type. See Data and Field Types.
Numeric fields Currency data type,
Double field type, Float field type, Integer field type, or Numeric data type
OLE data in a General field OLE Bound control

Visual FoxPro tables can accept null values. To prevent errors generated by attempts to store null values to FoxPro 2.6 variables or to Visual FoxPro controls, initialize variables or arrays. To prevent users from attempting to store null values to tables, you can disable the NULL entry key combination by using the following statement:

ON KEY LABEL CTRL+0 *

The structure of Visual FoxPro project (.pjx), screen (.scx), report (.frx), menu (.mnx) and label (.lbx) files differ from the structure of FoxPro 2.6 files. For details on the structure of Visual FoxPro table files created in the Project Manager, Form Designer, Report Designer, and Label Designer, see Table Structures of Table Files. For details on changes made to converted and saved record files, see Checking Converted FoxPro 2.6 Reports and Labels.

Views in Visual FoxPro

Visual FoxPro allows you to use views as you would tables or queries. If you build a view in Visual FoxPro without qualifying the table name to a database, you’ll get an error when you try to modify the view in the View Designer. To ensure that you can use or modify views in all versions of Visual FoxPro, use CREATE SQL VIEW with the following clause:

   FROM testdata!products      && testdata is the database name
                              && products is the table name

When you specify the source this way, Visual FoxPro searches for the table both in the open database list, including the current and any non-current databases, and in the default search path for the table.

For more information on views, see  “Entering Null Values in Fields” in Chapter 7, Working with Tables, as well as Chapter 8, “Creating Views,” both in the Programmer’s Guide.