Page 1 of 1

Saving .dbf files

Posted: Wed Sep 17, 2008 9:32 am
by rogerj67
I have to open, amend and save .dbf files in an application I use. When I open them in Open Office they pop up as a nicely formatted table in Calc. I then amend a few items and try to save the amendments back to the same file, or another, using Save or Save As. But each time I get an error dialogue saying the "connection to the file could not be established". I can't seem to get around this impasse, even if I try and open and save the file in Base. I can save it in .ods format but then my application won't read that!

Roger

Re: Saving .dbf files

Posted: Wed Sep 17, 2008 1:42 pm
by Villeroy
The headers contain some extra info indicating the type and the max. length of the respective field (dBase is a database format). If your editing does not match the type of data, Calc refuses to store the file sinse a database may be destroyed otherwise.
There was a bug in version 2.3 (or was it 2.4.0 actually?) where the field info was wrong. For instance, it indicated lenght=12 where in fact 13 was required. With this bug the file could not be stored with the same error you have quoted. 2.4.1 does not have this bug.

Re: Saving .dbf files

Posted: Wed Sep 17, 2008 9:19 pm
by rogerj67
Thanks very much. I noticed that the headers didn't look right but didn't realise the significance. Will look further into it.

Roger

Re: Saving .dbf files

Posted: Mon Sep 22, 2008 9:26 am
by bigben
Yes, i am back again and want to feedback testing OOo 3.0 RC1 on OS Win Vista Business x32 SP1.

It still has the bug ("connection to the file could not be established") even also on version 2.4.1. When editing .dbf file on header and try to save it and the error msg pop up. Example .dbf file with 1 hundred over records:
- On the header: COLA,N,10,2 and COLB,N,10,2 and COLC,N,9,2 and COLD,N,9,2 and COLE,N,6,2.
- Need to change to header: COLA,N,8,0 and COLB,N,8,0 and COLC,N,8,0 and COLD,N,8,0 and COLE,N,5,0.
- Save it and the error msg pop up.

FYI, no problem on OOo 2.3.0

Re: Saving .dbf files

Posted: Mon Sep 22, 2008 11:35 am
by Villeroy
Yes, shure. You decreased the size of the databsae field. The size does can not take the data anymore. Any database program will likely fail to handle the respective field.

Re: Saving .dbf files

Posted: Wed Sep 24, 2008 6:49 am
by bigben
Yes same problem also on OOo 3.0 RC2.

@Villeroy
But why OOo 2.3.0 no problem for that? I hope to dev teams that this function is really usefully for those play around the .dbf files, so pls do not degrade this function. PEACE

Re: Saving .dbf files

Posted: Thu Oct 09, 2008 3:45 am
by bigben
FYI only.... Again... Yes same problem also on OOo 3.0 RC4.

Re: Saving .dbf files

Posted: Thu Oct 09, 2008 11:02 am
by Villeroy
This is issue 87325, tagged as being resolved in 2.4.1. It has some more info on this matter than I can provide.

Re: Saving .dbf files

Posted: Mon Nov 17, 2008 6:00 pm
by sclays
This issue persists in the "stable version" of OOO 3.0! How can I resolve it?

Re: Saving .dbf files

Posted: Mon Nov 17, 2008 8:02 pm
by Villeroy
sclays wrote:This issue persists in the "stable version" of OOO 3.0! How can I resolve it?
I can not reproduce the problem anymore. How do you get to it? Do you understand the additional header information about the database fields?

Re: Saving .dbf files

Posted: Tue Nov 18, 2008 11:14 am
by sclays
I open a .dbf-file (any .dbf-file) and I save it using another filename. This used to work under 2.4.1, but now it does not function anymore.

Re: Saving .dbf files

Posted: Tue Nov 18, 2008 12:36 pm
by Villeroy
Works for me with the attached file and some larger ones I tried.

Re: Saving .dbf files

