.dbf

Last updated
.dbf
.dbf File Extension.png
Filename extension
.dbf
Internet media type application/dbf, application/dbase
Developed by dBase
Initial release1983;41 years ago (1983)
Latest release
7
Website dbase.com

The .dbf file extension represents the dBase database file. The file type was introduced in 1983 with dBASE II. The file structure has evolved to include many features and capabilities. Several additional file types have been added, to support data storage and manipulation. The current .dbf file level is called Level 7. The .dbf format is supported by a number of database products.

Contents

Overview

The original dBASE database was known as Project Vulcan and was started by Wayne Ratliff in 1978. At the time the file that held the data was a simple table that could have data added, modified, deleted, or printed using the ASCII characters set. [1] As the product became more popular, the underlying file type .dbf was expanded, and additional files were added to increase the capabilities of the database system. Despite dBASE being an IDE (integrated development environment), a database system, a compiler, and a database application builder, the original .dbf file was still used for the actual data storage mechanism.

History of the file format

Classical .dbf

Project Vulcan – CP/M (Level 1)
There is no publicly available information on the original layout. What is known is that it was a simple table which allowed adding, deleting, modifying, and outputting ASCII data. It was written for 8-bit machines that ran CP/M.
dBASE II – MS-DOS (Level 2)
dBASE II was the first major release by Ashton-Tate. It had many advancements beyond the simple table structures of Project Vulcan. [2]
  • Still written for 8-bit computing
  • Increased the number of fields from 16 to 32
  • Introduced a SORT routine
  • 16-bit version finally released in April 1983 (version 2.4)
dBASE III – MSDOS (Level 2sh)
dBASE III (version "1.0"), was released in June 1984. This was a fully 16-bit application. dBASE III's file format is a transitional step between dBASE II and dBASE III+.

Modern dBASE

