Source language: Translate to:

NeoBookDB/dBase file format info

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

NeoBookDB/dBase file format info

Postby Dave Riley » Mon Jan 27, 2003 12:43 pm

Byte offset 0 in the .dbf file contains this information (it is in binary format ; so you need a Hex Editor to view it) ; I checked a few of my files and found that

- dbf files without a memo field contain value 0x03 (i.e. dBASE III PLUS)
- dbf files with a memo field contain value 0x8B (i.e. dBASE IV with memo)

If memory serves me well, the dbf part of files did not change from III PLUS to IV ; so, the answer to your question has to be dBASE IV

For the benefit of anyone interested in the dbf file header content, I have reproduced some information I found on the web.

Table Header Record Structure
Byte offsetDescription

0Type of file
0x02FoxBASE
0x03FoxBASE+/dBASE III PLUS, no memo
0x30Visual FoxPro
0x43dBASE IV SQL table files, no memo
0x63dBASE IV SQL system files, no memo
0x83FoxBASE+/dBASE III PLUS, with memo
0x8BdBASE IV with memo
0xCBdBASE IV SQL table files, with memo
0xF5FoxPro 2.x (or earlier) with memo
0xFBFoxBASE
1-3Last update (YYMMDD)
4-7Number of records in file
8-9Position of first data record
10-11Length of one data record (including delete flag)
12-27Reserved
28Table Flags
0x01file has a structural .CDX
0x02file has a Memo field
0x04file is a database (.DBC)
Note that this byte can contain the sum of
any of the above values. For example, 0x03
indicates the table has a structural .CDX
and a Memo field.
29Code page mark
30-31Reserved, contains 0x00
32-nField subrecords
The number of fields determines the number of field subrecords. There is one field subrecord for each field in the table.
n+1Header record terminator (0x0D)
n+2 to n+264A 263-byte range that contains the backlink information (the relative path of an associated database (.DBC)). If the first byte is 0x00 then the file is not associated with a database. Hence, database files themselves always contain 0x00.

1 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.

Field Subrecords Structure
Byte offsetDescription

0-10 Field name (maximum of 10 characters; if less than 10, it is padded with null character (0x00))
11Field Type:
C-Character
Y-Currency
N-Numeric
F-Float
D-Date
T-DateTime
B-Double
I-Integer
L-Logical
M-Memo
G-General
C-Character (binary)
M-Memo (binary)
P-Picture
12-15Displacement of field in record
16Length of field (in bytes)
17Number of decimal places
18Field Flags
0x01 System Column (not visible to user)
0x02Column can store null values
0x04Binary column (for CHAR and MEMO only)
19-32Reserved
Dave Riley
 

Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 1 guest