DBF, dBase / FoxPro

DBF format is a very old, database format originally introduced by dBase II, recycled by FoxPro and used as a database component by ESRI shapefiles.  In addition to the ubiquitous use of DBF within shapefiles, popular for many years within ESRI products and open source such as QGIS, surprisingly many data sets have been published using DBF format.   We suppose the authors found that slightly better than using cuneiform marks on clay tablets.

 

Most applications use libraries like JET or others to read DBF.   Manifold uses a specialized DBF driver written by Manifold, originally developed to automatically handle the many variations of DBF encountered within shapefiles.   Manifold, therefore, can read or link DBF files either from 64-bit Manifold or 32-bit Manifold.

 

Manifold can import from DBF, link read/write to DBF, and export tables to DBF.

Import

Important: When importing a DBF file the tables and queries that appear in the Manifold project are Manifold components with no further connection to the DBF file from which they were imported.  

 

To import from DBF format:

 

  1. Choose File-Import from the main menu.

  2. In the Import dialog browse to the folder containing the .dbf file.

  3. Double-click the .dbf file desired.

  4. Everything found in that .dbf database will be imported into the project.

 

dlg_import_dbf.png

 

Double-clicking on the desired .dbf file in the Import dialog as seen above will import into our project everything found in that .dbf database.    

 

dlg_import_dbf_project.png

 

This particular .dbf database contains a single table.  

 

dlg_import_dbf_table.png

 

The world table contains the locations for various towns and airports, including their latitude and longitude locations.   DBF is an extremely old and limited database format, with a very poor set data types.   Manifold will capture whatever there is in the DBF.   The Manifold DBF driver automatically adds an mfd_id field and mfd_id_x index to the table's schema, so the resulting tables are fully editable and selectable.

Linking a DBF

Important: When linking a DBF file the tables and queries that appear in that data source in the Manifold project stay resident in the DBF file.   They are DBF components even though they may appear in many respects, for the convenience of the user, to be Manifold components.   DBF files linked into a Manifold project are fully read/write.

 

To link a DBF format file:

 

  1. Choose File-Link from the main menu.

  2. In the Link dialog browse to the folder containing the .dbf file.

  3. Click the .dbf file desired.

  4. Check or uncheck the Save cache box as desired.

  5. Press Link.  A linked data source will appear in the project.

  6. Press the + icon next to the data source to expand the data source to see the tables and queries it contains.

 

 

dlg_link_dbf.png

 

The Save cache  button allows setting cache options.   Most often when linking to a format like DBF, we will ensure the Save cached box is not checked.  Working with a linked DBF database will be faster if we check the box, but if we are going to cache data within the project we may as well simply import the DBF and use full Manifold speed.   We uncheck the box and then we press Link.

 

dlg_link_dbf_project.png

 

That creates a data source called world that contains all of the tables and any other contents of the .dbf file's database.   We can click on the + icon by the data source cylinder to expand the world hierarchy.

 

dlg_link_dbf_table.png

 

Opening the world table we see it is the same table that was imported earlier in this topic.    Since it is linked the table is now resident in the .dbf file.

 

Notes

Import - Because DBF is such a limited format it is not a great idea to leave data in a DBF file unless we are forced to do that, for example, to allow continued interchange with older applications that insist upon using DBF.   If all we want to do is to harvest data from a DBF it is a better idea to import data from the DBF and to save that data in a Manifold .map format file.

 

See Also

Editing Tables

 

Selection

 

File - Create - New Data Source

 

DBMS Data Sources - Notes

 

SHP, Shapefiles