We help IT Professionals succeed at work.

Saving images on powerbuilder 10

joaquiniglesias
on
Medium Priority
2,741 Views
Last Modified: 2013-12-26
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.
Comment
Watch Question

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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.