Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Save File from OLE object

262 views
Skip to first unread message

TomVDJ

unread,
Aug 22, 2008, 5:59:40 AM8/22/08
to
I'm not quite familiar with the OLE control, but I have this problem
(it's not my code ;-):

In my program, a file is selected in this way:

String ls_typename
String docname, ls_filename
Integer value

value = GetFileOpenName("Select File",docname, ls_filename)

IF value = 1 THEN
// The ole control will then be loaded with a blank ole object
of that type.
If ole_object.InsertFile(docname) = 0 Then
dw_data.Object.file_name[1] = ls_filename
End If
End if

Then it is saved in this way:

blob lblb_data

lblob = ole_object.objectdata

updateblob customer_doc set document = lblb_data
where doc_id = :al_document using gtr_sqlca;

Later, the file can be opened on this way:

Blob lblb_data

Selectblob document into :lblb_data From customer_doc
where doc_id = :al_document using gtr_sqlca;

ole_object.objectdata = lblb_data
ole_object.activate(OffSite!)

This works just fine. But now I need to save that file. I tried:

lblb_data = ole_object.objectdata

then saving this blob to a file. But the file I get on that way is
bigger than the original file, and it's corrupt. So I assume the blob
is an ole-object, not the data itself.

I have to extract several (many) blobs (saved in the way described
above) from the database (original filename is also stored in the
database) and save them to disk as the original file. How can I do
this?

Thanks for the help.

Tom

Chris Werner

unread,
Aug 22, 2008, 11:29:04 AM8/22/08
to
Hi Tom,

can't you call a Save or SaveAs function on the OLE server,
something like ole_object.saveAs('example.xls')?

HTH

Chris Werner
f+s software gmbh

"TomVDJ" <tom.vand...@syneton.be> schrieb im Newsbeitrag
news:1i2ta45rpa08a1h9q...@4ax.com...

TomVDJ

unread,
Aug 25, 2008, 1:58:52 AM8/25/08
to
On 22 Aug 2008 08:29:04 -0700, "Chris Werner"
<cwAT{PleaseNoSpam}f-s.de> wrote:

>Hi Tom,
>
>can't you call a Save or SaveAs function on the OLE server,
>something like ole_object.saveAs('example.xls')?

I tried that, but in that case, it seems the OLE object itself is
saved, not only the data within that OLE object.

TomVDJ

pob671...@gmail.com

unread,
Oct 6, 2008, 5:46:03 PM10/6/08
to
On Aug 24, 10:58 pm, TomVDJ <tom.vanderjeu...@syneton.be> wrote:
> On 22 Aug 2008 08:29:04 -0700, "Chris Werner"
>
> <cwAT{PleaseNoSpam}f-s.de> wrote:
> >Hi Tom,
>
> >can't you call aSaveor SaveAs function on theOLEserver,
> >something like ole_object.saveAs('example.xls')?
>
> I tried that, but in that case, it seems theOLEobjectitself is

> saved, not only the data within thatOLEobject.
>
> TomVDJ

Hi,

I have similar issue while trying to save blob data saved in an Oracle
database by a PB appl to files for migration. I used
ole_control.SaveAs() but didn't seem to work. Only Word documents can
be saved to file and opened without errors. PDF and JPG files have
problem opening. Any suggestions are welcome.

Thanks
POB

0 new messages