Working with dBase databases

From NeoWiki

(Difference between revisions)
Jump to: navigation, search
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
Current revision (05:44, 20 May 2014) (edit) (undo)
Sardisson (Talk | contribs)
(add patrick's info about using dBase with NeoSE)
 
(One intermediate revision not shown.)
Line 1: Line 1:
-It is possible to use your existing dBase database files (<code>.dbf</code>) with NeoOffice, either directly as a datasource in [[NeoBase|Base]] or indirectly by importing the DBF file into [[NeoCalc|Calc]].+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==
Line 14: Line 14:
#In the {{Section|Save and Proceed}} pane, select the settings as desired #In the {{Section|Save and Proceed}} pane, select the settings as desired
#Click on {{Button|Finish}} #Click on {{Button|Finish}}
 +
 +==Creating a dBase database with NeoOffice Secure Edition==
 +
 +To create a dBase database in Base with NeoOffice Secure Edition (NeoOffice 2013/2014), you only need to do either of the following:
 +
 +# Select the {{prefName|Create new database}} radio button in the {{window|Database Wizard}} dialog as shown in [https://trinity.neooffice.org/modules.php?name=Forums&file=download&id=1312 this screenshot]<!--FIXME - upload to wiki-->. Instead of embedding an HSQLDB database inside a new '''.odb''' file, your new '''.odb''' file will point to a new folder in your <code>~/Library/Containers/org.neooffice.NeoOfficeSecureEdition/Data/Documents</code> folder (note: "~" means your Home folder).
 +#If you don't like your dBase folder being buried in a hidden folder, you can create a new dBase database by simply creating an empty folder in the Finder. Then, in NeoOffice's {{window|Database Wizard}} dialog, select the {{prefName|Connect to an existing database}} radio button and select {{prefName|dBase}} from the listbox. Press the {{button|Next}} button and select the empty folder that you created.
 +
 +The key things to remember when using a dBase database is the following:
 +
 +* Like MySQL, the actual database is not in the '''.odb''' file. The '''.odb''' file only stores the location of the actual database and any Base forms that you create.
 +
 +* dBase is a single user database so be careful if you put the dBase database folder on a shared volume. If edits are made on two different machines at the same time, you can corrupt the database files.
==Importing a DBF file into Calc== ==Importing a DBF file into Calc==
Line 36: Line 49:
==Issues with DB2K files== ==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 [http://www.dbf2002.com/dbf-converter/ dbf-converter] program to convert these files to dBase-IV format, which NeoOffice does support. 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 [http://www.dbf2002.com/dbf-converter/ dbf-converter] program to convert these files to dBase-IV format, which NeoOffice does support.
 +
 +==References==
 +* [https://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&p=64779#64779 trinity post about dBase and NeoOffice Secure Edition]
{{botlangbarEN|[[Fr:Utiliser les Bases de Données dBase|Français]]}}<!-- [[It:|Italiano]] [[Es:|Español]]}}--> {{botlangbarEN|[[Fr:Utiliser les Bases de Données dBase|Français]]}}<!-- [[It:|Italiano]] [[Es:|Español]]}}-->
[[Category:NeoOffice]][[Category:Tips and Hints]] [[Category:NeoOffice]][[Category:Tips and Hints]]

Current revision

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.

Contents

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

Creating a dBase database with NeoOffice Secure Edition

To create a dBase database in Base with NeoOffice Secure Edition (NeoOffice 2013/2014), you only need to do either of the following:

  1. Select the Create new database radio button in the Database Wizard dialog as shown in this screenshot. Instead of embedding an HSQLDB database inside a new .odb file, your new .odb file will point to a new folder in your ~/Library/Containers/org.neooffice.NeoOfficeSecureEdition/Data/Documents folder (note: "~" means your Home folder).
  2. If you don't like your dBase folder being buried in a hidden folder, you can create a new dBase database by simply creating an empty folder in the Finder. Then, in NeoOffice's Database Wizard dialog, select the Connect to an existing database radio button and select dBase from the listbox. Press the Next button and select the empty folder that you created.

The key things to remember when using a dBase database is the following:

  • Like MySQL, the actual database is not in the .odb file. The .odb file only stores the location of the actual database and any Base forms that you create.
  • dBase is a single user database so be careful if you put the dBase database folder on a shared volume. If edits are made on two different machines at the same time, you can corrupt the database files.

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.

References


This article in other languages: Français
Personal tools