I am using OOo 2.0.3 on Linux FC4.
I store a binary file into a database - Base document if it matters.
First I tried to use a stream:
oStatement.setBinaryStream(2, oStream, oStream.getLength())
The error message said that there was an error from the ODBC driver
stating that the stream was NULL. I found that the following works:
lLen = oStream.getLength()
ReDim oData(0 To lLen-1)
oStream.readBytes(oData(), lLen)
oStatement.setBytes(2, oData(), lLen)
I can extract the data from my database to a file.
oSimpleFileAccess.writeFile(sURL, oStream)
Rather than writing the file to disk, I would prefer to load the file
directly.
Dim oProp(0) As New com.sun.star.beans.PropertyValue
oProp(0).Name = "InputStream" : oProp(0).Value = oStream
REM oProp(1).Name = "ReadOnly" : oProp(1).Value = True
REM oProp(2).Name = "FilterName" : oProp(2).Value = "writer8"
StarDesktop.LoadComponentFromUrl("private:stream", "_blank", 0, oProp())
When I try this, however, soffice locks up and I have to manually kill
soffice.
The closest that I could find to a solution is in Java, but it uses a
com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter
The speculation is that the XInputStream does not support XSeekable.
http://joott.cvs.sourceforge.net/joott/jooconverter2/src/net/sf/jooreports/openoffice/converter/OpenOfficeDocumentConverter.java?view=markup
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info: http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]