Saving images on powerbuilder 10

Dear Experts.
I need to save and retrieve images from the database to an aplication. I was able to do it with a datawindow and the OleDatabaseBlob. But i am only able to save images from the datawindow (run preview.... insert row..... double click on the ole blob.... it opens (paint) .... paste from.... and updte image ) then the images are shown in the datawindow. But how can i do the same from a script? Also i try with the SelectBlob and i get a error : not a JPEG file....
Can you help me please ? where can i read about OLE to understand what i am doing?
Thank you very much.
joaquiniglesiasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

diasroshanCommented:
Hi,

selectblob is what u need to use,
u can check the help for 'SelectBlob' and 'UpdateBlob'

'SelectBlob' PB Help Example...
Blob  Emp_id_pic

SELECTBLOB Emp_pic

        INTO  :Emp_id_pic

        FROM Employee

        WHERE Employee.Emp_Num = 100

        USING Emp_tran ;

p_1.SetPicture(Emp_id_pic)


'UpdateBlob' PB Help Example...
int   fh

blob  Emp_id_pic

fh = FileOpen("c:\emp_100.bmp", StreamMode!)

IF fh <> -1 THEN

        FileRead(fh, emp_id_pic)

        FileClose(fh)

        UPDATEBLOB Employee SET emp_pic = :Emp_id_pic

        WHERE Emp_num = 100

        USING Emp_tran ;

END IF

IF Emptran.SQLNRows > 0 THEN

        COMMIT USING Emp_tran ;

END IF


please post here the exact error u get with using SelectBlob...

Cheers,
Rosh
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.