You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Larry Sanderson <la...@sanderson.net> on 2004/01/29 00:13:47 UTC

MS Access export file...

This is kind of an odd question, I'm sure - I hope someone can help me.  I am 
working with an Access DB that is holding binary data in an OLEObject field.  
This binary data is being dumped to xml (base64 encoded first), and sent to a 
Unix environment.  

On the Unix environment, I am parsing the xml, base64-decoding the binary 
field, and finding a lot more that I bargained for - the file was there, but 
with a bunch of extra header/footer gibberish.  I was guessing that the 
entire OLE object was dumped, and I had hoped that the POI project could help 
me restore the original file.  

Unfortunately, I am at a loss.  I have tried using a POIFSFileSystem with the 
file, but it is reporting an error: "Invalid header signature"

Any thoughts / suggestions / references?

Thanks for any help!

-Larry

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


RE: MS Access export file...

Posted by Michael Zalewski <za...@optonline.net>.
That's because an OLEObject field contains more than just the binary XLS
format.

It is something called a 'CompObj' structure, which is a wrapper around the
XLS bytes. The 'CompObj' structure is how Access knows that the BLOB is
actually Excel (as opposed to Word or PowerPoint or something else).

What you might be able to do is look for the OLE Doc header in the binary
file you extracted. It will be 8 bytes beginning with

   private static byte[] abOleDocSig = new byte[] {
        (byte) 0xd0, (byte) 0xcf, (byte) 0x11, (byte) 0xe0
      , (byte) 0xa1, (byte) 0xb1, (byte) 0x1a, (byte) 0xe1
   };

Look for these 8 bytes in your binary file, and throw away everything before
this structure (about 200 bytes). What you have left is a file that begins
with these 8 bytes. Let HSSF have a crack at the resulting file.

Please report back your results to this list.

-----Original Message-----
From: Larry Sanderson [mailto:larry@sanderson.net]
Sent: Wednesday, January 28, 2004 6:14 PM
To: poi-user@jakarta.apache.org
Subject: MS Access export file...

This is kind of an odd question, I'm sure - I hope someone can help me.  I
am
working with an Access DB that is holding binary data in an OLEObject field.
This binary data is being dumped to xml (base64 encoded first), and sent to
a
Unix environment.

On the Unix environment, I am parsing the xml, base64-decoding the binary
field, and finding a lot more that I bargained for - the file was there, but
with a bunch of extra header/footer gibberish.  I was guessing that the
entire OLE object was dumped, and I had hoped that the POI project could
help
me restore the original file.

Unfortunately, I am at a loss.  I have tried using a POIFSFileSystem with
the
file, but it is reporting an error: "Invalid header signature"

Any thoughts / suggestions / references?

Thanks for any help!

-Larry

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org