INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Reference

DBF table structure by rob444
Posted: 25 Oct 03 (Edited 2 Sep 10)

*****************************************************************************************
* Table Header Record Structure
* Byte offset   Description
*  0            File type:
*                 0x02   FoxBASE
*                 0x03   FoxBASE+/Dbase III plus, no memo
*                 0x30   Visual FoxPro
*                 0x31   Visual FoxPro, autoincrement enabled
*                 0x32   Visual FoxPro, Varchar, Varbinary, or Blob-enabled
*                 0x43   dBASE IV SQL table files, no memo
*                 0x63   dBASE IV SQL system files, no memo
*                 0x83   FoxBASE+/dBASE III PLUS, with memo
*                 0x8B   dBASE IV with memo
*                 0xCB   dBASE IV SQL table files, with memo
*                 0xF5   FoxPro 2.x (or earlier) with memo
*                 0xFB   FoxBASE
*  1 - 3        Last update (YYMMDD)
*  4 - 7        Number of records in file
*  8 - 9        Position of first data record
*               Please note that the position of the first data record is a number where 0 is the fist byte, so for use with (V)FP  
*               1 should be added to this number
* 10 - 11       Length of one data record, including delete flag
* 12 - 27       Reserved
* 28            Table flags:
*                 0x01   file has a structural .cdx
*                 0x02   file has a Memo field
*                 0x04   file is a database (.dbc)
*     This byte can contain the sum of any of the above values. For example, the value 0x03 indicates
*     the table has a structural .cdx and a Memo field.
* 29            Code page mark
* 30 - 31       Reserved, contains 0x00
* 32 - n        Field subrecords, see Field Subrecords Structure below
*     The number of fields determines the number of field subrecords. One field subrecord exists for
*     each field in the table.
* n+1           Header record terminator (0x0D)
*      The following is only true for Visual Foxpro tables.
* n+2 to n+264  A 263-byte range that contains the backlink, which is the relative path of an associated
*               database (.dbc) file, information. If the first *byte is 0x00, the file is not associated
*               with a database. Therefore, database files always contain 0x00.
******************************************************************************************
* Field Subrecords Structure
* Byte offset   Description
* 0 - 10        Field name with a maximum of 10 characters. If less than 10,
*               it is padded with null characters (0x00).
* 11            Field type:
*                 C   –   Character
*                 C   –   Character (binary)  Visual Foxpro
*                 Y   –   Currency                Visual Foxpro
*                 D   –   Date
*                 T   –   DateTime               Visual Foxpro
*                 B   –   Double                   Visual Foxpro
*                 F   –   Float                      Visual Foxpro
*                 G   –   General                  Visual Foxpro
*                 I   –   Integer                    Visual Foxpro
*                 L   –   Logical
*                 M   –   Memo
*                 M   –   Memo (binary)       Visual Foxpro
*                 N   –   Numeric                 Visual Foxpro
*                 P   –   Picture                   Visual Foxpro
*                 Q   -   Varbinary               Visual Foxpro 9+
*                 V   -   Varchar (binary)      Visual Foxpro 9+
* 12 - 15       Displacement of field in record
* 16            Length of field (in bytes)
* 17            Number of decimal places
* 18            Field flags:                   Visual Foxpro
*                 0x01   System Column (not visible to user)
*                 0x02   Column can store null values
*                 0x04   Binary column (for CHAR and MEMO only)
*                 0x06   (0x02+0x04) When a field is NULL and binary (Integer, Currency, and Character/Memo fields)
*                 0x0C   Column is autoincrementing
* 19 - 22       Value of autoincrement Next value        Visual Foxpro 8 and higher
* 23            Value of autoincrement Step value        Visual Foxpro 8 and higher
* 24 - 31       Reserved
*
**************************************************************************************        
*                                                                                    *
* In (Visual) Foxpro arrays start with 1 so add 1 to the numbers                     *
* in the structure info above in order to get the info with (Visual) Foxpro programs *
* So the first 32 bytes contain the info                                             *  
* Each field adds another 32 bytes to the header                                     *  
*                                                                                    *
**************************************************************************************

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close