Saving images on powerbuilder 10

Posted on 2006-03-24
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.
Question by:joaquiniglesias
    1 Comment
    LVL 18

    Accepted Solution


    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 ;


    '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)


            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...


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now