Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert ole blobs into normal file attachments

Status
Not open for further replies.

Andyfives

Programmer
Feb 22, 2002
46
0
0
DK
Historically we have been saving blobs into ASE database tables through olecontrol.

Now I want to discard the ole container used to open them as the scope has changed to attachments, which have a life of their own.

So there are 2 methods currently in saving the files and opening them. I want to use just the one where we save the binary directly and then open with a shellexecute.

The problem I have is that we now have various types of file pdf, jpg, bmp etc which I can not convert. The microsoft files appear to be fine when I:

1. activate olecontrol
2. saveas to file in the system
3. fileopen/fileexec into blob
4. save to database.

but the pdf's, etc do not allow me to open them.

Is there a way of converting these blobs so they no longer have any ole detail and return to being just simple files?

I am not an expert in ole technology, I seemed to have avoided it this long!

Thank you in advance
Andy

 
It appears there is no other way of doing this except:

1. opening the olecontrol with Activate(OffSite!)
2. manually save document with 'save as' in olecontainer application.
3. manually close document
4. then replace old blob in db with blob from new file using filereadex()

 
Thanks for the update. I've never used an ole container to import images into a database (always just saved the blob itself) so I wasn't sure of the capabilities.

Matt

"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top