dbf-structure
Differences
This shows you the differences between two versions of the page.
dbf-structure [2016/04/15 07:12] – created dbfmanager | dbf-structure [2016/04/15 10:27] (current) – dbfmanager | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== DBF structure ====== | ||
+ | A table file consists of a header record and data records. The header record defines the structure of the table and contains any other information related to the table. The header record starts at file position zero. Data records follow the header, in consecutive bytes, and contain the actual text of the fields. | ||
+ | |||
+ | Note: The data in the data file starts at the position indicated in bytes 8 to 9 of the header record. Data records begin with a delete flag byte. If this byte is an ASCII space (0x20), the record is not deleted. If the first byte is an asterisk (0x2A), the record is deleted. The data from the fields named in the field subrecords follows the delete flag. | ||
+ | |||
+ | The length of a record, in bytes, is determined by summing the defined lengths of all fields. Integers in table files are stored with the least significant byte first | ||
+ | |||
+ | **Table Header Record Structure** | ||
+ | |||
+ | ^ Byte offset | ||
+ | | 0 | File type:\\ 0x02 | ||
+ | |1 - 3 | Last update (YYMMDD) | | ||
+ | |4 – 7 | Number of records in file | | ||
+ | |8 – 9 | Position of first data record | | ||
+ | |10 – 11 | Length of one data record, including delete flag | | ||
+ | |12 – 13 | Reserved | | ||
+ | |14 | Incomplete transaction/ | ||
+ | |15 | Encryption flag | | ||
+ | |16 – 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 | Header record terminator (0x0D) | | ||
+ | |||
+ | **Field Subrecords Structure** | ||
+ | |||
+ | ^ Byte offset | ||
+ | | 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 | ||
+ | |12 – 15| Displacement of field in record | | ||
+ | |16| Number of decimal places | | ||
+ | |18| Field flags:\\ 0x01 | ||
+ | |19 - 22| Value of autoincrement Next value | | ||
+ | |23| Value of autoincrement Step value | | ||
+ | |24 – 31| Reserved | |
dbf-structure.txt · Last modified: 2016/04/15 10:27 by dbfmanager