Issue 8857

Summary: Bad DBF file identification?
Product: Base Reporter: pavel
Component: codeAssignee: ooo
Status: CLOSED WONT_FIX QA Contact: issues@framework <issues>
Severity: Trivial    
Priority: P3 CC: issues, oooqa, schaffner, t8m
Version: 643Keywords: oooqa
Target Milestone: OOo 2.0   
Hardware: PC   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Description Flags
Misidentified DBF file
Snapshot of OOo 643 opening bad.dbf
none, a (zipped) dBase III file created with CC-WinFaktura, which can't read none

Description pavel 2002-10-30 22:22:43 UTC

the attached file is correct DBF file (OOo can Open it as a Data
Source). Although when this file is given on the command line:

soffice bad.dbf

or it is opened via Ctrl+O, it is opened in the Writer. The same applies
for 1.0.1 and als for 643.
Comment 1 pavel 2002-10-30 22:23:28 UTC
Created attachment 3434 [details]
Misidentified DBF file
Comment 2 prgmgr 2002-10-31 00:40:35 UTC
Pavel, thank you for using and supporting OOo.

How was bad.dbf created?  Was is created using DBase?  If so which 
Comment 3 prgmgr 2002-10-31 00:43:02 UTC
On Win NT 4.0 SP6a, OOo 643, the Data Source component does not see 
any tables in the attached dbf file.
Comment 4 pavel 2002-10-31 08:40:08 UTC
I can open the file in 643 - see attachment.

It is correct. I do not know who created it though.

dbview shows the same content as OOo.
Comment 5 pavel 2002-10-31 08:41:40 UTC
Created attachment 3438 [details]
Snapshot of OOo 643 opening bad.dbf
Comment 6 prgmgr 2002-11-11 19:02:58 UTC
Which language of OOo are you using?
Comment 7 pavel 2002-11-11 20:00:38 UTC
This is OOo in Czech language (not part of CVS yet).
Comment 8 thorsten.martens 2002-11-18 13:15:32 UTC
TM->MSC: Seems to be more a database problem in the Czech version than
a framework bug to me. Please have a look, thanks !
Comment 9 marc.neumann 2002-11-28 14:39:35 UTC

reassign to the spreadsheet team becasue this file is loaded correct
in the database component , but it doesn't load correct in the
spreadsheet component.

Marc->Oliver: Just try to load the attachment bad.dbf in calc. Impossible.

Bye Marc
Comment 10 pavel 2003-04-07 08:02:30 UTC
Any new info on this Issue?
Comment 11 oc 2003-04-17 11:22:08 UTC
Hi Eike,

could you please have a look why Calc can't load the file while the
database can access it.
Comment 12 ooo 2003-04-17 14:36:50 UTC
Similar to issue 4991:

The format of this file doesn't follow the dBase specifications
exactly and differs in one aspect: at file offset 8 (zero based) there
is a 16-bit little-endian value telling the overall length of the
header, here 0x0483. The last byte of the header has to be a 0x0d,
which isn't the case here. The 0x0d is at offset 0x0480 instead, and
two more bytes follow to pad the header. Calc does check for the
presence of the 0x0d at the given offset, and if not found refuses to
load the file. The last instance in the chain is the Writer module,
which then loads the file as text. The database module however has a
somewhat more relaxed check and doesn't complain, so the file is
availabel as data source.

I'd suggest to fix the tool that produces such erroneous files.
Comment 13 ooo 2003-04-17 14:39:38 UTC
close wontfix
Comment 14 hans_werner67 2004-02-02 12:53:47 UTC
change subcomponent to 'none'
Comment 15 martinschaffner 2005-12-30 12:14:41 UTC
This issue is also ms_interoperability :
My uncle uses an "export to MS Excel" function of the proprietary program "CC-WinFaktura" which is 
part of "CC-WinClub&Office". It produces a *.DBF file and opens it, which opens, but 
then fails to read the *.DBF-file in calc and only reads it as ASCII in writer.

I will attach ccwin.dbf, an anonymized version of such an exported file. It has its header length wrong: 
It has the value 0x562 at offset 8. If I modify this to 0x561 (the location of 0xD + 1), it opens fine in Other programs, like Microsoft Excel, or dbf-0.8.3 (
showfiles.php?group_id=1219) have no problems with the unmodified version.

I propose that this issue is re-opened, so that in the future reads *.DBF files even if they 
contain an invalid header length.
Comment 16 martinschaffner 2005-12-30 12:18:11 UTC
Created attachment 32779 [details], a (zipped) dBase III file created with CC-WinFaktura, which can't read
Comment 17 ooo 2006-01-04 17:03:25 UTC

This file is even worse than the "usual" violation of file format specification
(0x00 pad byte) mentioned above: it includes a trailing ^Z / 0x1a byte in the
header length instead. OOo2.0.x opens the file in Calc after the "dBASE" filter
was selected. Btw, changing the header length from 0x0562 to 0x0561 may make the
file load, but results in corrupted data since the data is shifted by one byte
through all fields. This is also not an interoperability issue, MS-Excel 2003
opens the file but doesn't load any data, only the header definitions, maybe
because the ^Z is interpreted as the DOS end-of-stream mark.

I strongly suggest to get the file creation fixed in the CC-WinFaktura application.

Comment 18 ooo 2008-06-17 13:50:53 UTC
For the records: also this one was fixed with the patch from issue 88577.