SELECTing and displaying BLOB fields containing JPG files

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
nclark
Posts: 19
Joined: Wed 10 Oct 2007 11:45
Location: Norway

SELECTing and displaying BLOB fields containing JPG files

Post by nclark » Wed 10 Oct 2007 11:53

Hi
We have Oracle 10gR2 and ODAC11.exe (file ver 6.10.1.10). Our Oracle DB has Jpg files stored in BLOB fields. We would like these jpgs displayed as readable images in our Delphi 2007 (for win32) application.

Can someone please give us a step by step on how this is done.
Thanks

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 10 Oct 2007 14:32

Please see BlobPictures in OdacDemo. You can find OdacDemo in the following folder:
\Demos\Win32\OdacDemo

nclark
Posts: 19
Joined: Wed 10 Oct 2007 11:45
Location: Norway

Post by nclark » Thu 11 Oct 2007 10:46

The demo caters for only bitmaps (files in bmp format). "Bitmap image is not valid" is the error from the odacdemo when I try and 'Load file' which is a jpg. More help please. Can odac provide a way put jpgs into BLOBS and to SELECT them later??

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 12 Oct 2007 10:16

To work with JPG, you can replace the TDBImage component with the TImage component in OdacDemo. The TDBImage component automatically reads and saves images to TOraQuery. With the TImage component you need to write code that will read and save images. Please see the discussion in SDAC and MyDAC forums, to find examples of such code:

http://www.crlab.com/forums/viewtopic.php?t=10827
http://www.crlab.com/forums/viewtopic.php?t=9535

Post Reply