Article 18999 of comp.databases:
Xref: ig.co.uk comp.databases:18999 alt.msdos.programmer:1555
Newsgroups: comp.databases,alt.msdos.programmer,comp.msdos.programmer,comp.sys.ibm.pc.programmer
Path: ig.co.uk!demon!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!news.umbc.edu!eff!news.kei.com!world!decwrl!borland.com!genghis!koterski
From: koterski@genghis (Steve Koterski)
Subject: Re: Need DBASE IV file format
Message-ID: <CyK0x9.3Co@borland.com>
Followup-To: comp.databases,alt.msdos.programmer,comp.msdos.programmer,comp.sys.ibm.pc.programmer
Sender: news@borland.com (News Admin)
Organization: Borland International, Scotts Valley, California
X-Newsreader: TIN [version 1.2 PL2]
References: <CyCFGs.8LM@cid.aes.doe.ca>
Date: Mon, 31 Oct 1994 20:29:32 GMT
Lines: 84

Mark J Visser (mvisser@cmita10.dow.on.doe.ca) wrote:
: Anyone have a description of the DBASE IV .DBF file, or point me to somewhere that
: does?

The header for a dBASE IV 2.0 table file is comprised of the following
structure:

Byte	Contents	Meaning
------- ----------      -------------------------------------------------
0	1byte		Valid dBASE IV file; bits 0-2 indicate version
			number, bit 3 the presence of a dBASE IV memo
			file, bits 4-6 the presence of an SQL table, bit
			7 the presence of any memo file (either dBASE III
			PLUS or dBASE IV).

1-3	3 bytes		Date of last update; formattted as YYMMDD.

4-7	32-bit number	Number of records in the file.

8-9	16-bit number	Number of bytes in the header.

10-11	16-bit number	Number of bytes in the record.

12-13	2 bytes		Reserved; fill with 0.

14	1 byte		Flag indicating incomplete transaction.

15	1 byte		Encryption flag.

16-27	12 bytes	Reserved for dBASE IV in a multi-user environment.

28	1 bytes		Production MDX file flag; 01H if there is an MDX,
			00H if not.

29	1 byte		Language driver ID.

30-31	2 bytes		Reserved; fill with 0.

32-n*	32 bytes each	Field descriptor array (see below).

n + 1	1 byte		0DH as the field terminator.

* n is the last byte in the field descriptor array. The size of the array
depends on the number of fields in the database file.

The field descriptor array is as follows:

Byte	Contents	Meaning
------- --------------- --------------------------------------------------
0-10	11 bytes	Field name in ASCII (zero-filled).

11	1 byte		Field type in ASCII (C, D, F, L, M, or N).

12-15	4 bytes		Reserved.

16	1 byte		Field length in binary.

17	1 byte		Field decimal count in binary.

18-19	2 bytes		Reserved.

20	1 byte		Work area ID.

21-30	10 bytes	Reserved.

31	1 byte		Production MDX field flag; 01H if field has an 
			index tag in the production MDX file, 00H if not.

Database records:

The records follow the header in the database file. Data records are
preceded by one byte; that is, a space (20H) if the record is not deleted,
an asterisk (2AH) if the record is deleted. Fields are packed into
records without field separators or record terminators. The end of the file
is marked by a single byte, with the end-of-file marker an ASCII 26 (1AH)
character.

This information is from the dBASE IV Language Reference manual.

--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Steve Koterski               _/   The opinions expressed here are    _/
_/ koterski@borland.com         _/         exclusively my own           _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


