Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Displaying blob image from database

2,835 views
Skip to first unread message

williamwinters

unread,
Aug 24, 2009, 1:10:07 PM8/24/09
to
Hello All,

I have an issue that I hope I can get some help with. I am
trying to display a bitmap image in a datawindow that is
stored in a blob in the database. I followed the steps:
Create datawindow select fields other than blob field
Inserted Ole database blob control
Selected table/blob field
Key clause = key field = :keyfieldintable
Client Name expression: "ID: " + :keyfieldintable
Selcted Ole class Paint.Picture:Bitmap Image

When I retrieve the ole field is blank. When I doubleclick
on it, it brings up the Paint window, but no image.

I can use these same steps to display an image using the PB
demeo db.

Am I missing something?

Notes:
PB: 9 & 11
DB: Mssql server
The ID field is unique but not set up as an index field

Thanks in advance!

John Strano[Sybase]

unread,
Aug 24, 2009, 2:50:16 PM8/24/09
to
There's a thread over in sybase.public.powerbuilder.general entitled
"InkPicture control"
that began on 8/21 that discusses using an InkPicture control
as well as a picture control in concert with calling SetPicture().

--
John Strano - Sybase Technology Evangelist

blog: http://powerbuilder.johnstrano.com/


<William Winters> wrote in message
news:4a92c96f.11b...@sybase.com...

williamwinters

unread,
Aug 24, 2009, 3:10:22 PM8/24/09
to
Thanks John!

However, I failed to mention before that I need a similar
solution for v9 as well as v11 as I am supporting seperate
systems at this time.

Shouldn't these steps work in v9.0.3 build 8614?

John Strano[Sybase]

unread,
Aug 24, 2009, 3:37:10 PM8/24/09
to
Ink controls were introduced to PowerBuilder in v10.2.

You may want to look into the picture control alternative.

--
John Strano - Sybase Technology Evangelist

blog: http://powerbuilder.johnstrano.com/


<William WInters> wrote in message
news:4a92e59e.156...@sybase.com...

williamwinters

unread,
Aug 24, 2009, 3:53:46 PM8/24/09
to
Yes Ink controls are not an option because I am using v9. So
just to be clear, does the documented solution that I
mentioned just not work?

How would I use a picture control on the dw to hold a blob
value from the database?

Thanks for your help!

John Strano[Sybase]

unread,
Aug 24, 2009, 4:34:28 PM8/24/09
to
In this scenario you'd not be using a DataWindow.
You'd be calling SELECTBLOB...

http://infocenter.sybase.com/help/topic/com.sybase.dc37781_1150/html/psref/CCJBCHIH.htm

...in conjunction with a Picture control calling SetPicture()...

http://infocenter.sybase.com/help/topic/com.sybase.dc37781_1150/html/psref/PSFSetPicture.htm


--
John Strano - Sybase Technology Evangelist

blog: http://powerbuilder.johnstrano.com/


<William Winters> wrote in message

news:4a92efca.178...@sybase.com...

Terry Dykstra [TeamSybase]

unread,
Aug 24, 2009, 5:10:55 PM8/24/09
to
The blob needs to have been saved to the database with the
selctblob()/updateblob() functions first. That adds the ole information to
the blob so that the ole server knows how to process the blob.

--
Terry Dykstra (TeamSybase)
http://powerbuilder.codeXchange.sybase.com/
http://casexpress.sybase.com
product enhancement requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

<William Winters> wrote in message
news:4a92c96f.11b...@sybase.com...

williamwinters

unread,
Aug 25, 2009, 9:48:23 AM8/25/09
to
Thanks Terry!

Once I use SelectBlob to retrieve the value into a blob
variable, how do I display it on the datawindow?

williamwinters

unread,
Aug 25, 2009, 10:33:41 AM8/25/09
to
OK...

But I guess what I need to know is how do I get an image
that is stored in a MSSQL database to display on a PB9
datawindow (without reading/writing temp files)?

Can you provide the steps?

Thanks!

0 new messages