dBASE III+ – MS-DOS (Level 3)
dBASE III+ was released in December 1985. It ushered the modern dBASE file format. It is incompatible with dBASE III's file format. [3]
dBASE IV – MS-DOS (Level 4)
  • 1.0 x322 Oct 1988
  • 1.0 x55 Mar 1993 – dBASE Compiler
  • 2.0 x12 Oct 1993 Includes fixes in dBASE IV v2.0 x16 above (not x17 i.e. not VLM compatible, dB5D exe's are compatible). It's also a new version that contain new features not in the V1.0 product:
    • 32-bit generation
    • Auto compiling and linking
    • Smaller .EXE size
    • Menu-driven user interface
    • Linker can produce combined .DBO output
    • Linker can produce a .MAP file
    • Compiler supports alternate date formats
    • command-line switches accept wildcards in file names.
dBASE V – MS-DOS (Level 5)
1.0 x46 Jun 1994
BDE – Borland Database Engine 2.52

This was the last update to the 16-bit version of the Borland Database Engine (BDE). [4]

dBASE V – MS-Windows (Level 5)

xBase

xBase is a name applied to clones of the dBase, typically dBASE III+V. Most xBase programs either use the format directly or uses a derived format with custom extensions. Erik Bachmann maintains an open-licensed description of these formats. [5]

dBASE 7

The Level 7 structure is the latest supported by dBASE and BDE. It is incompatible with the previous file format, and is supported by few third-party applications. [6]

dBASE 7 – MS-Windows (Level 7)

Level 7 brought many improvements. The maximum length for field names increased from 10 to 31 characters. Some new fields types were added, such as the auto-increment field, [7] which prevents creation of duplicate record numbers in the same table.

BDE version 5.1.0

Significant improvements over the prior releases. [8] There are also some limitations with regards to what the BDE can handle. [9]

File format of Level 5 DOS dBASE

The "modern dBASE" III+V is the most common dBASE file format found in the wild. In "modern dBASE", a .dbf file consists of a header, the data records, and the end-of-file marker.

File header

Layout of file header in dBase level 5
ByteContentsMeaning
01 byteValid dBASE for DOS file; bits 0–2 indicate version number, bit 3 indicates the presence of a dBASE for DOS memo file, bits 4–6 indicate the presence of a SQL table, bit 7 indicates the presence of any memo file (either dBASE m PLUS or dBASE for DOS)
1–33 bytesDate of last update; formatted as YYMMDD (with YY being the number of years since 1900)
4–74 bytes (LE)Number of records in the database file
8–92 bytes (LE)Number of bytes in the header
10–112 bytes (LE)Number of bytes in the record
12–132 bytesReserved; fill with 0
141 byteFlag indicating incomplete transaction [note 1]
151 byteEncryption flag [note 2]
16–2712 bytesReserved for dBASE for DOS in a multi-user environment
281 byteProduction .mdx file flag; 1 if there is a production .mdx file, 0 if not
291 byteLanguage driver ID
30–312 bytesReserved; fill with 0
32–n [note 3] [note 4] 32 bytes eacharray of field descriptors (see below for layout of descriptors)
n + 11 byte0x0D as the field descriptor array terminator
  1. The ISMARKEDO function checks this flag. BEGIN TRANSACTION sets it to 1, END TRANSACTION and ROLLBACK reset it to 0.
  2. If this flag is set to 1, the message Database encrypted appears. Changing this flag to 0 removes the message, but does not decrypt the file.
  3. The maximum number of fields is 255.
  4. n means the last byte in the field descriptor array. The array's size depends on the number of fields used in a database. n is equal to 31 + 32 * (number of fields).

Field descriptor array

Layout of field descriptors in dBase level 5 (used inside the file header)
ByteContentsMeaning
0–1011 bytesField name in ASCII (zero-filled)
111 byteField type. Allowed values: C, D, F, L, M, or N (see next table for meanings)
12–154 bytesReserved
161 byteField length in binary (maximum 254 (0xFE)).
171 byteField decimal count in binary
18–192 bytesWork area ID
201 byteExample
21–3010 bytesReserved
311 byteProduction MDX field flag; 1 if field has an index tag in the production MDX file, 0 if not

    Database records

    Each record begins with a 1-byte "deletion" flag. The byte's value is a space (0x20), if the record is active, or an asterisk (0x2A), if the record is deleted. Fields are packed into records without field separators or record terminators.

    All field data is ASCII. Depending on the field's type, the application imposes further restrictions:

    Field types in dBase level 5
    Field typeMnemonicWhat it accepts
    CCharacterAny ASCII text (padded with spaces up to the field's length)
    DDateNumbers and a character to separate month, day, and year (stored internally as 8 digits in YYYYMMDD format)
    FFloating point-, ., 09 (right justified, padded with whitespaces)
    LLogicalY, y, N, n, T, t, F, f, or ? (when uninitialized)
    MMemoAny ASCII text (stored internally as 10 digits representing a .dbt block number, right justified, padded with whitespaces)
    NNumeric-, ., 09 (right justified, padded with whitespaces)

    Memo fields and the .DBT file

    A memo (.DBT) file consists of blocks numbered sequentially (0,1,2, and so on). SET BLOCKSIZE determines the size of each block. The first block, block 0, is the memo file header.

    Each memo field of each record in the .DBF file contains the number of the block (in ASCII) where the memo field begins. If the memo field contains no data, the .DBF file contains blanks (0x20) rather than a number.

    When a memo field's content changes, its block number may also change. I.e. the memo gets relocated. In that case, the number in the .DBF file gets updated.

    In dBASE III PLUS, the space consumed by deleted text in a memo field cannot be reused the .DBT file size grows each time text is added, even if other text has been deleted. dBASE for DOS may reuse that space for new text. dBASE IQ PLUS always appended new text to the end of the .dbt file.

    Other file types found in dBASE

    dBASE defines many types of files. It also recognizes some operating system files and files from other products. The table below lists the most commonly used formats first. It was compiled from the documentation of dBASE III+, dBASE IV, and dBASE CLASSIC. [10]

    File types recognized by dBASE, up to dBASE CLASSIC
    ExtensionFile content
    .DBFDatabase file
    .DBKDatabase backup file
    .DBOCommand and procedure object file
    .DBTDatabase memo file
    .DEFSelector definition file
    .DEMDefine statements for a CUA form
    .DIFData Interchange Format, or VisiCalc file; used with APPEND FROM and COPY TO
    .DOCDocumentation file; Applications Generator only
    .ERRCreated if an error occurs during form generation, or if an unrecoverable error occurs
    .FILFiles list design object file
    .EMOCompiled format (.fmt) file
    .FMTGenerated format file; from .scr file
    .FNLReport binary name list file
    .FR3Renamed old dBASE HI report form (.frm) file
    .ERGGenerated report form file; from .frm file
    .FRMReport form file
    .FROCompiled report form (.ERG) file
    .FW2, .FW3, .FW4Framework spreadsheet or database file; used for import and export
    .GENTemplate file
    .GRPWindows group file for dBASE for DOS
    .HLPdBASE for DOS help files
    .ICOdBASE for DOS icon file under Windows
    .INIWindows-like INI file to save Label Designer and IDE state information.
    .KEYKeystroke macro library file
    .LB3Renamed old dBASE III label form (.LBL) file
    .LBGGenerated label form file; from .LBL file
    .LBLLabel form file
    .LBOCompiled label form (.LBL) file
    .LOGTransaction log file
    .LNLLabel binary name list file
    .MBKMultiple index backup file
    .MDXMultiple index file
    .MEMMemory file
    .NDXSingle index file
    .OVLdBASE for DOS overlay file
    PIFMicrosoft Windows file for non-Windows applications
    .POPPop-up menu design object file; Applications Generator only
    .PR2Printer driver file
    .PRDA file containing printer driver information for DBSETUP
    .PRFPrint form file
    .PRGdBASE command or procedure file
    .PRSdBASE SQL command or procedure file
    .PRTPrinter output file
    .QBEQBE query file
    .QBOCompiled QBE query (.QBE) file
    .QRYdBASE El query file
    .RESResource file
    .RPDRapidFile file; used for import and export
    .SC3Renamed old dBASE III screen (.SCR) file
    .SCRScreen file
    .SNLScreen binary name list file
    .STRStructure list design object file; Applications Generator only
    .T44/.W44Intermediate work files; used by SORT and INDEX
    .TBKDatabase memo backup file
    .TXTASCII text output file
    .UPDQBE update query file
    .UPOCompiled QBE update query (.UPD) file
    .VALValues list design object file; Applications Generator only
    .VMCConfiguration file; for Virtual Memory Manager (VMM)
    .VUEView file
    .WINLogical window save file
    .WKS, .WK1Lotus 1-2-3 file; used with APPEND FROM and COPY TO

    See also

    Related Research Articles

    File Allocation Table (FAT) is a file system developed for personal computers and was the default filesystem for MS-DOS and Windows 9x operating systems. Originally developed in 1977 for use on floppy disks, it was adapted for use on hard disks and other devices. The increase in disk drives capacity required four major variants: FAT12, FAT16, FAT32, and ExFAT. FAT was replaced with NTFS as the default file system on Microsoft operating systems starting with Windows XP. Nevertheless, FAT continues to be used on flash and other solid-state memory cards and modules, many portable and embedded devices because of its compatibility and ease of implementation.

    A text file is a kind of computer file that is structured as a sequence of lines of electronic text. A text file exists stored as data within a computer file system.

    dBase was one of the first database management systems for microcomputers and the most successful in its day. The dBase system included the core database engine, a query system, a forms engine, and a programming language that tied all of these components together.

    Clipper is an xBase compiler that implements a variant of the xBase computer programming language. It is used to create or extend software programs that originally operated primarily under MS-DOS. Although it is a powerful general-purpose programming language, it was primarily used to create database/business programs.

    <span class="mw-page-title-main">Comma-separated values</span> File format used to store data

    Comma-separated values (CSV) is a text file format that uses commas to separate values, and newlines to separate records. A CSV file stores tabular data in plain text, where each line of the file typically represents one data record. Each record consists of the same number of fields, and these are separated by commas in the CSV file. If the field delimiter itself may appear within a field, fields can be surrounded with quotation marks.

    For Microsoft Windows, OS/2, and DOS, .exe is the filename extension that denotes a file as being executable – a computer program – containing an entry point.

    A fat binary is a computer executable program or library which has been expanded with code native to multiple instruction sets which can consequently be run on multiple processor types. This results in a file larger than a normal one-architecture binary file, thus the name.

    <span class="mw-page-title-main">Binary file</span> Non-human-readable computer file encoded in binary form

    A binary file is a computer file that is not a text file. The term "binary file" is often used as a term meaning "non-text file". Many binary file formats contain parts that can be interpreted as text; for example, some computer document files containing formatted text, such as older Microsoft Word document files, contain the text of the document but also contain formatting information in binary form.

    A FourCC is a sequence of four bytes used to uniquely identify data formats. It originated from the OSType or ResType metadata system used in classic Mac OS and was adopted for the Amiga/Electronic Arts Interchange File Format and derivatives. The idea was later reused to identify compressed data types in QuickTime and DirectShow.

    A hex editor is a computer program that allows for manipulation of the fundamental binary data that constitutes a computer file. The name 'hex' comes from 'hexadecimal', a standard numerical format for representing binary data. A typical computer file occupies multiple areas on the storage medium, whose contents are combined to form the file. Hex editors that are designed to parse and edit sector data from the physical segments of floppy or hard disks are sometimes called sector editors or disk editors.

    Netpbm is an open-source package of graphics programs and a programming library. It is used mainly in the Unix world, where one can find it included in all major open-source operating system distributions, but also works on Microsoft Windows, macOS, and other operating systems.

    The Access Database Engine is a database engine on which several Microsoft products have been built. The first version of Jet was developed in 1992, consisting of three modules which could be used to manipulate a database.

    <span class="mw-page-title-main">VP-Info</span>

    VP-Info is a database language and compiler for the personal computer. VP-Info was a competitor to the Clipper and dBase applications in the late 1980s and 1990s. VP-Info was originally intended to run on MS-DOS, DR-DOS and the PC-MOS/386 operating system, but now is run on the vDOS, or DOSbox-X, emulators. The last release of VP-Info, a multi-tasking, multi-user version released in 1992 with a built-in compiler, and was named SharkBase, or simply "Shark".

    <span class="mw-page-title-main">Shapefile</span> Geospatial vector data format

    The shapefile format is a geospatial vector data format for geographic information system (GIS) software. It is developed and regulated by Esri as a mostly open specification for data interoperability among Esri and other GIS software products. The shapefile format can spatially describe vector features: points, lines, and polygons, representing, for example, water wells, rivers, and lakes. Each item usually has attributes that describe it, such as name or temperature.

    Intel hexadecimal object file format, Intel hex format or Intellec Hex is a file format that conveys binary information in ASCII text form, making it possible to store on non-binary media such as paper tape, punch cards, etc., to display on text terminals or be printed on line-oriented printers. The format is commonly used for programming microcontrollers, EPROMs, and other types of programmable logic devices and hardware emulators. In a typical application, a compiler or assembler converts a program's source code to machine code and outputs it into a object or executable file in hexadecimal format. In some applications, the Intel hex format is also used as a container format holding packets of stream data. Common file extensions used for the resulting files are .HEX or .H86. The HEX file is then read by a programmer to write the machine code into a PROM or is transferred to the target system for loading and execution. There are various tools to convert files between hexadecimal and binary format, and vice versa.

    The DOS MZ executable format is the executable file format used for .EXE files in DOS.

    <span class="mw-page-title-main">SREC (file format)</span> File format developed by Motorola

    Motorola S-record is a file format, created by Motorola in the mid-1970s, that conveys binary information as hex values in ASCII text form. This file format may also be known as SRECORD, SREC, S19, S28, S37. It is commonly used for programming flash memory in microcontrollers, EPROMs, EEPROMs, and other types of programmable logic devices. In a typical application, a compiler or assembler converts a program's source code to machine code and outputs it into a HEX file. The HEX file is then imported by a programmer to "burn" the machine code into non-volatile memory, or is transferred to the target system for loading and execution.

    The FAT file system is a file system used on MS-DOS and Windows 9x family of operating systems. It continues to be used on mobile devices and embedded systems, and thus is a well-suited file system for data exchange between computers and devices of almost any type and age from 1981 through to the present.

    The GOFF specification was developed for IBM's MVS operating system to supersede the IBM OS/360 Object File Format to compensate for weaknesses in the older format.

    The Esri TIN format is a popular yet proprietary geospatial vector data format for geographic information system (GIS) software for storing elevation data as a triangulated irregular network. It is developed and regulated by Esri, US. The Esri TIN format can spatially describe elevation information including breaking edge features. Each points and triangle can carry a tag information. A TIN stored in this file format can have any shape, cover multiple regions and contain holes.

    References

    1. Powell, David B. (1984-02-07). "From Basement To Boardroom". PC Magazine. p. 131. Retrieved 24 October 2013.
    2. Powell, David B. (1984-02-07). "From Basement to Boardroom". PC Magazine : 131–135. Retrieved 2014-08-15.
    3. "dBASE Table File Format (DBF)". Digitalpreservation.gov. 8 October 2012. Retrieved 2014-08-15.
    4. "dBASE Documentation Download - dBase, LLC". Dbase.com . Retrieved 2014-08-15.
    5. Bachmann, Erik. "Xbase Data file (*.dbf)". www.clicketyclick.dk.
    6. "dBASE .DBF File Structure". Dbase.com. Retrieved 2014-08-15.
    7. Jean-Pierre Martel. "AutoIncrement Fields". Dbase.com. Retrieved 2014-08-15.
    8. Jean-Pierre Martel. "New BDE 5.1.0 and Visual dBASE 7.01". Dbase.com. Retrieved 2014-08-15.
    9. "DBase Plus Help 8".
    10. "dBASE Classic". dBASE Classic. Retrieved 2014-08-15.

    Further reading