|
Working with dBase databases
From NeoWiki
Revision as of 06:11, 28 February 2009 (edit) Sardisson (Talk | contribs) (split from the misc db tips and polished some more; it's not great, but it's better) ← Previous diff |
Revision as of 06:37, 28 February 2009 (edit) (undo) Sardisson (Talk | contribs) m (s/datasource/data source/) Next diff → |
||
Line 1: | Line 1: | ||
- | It is possible to use your existing dBase database files (<code>.dbf</code>) with NeoOffice, either directly as a | + | It is possible to use your existing dBase database files (<code>.dbf</code>) with NeoOffice, either directly as a data source in [[NeoBase|Base]] or indirectly by importing the DBF file into [[NeoCalc|Calc]]. |
==Connecting to DBF files in NeoBase== | ==Connecting to DBF files in NeoBase== |
Revision as of 06:37, 28 February 2009
It is possible to use your existing dBase database files (.dbf
) with NeoOffice, either directly as a data source 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.
- Go to the File menu and choose New and then Database
- In the first pane of the Database Wizard, choose Connect to an Existing Database
- Set the drop-down to dBase
- Click Next>>
- In the next pane, click on the Browse button
- Navigate to the folder in which the
.dbf
files are found- You cannot choose a file, you must select a folder.
- Click Open
- Click Next>>
- In the Save and Proceed pane, select the settings as desired
- 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:
- Two options are described in Converting a Text String to a Number in Calc.
- You can also change the field setting in the DBF from C to N and re-import the file.
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.