TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: NATHAN SEELEY
from: STEVEN READ
date: 1997-07-22 07:33:00
subject: Dbase 1/2

On 07-08-97 (21:42) NATHAN SEELEY wrote to ALL
Nathan,
This message might end up in two parts.
NS>  I'm looking to find the file structures of dBASE 1.5 files.
You mean dBASE IV version 1.5.  Got it.
Also there is a C library for dBASE III/IV called BLTCxxx.ZIP where xxx
is 120, 125, 127, etc.  Search for the key words 'Bullet' and 'dBASE' if
you are using Internet. (forgive me for not posting a C++ library)
NS>  Since dBASE is the database standard, I assume this information
NS>  is freely available?? (I'm hoping!)
dBASE is/was the defacto standard for the DOS platform.  DB/2 or Oracle
are probably the 'standard' for mainframe systems.
NS>  Any information would be gladly accepted.
Your welcome.  Herein follows the database structure for dBASE IV 1.5,
and I hope that the columns stay intact.
========================================================================
   *==== dBASE IV v1.5 file structures  ====*
Taken from the Language Reference Manual, Appendix D
Structure of a Database (.dbf) File
Database Header and Records
A database (.dbf) file is composed of a header, data records, deletion
flags, and an end-of-file marker. The header contains information about
the file structure, and the records contain the actual data. One byte of
each record is reserved for the deletion flag.
Database Header Structure
The header structure, detailed in Tables D-1 and D-2, provides
information dBASE IV uses to maintain the database file.
                   Table D-1  Database file header
Byte      Contents      Description
0        1 byte        bits 0-2: dBase IV version number
                       bit    3: Presence of a dBASE IV memo file
                       bits 4-6: Reserved for SQL
                       bit    7: Presence of any memo file (either
                                 dBASE III PLUS or dBASE IV)
1-3      3 bytes       Date of last update: Formated as YYMMDD
4-7      32 bits       Number of records in the database file
8-9      16 bits       Number of bytes in the header
10-11    16 bits       Number of bytes in the record (including delete
                       delete flag)
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 byte        Production .mdx file flag; 01H if there is a
                       production .mdx file, 00H if not
29-31    3 bytes       Reserved; fill with zero
32-n *** 32 bytes each Field descriptor array (the structure of this
                       array is shown in table D-2
n+1      1 byte        0HD as a field terminator
 *   The ISMARKED() function checks this flag.
     BEGIN TRANSACTION sets it to 01,
     END TRANSACTION and ROLLBACK reset it to 00.
 **  If this flag is set to 01H, the message "Database Encrypted"
     appears. Changing this flag to 00H removes the message, but does
     not decrypt the file.
 *** 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.
                 Table D-2  Database field descriptor bytes
Byte     Contents      Description
1-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
(Continued to next message)
---
 * QMPro 1.53 * steven  read  pcohio  com
--- InterEcho 1.19
---------------
* Origin: PC-Ohio PCBoard * Cleveland, OH * 216-381-3320 (1:157/200)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.