Field types
Each field has a defined field type, which determines the kind of information it can store. For example, a character field accepts all printable characters including spaces. You can define up to 1,024 fields in a table.
A dBASE (.DBF) table can contain the following field types.
Field type |
Default size |
Maximum size |
Index allowed? |
Allowable values |
Character |
10 characters |
254 characters |
Yes |
All keyboard characters |
Numeric |
10 digits, |
20 digits |
Yes |
Positive or negative numbers |
Float |
10 digits, |
20 digits |
Yes |
Positive or negative numbers. Identical to Numeric; maintained for compatibility. |
Long |
4 bytes |
N/A |
Yes |
Signed 32 bit integer, range approximately +/-2 billion. Optimized for speed. |
Double |
8 bytes |
N/A |
Yes |
Positive or negative number. Optimized for speed. |
AutoIncrement |
4 bytes |
N/A |
Yes |
Contains long integer values in a read-only (non-editable) field, beginning with the number 1 and automatically incrementing up to approximately 2 billion. Deleting a row does not change the field values of other rows. Be aware that adding an autoincrement field will pack the table. |
Date |
8 bytes |
N/A |
Yes |
Any date from AD 1 to AD 9999 |
TimeStamp |
8 bytes |
N/A |
Yes |
Date/Time stamp, including the Date format plus hours, minutes, and seconds, such as HH:MM:SS |
Logical |
1 byte |
N/A |
No |
True (T, t), false (F, f), yes (Y, y), and no (N, n) |
Memo |
10 bytes |
N/A |
No |
Usually just text, but all keyboard characters; can contain binary data (but using binary field is preferred) |
Binary |
10 bytes |
N/A |
No |
Binary files (sound and image data, for example) |
OLE |
10 bytes |
N/A |
No |
OLE objects from other Windows applications |
The field type determines what you can do with the information in the field. For example, you can perform mathematical calculations on values in a numeric field, but not on values in a logical field.
The field type also determines how the data appears in the field. For example, a date field, by default, displays dates in the MM/DD/YY format (such as 02/14/96). The display of field data is also affected by the settings of the Windows control panel and the settings defined by using the BDE Administrator.
Other table types, such as SQL tables, may have different field types. Refer to your server documentation for specific details.