Posted: Tue Nov 18, 2008 11:53 pm
by sclays
When using this file, opening it, changing even the slightest detail, NOT touching the header I reproduce the problem. Fact is that -even changing headers in 2.4.1 worked just fine.

(And open, save as ...dbf doesn't work neither)

Re: Saving .dbf files

Posted: Wed Nov 19, 2008 8:20 am
by Villeroy
[Tutorial] Reporting bugs or suggestions
Since the old issue is closed, you may open a new one and refer to the old one.
Meanwhile you can store your dbf file(s) in a dedicated database directory and connect a database document to that directory.
File>New>Database...
[X] Connect to existing
Type: dBase
Point to the dBase directory
[X] Register database (to access it from any Writer or Calc document)
Store database document
Add queries, forms and reports if you like.
From the left pane of the data source window you can drag tables and queries into Writer or Calc. You can also create data pilots from data sources.

Re: Saving .dbf files

Posted: Mon Feb 02, 2009 8:59 am
by bigben
bigben wrote:Yes, i am back again and want to feedback testing OOo 3.0 RC1 on OS Win Vista Business x32 SP1.

It still has the bug ("connection to the file could not be established") even also on version 2.4.1. When editing .dbf file on header and try to save it and the error msg pop up. Example .dbf file with 1 hundred over records:
- On the header: COLA,N,10,2 and COLB,N,10,2 and COLC,N,9,2 and COLD,N,9,2 and COLE,N,6,2.
- Need to change to header: COLA,N,8,0 and COLB,N,8,0 and COLC,N,8,0 and COLD,N,8,0 and COLE,N,5,0.
- Save it and the error msg pop up.

FYI, no problem on OOo 2.3.0
bigben wrote:Yes same problem also on OOo 3.0 RC2.

@Villeroy
But why OOo 2.3.0 no problem for that? I hope to dev teams that this function is really usefully for those play around the .dbf files, so pls do not degrade this function. PEACE
bigben wrote:FYI only.... Again... Yes same problem also on OOo 3.0 RC4.
FYI only.... Again... Yes same problem also on OOo 3.0.0.

AND FINALLY... THIS PROBLEM SOLVED ON OOo 3.0.1 (Build:9379).
YES... THX ALOT TO ALL DEV TEAM.

Re: Saving .dbf files

Posted: Thu Mar 26, 2009 1:58 am
by Pandemonium
Hello, I use the OpenOffice 3.0.1 and the problem is there. When i try to save, the same message is displayed (I use the spanish version) :

"Error al guardar el documento xxxxx:
No se ha podido establecer conexión con el archivo"

Pleas help me!!!!!!!!!!!!!!!

Re: Saving .dbf files

Posted: Thu Mar 26, 2009 6:14 am
by Villeroy
dBase is a database in a directory and should be used in a database program. Innocent spreadsheet users can easily make the tables unusable for any database program. Excel does not care, Calc does.

Store your dbf files in a separate directory.
File>New>Database...
[X]Connect to existing database
Type: dBase
Point to your directory of dbf files.
[X] Register the database.
Store the database

Add queries define filter and sort criteria for single tables.
Add fancy input forms if you like.
Add reports for pretty printing.

Drag tables and queries into any office document, including Calc spreadsheets. The imported ranges are by far more useful as loading database tables directly into a spreadsheet. [Tutorial] Using registered data sources in Calc
If you still have problems with the column types, open the table in design mode (right-click>Edit...) and adjust the column type to fit your needs.

Re: Saving .dbf files

Posted: Fri Mar 27, 2009 1:48 am
by Pandemonium
Villeroy wrote:dBase is a database in a directory and should be used in a database program. Innocent spreadsheet users can easily make the tables unusable for any database program. Excel does not care, Calc does.

Store your dbf files in a separate directory.
File>New>Database...
[X]Connect to existing database
Type: dBase
Point to your directory of dbf files.
[X] Register the database.
Store the database

Add queries define filter and sort criteria for single tables.
Add fancy input forms if you like.
Add reports for pretty printing.

Drag tables and queries into any office document, including Calc spreadsheets. The imported ranges are by far more useful as loading database tables directly into a spreadsheet. [Tutorial] Using registered data sources in Calc
If you still have problems with the column types, open the table in design mode (right-click>Edit...) and adjust the column type to fit your needs.
Thanks for your help, now i understand how it works the new version with database. ;)

