.dbf

The .dbf file extension represents the dBase database file. The file type was introduced in 1983 with the introduction of dBASE II. The file structure has evolved over the years to include many more features and capabilities and has introduced various other files to help 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.

.dbf
Filename extension
.dbf
Developed bydBase
Initial release1983 (1983)
Latest release
7
Websitedbase.com

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.

File architecture overview

Project Vulcan (Level 1) There are no public records on the exact layout of the file the best information at this time is that it was a simple table that allows for adding, deleting, modifying, and printing out ASCII information. It was designed to run on 8-bit machine running CP/M.

dBASE II – MS-DOS (Level 2) was the first major release of Ashton-Tate and offered many advancements above and beyond the simple table structure of the original tables found in 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) was now completely focused on 16-bit operations and was introduced in 1.0 was released in June 1984. The underlying dBASE database was still based on an intermediate version of the dBASE II file format. The dBASE III file format is not compatible with the dBASE III+ format.

dBASE III+ – MS-DOS (Level 3) this starts the modern era of dBASE .dbf files. The dBASE III+ was introduced in December 1985 when the product was released.

  • 16-bit version finally released in April 1983 version 2.4

Structure layout of the file type:[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 driver user interface
    • Linker can produce combined .DBO output
    • Linker can produce a .MAP file
    • Compiler supports alternate date formats
    • Support for wildcard character in file names used with command-line switches.

dBASE V – MS-DOS (Level 5)

  • 1.0 x46 Jun 1994

BDE – Borland Database Engine 2.52

This is the last update to the 16-bit version of the Borland Database Engine (BDE). Download and unzip to a temporary folder, and run the SETUP program.[4]

dBASE V – MS-Windows (Level 5)

  • 5.5 b673 Jul 1995

Level 5 DOS headers

While dBASE has been around for many years, the files themselves seem to be shrouded in mystery. Below is the structure of a database (.dbf) file for dBASE V for MS-DOS.

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 Table D.l and Table D.2, provides information dBASE for DOS uses to maintain the database file.

Database file header
ByteContentsMeaning
0 1 byte Valid 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–3 3 bytes Date of last update; formatted as YYMMDD
4–7 32-bit number Number of records in the database 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[note 1]
15 1 byte Encryption flag[note 2]
16–27 12 bytes Reserved for dBASE for DOS in a multi-user environment
28 1 byte Production .mdx file flag; 0x01 if there is a production .mdx file, 0x00 if not
29 1 byte Language driver ID
30–31 2 bytes Reserved; fill with 0
32–n[note 3][note 4] 32 bytes each Field descriptor array (the structure of this array is shown in Table Database field descriptor bytes)
n +1 1 byte 0x0D 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. 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. n is equal to 31 + 32 * (the number of fields).
  4. The maximum number of fields is 255.
Database field descriptor bytes
ByteContentsMeaning
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[note 1]
17 1 byte Field decimal count in binary
18–19 2 bytes Work area ID
20 1 byte Example
21–30 10 bytes Reserved
31 1 byte Production MDX field flag; 1 if field has an index tag in the production MDX file, 0 if not
  1. The maximum length of a field is 254 (0xFE).

Database records

The records follow the header in the database file. Data records are preceded by one byte: a space (0x20) if the record is not deleted, or an asterisk (0x2A) 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 0x1A.

You can input ASCII data as indicated in the following table.

Allowable input for each data type
Data typeWhat it accepts
C (Character) All ASCII characters (padded with whitespaces up to the field's length)
D (Date) Numbers and a character to separate month, day, and year (stored internally as 8 digits in YYYYMMDD format)
F (Floating point) -.0123456789 (right justified, padded with whitespaces)
L (Logical) YyNnTtFf? (? when not initialized)
M (Memo) All ASCII characters (stored internally as 10 digits representing a .dbt block number, right justified, padded with whitespaces)
N (Numeric) -.0123456789 (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 in the memo file, 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 data is changed in a memo field, the block numbers may also change, and the number in the .DBF may be changed to reflect the new location.

Unlike dBASE III PLUS, if you delete text in a memo field, dBASE for DOS may reuse the space from the deleted text when you input new text. dBASE IQ PLUS always appended new text to the end of the .dbt file. In dBASE III PLUS, the .DBT file size grew whenever new text was added, even if other text in the file was deleted.

dBASE 7 – MS-Windows (Level 7)

  • 7.0 b1345 Dec 1997 Full 32 bit version for Win 95/NT

Level 7 tables

Level 7 brought many improvements. The field names can have up to 31 characters (from a maximum of 10 before). Some new fields types have appeared (for example, the auto-increment field[5] that makes nearly impossible to give the same number to two records in the same table). If your tables have to be used by other software, you might have to sacrifice these advantages for the sake of compatibility, as few applications can use a level 7 table.

Level 7 structure

The Level 7 structure is the latest supported by dBASE and BDE.[6]

BDE version 5.1.0

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

Other file types found in dBASE

There are many file types or files that have extensions that can be used by dBASE. The following list is presented in the order of use. This is a combination list of files that are related to dBASE and is compiled from the dBASE III+, dBASE IV, and dBASE CLASSIC documentation.[9]

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

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. Retrieved 2014-08-15.
  4. "dBASE Documentation Download - dBase, LLC". Dbase.com. Retrieved 2014-08-15.
  5. Jean-Pierre Martel. "AutoIncrement Fields". Dbase.com. Retrieved 2014-08-15.
  6. "dBASE .DBF File Structure". Dbase.com. Retrieved 2014-08-15.
  7. Jean-Pierre Martel. "New BDE 5.1.0 and Visual dBASE 7.01". Dbase.com. Retrieved 2014-08-15.
  8. "dBASE Classic". dBASE Classic. Retrieved 2014-08-15.

Further reading

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.