Working with dBase databases

From NeoWiki

(Difference between revisions)
Jump to: navigation, search

Sardisson (Talk | contribs)
(split from the misc db tips and polished some more; it's not great, but it's better)
Next diff →

Revision as of 06:11, 28 February 2009

It is possible to use your existing dBase database files (.dbf) with NeoOffice, either directly as a datasource in Base or indirectly by importing the DBF file into Calc.

Connecting to DBF files in NeoBase

You can use Base to connect to one or more DBF files.

  1. Go to the File menu and choose New and then Database
  2. In the first pane of the Database Wizard, choose Connect to an Existing Database
  3. Set the drop-down to dBase
  4. Click Next>>
  5. In the next pane, click on the Browse button
  6. Navigate to the folder in which the .dbf files are found
    • You cannot choose a file, you must select a folder.
  7. Click Open
  8. Click Next>>
  9. In the Save and Proceed pane, select the settings as desired
  10. Click on Finish

Importing a DBF file into Calc

When importing a DBF file into Calc, you may experience a problem where numeric values are converted into text characters.

The table structure of the DBF file says all the fields containing leading apostrophes are text characters. This can easily seen if you import the DBF file and look at the first row. Each column has a header defining its data type; C is for characters (text), whereas N is for numeric (values).

So Calc imports any numbers in columns with C headers correctly (according to what the dBase file has specified) as text characters. Since the number format for the default Calc template is set to Number, an apostrophe is placed in front of this imported value to ensure it is treated as Text instead.

To change such text values to real numeric values, you have several choices:

Issues with DB2K files

Older DBF files in the DB2K format are not compatible with NeoOffice or OpenOffice.org. When a connection is made to the file, most fields will show <OBJECT> for data in Base and #N/A in Calc. If you have a Windows machine available, the solution is to use the dbf-converter program to convert these files to dBase-IV format, which NeoOffice does support.


This article in other languages: Français
Personal tools