Saludos de Costa Rica

Re: Saving .dbf files

Posted: Wed May 06, 2009 10:43 pm
by RogerBrown
What if the .dbf file you are using is a part of a .shp file, will moving it into another directory screw it up?

Re: Saving .dbf files

Posted: Fri Jul 03, 2009 1:01 pm
by lads
Hello,

OO 3.0.1 on Jakalope here. So far I haven't been able to open or save any dbf files, getting the same "connection to the file could not be established" error. I read this and other threads on the matter without finding anything that would help.

I followed this tutorial on creating dbf files:

http://wiki.services.openoffice.org/wik ... se_(xBase)

Inserting the following in a new spreadsheet:

Item,C,20 Purchased,D Cost,N,10,2
Chair 10/22/01 98
Table 09/16/00 483

Results in exactly the same error when I try to save as dbf.

Thanks for any help on this.

Re: Saving .dbf files

Posted: Fri Jul 03, 2009 2:42 pm
by Villeroy
I copy your data from the browser.

Code: Select all

Item,C,20 Purchased,D Cost,N,10,2
Chair 10/22/01 98
Table 09/16/00 483
Paste special as unformatted text with the date column as "Date (MDY)" or "English(US)".
Save the active sheet as /tmp/test.dbf without any warning.
I connect a database to the dBase directory /tmp.
I open the table and see all data in perfect shape with correct dates in my German locale and 2-digit decimals.
I open the table in edit mode and see the following fields and properties:

Code: Select all

ITEM  VARCHAR  length=20
PURCHASED DATE
COST  DECIMAL lenght=8, decimals=2
Just a perfect dBase export as specified in Calc's column headers.

May be your data are not what they seem to be or just another bug in your distributor's BrokenOffice.org.

Re: Saving .dbf files

Posted: Fri Jul 03, 2009 3:27 pm
by lads
Villeroy,

I followed exactly your instructions but still get the above mentioned error.

What's the version you are using? Mine says:

OpenOffice.org 3.0.1
OOO300m15(Build:9379)

Re: Saving .dbf files

Posted: Fri Jul 03, 2009 3:33 pm
by Villeroy
OOO310m11 (build:9399)
(C) Sun Microsystems Inc.

I don't think it's a matter of versions unless you use a certain outdated version. What the Linux distributors distribute is based on http://go-oo.org and comes with some extra features and a full basket of surprising bugs.

Re: Saving .dbf files

Posted: Fri Jul 03, 2009 3:38 pm
by lads
Ok,

This problem is reported in a few other places without any solution coming about. Could it be an issue accessing the file system, e.g. the OpenOffice process not having sufficient permissions?

Thanks.

Re: Saving .dbf files

Posted: Fri Jul 03, 2009 3:45 pm
by Villeroy
With a simple local file system under Linux this should never be an issue. By default you have full access to your own files you can freely store in your home directory or in /tmp.

Re: Saving .dbf files

Posted: Mon Jul 06, 2009 11:44 am
by lads
So this must be a bug. How do I report it? Thanks.

Re: Saving .dbf files

Posted: Mon Jul 06, 2009 12:21 pm
by Villeroy
[Tutorial] Reporting bugs or suggestions
Before filing an issue, you may attach a copy of what you try to save as dbf to this thread using the native ods format.
[Forum] How to attach a document here
In any case, the Base component is the better tool to handle dbf files, which are database tables by design. [Solved] Best way to import info from dbf files