cancel
Showing results for 
Search instead for 
Did you mean: 

OLE stored in Oracle -- save as native file

0 Kudos

Hi all PB gurus,

I just tried my luck to see if it is possible to convert any OLE objects saved in Oracle BLOG via PB OLE controls back into their native file?  We need to generalize the ole-BLOB back to the native file in another BLOB/CLOB column so that any non-PowerBuilder application can also use the stored file

I initially thought it will be just as simple as trimming certain bytes in the BLOB for a given file extension but apparently the data looks very different when comparing the native file vs the saved blob.

Thanks very much!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

How are your OLE objects are stored? Have you stored the content of ObjectData property of a OLEControl?

What's the type of content? (DOC, DOCX, ?)

As far as I know the ObjectData is not the same as the content of the file. For an older Word it was OK to save ObjectData to a DOC file but it doesn't work for newer versions.

Try to set the content in your BLOB into the ObjectData property of an OLE control and the use the Save method of the OLE application to store the file into a file.

0 Kudos

Hi Rene,

We are open to any file types user wants to attach ( word, excel, pdf, TIFF, JPG, PNG, txt, msg, etc... ) so we're really worried if we can catch them all.  You're right -- we found that the new XLSX and DOCX are no longer working with the OLE control so that is another reason we need to move away.

We're converting the OLE control's objectdata into a blob and use UPDATEBLOB to the Oracle BLOB column.

When you mention "Use the Save Method of the OLE Application..." -- do you mean to use OLE Automation to perform a "SaveAs" ( if supported for known extension ) or is there any more direct way to Save ( within the OLE control )?

I saw another thread that seems to have the same issue and this may be what I need to do?

http://scn.sap.com/thread/3631101

Thanks for the help!!!

Former Member
0 Kudos

Hi Alex,

we also used ObjectData to store DOCs into the database. This worked well for old Word versions. If we switched to a newer version we had to change to use the SaveAs method of Word (OLE automation).

This was easy for us because we had only Word as OLE application. But if you have stored different file types it could be difficult because each application has it's own methods. Maybe in some cases you can simply store the ObjectData into the file type (like with DOC), but I don't know enough about the OLE storage to tell you if you can. You have to try it out.

I don't know a direct way to Save. Sorry.

If you find a way please let me know!