Page 1 of 1

SELECTing and displaying BLOB fields containing JPG files

Posted: Wed 10 Oct 2007 11:53
by nclark
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

Posted: Wed 10 Oct 2007 14:32
by Plash
Please see BlobPictures in OdacDemo. You can find OdacDemo in the following folder:
\Demos\Win32\OdacDemo

Posted: Thu 11 Oct 2007 10:46
by nclark
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??

Posted: Fri 12 Oct 2007 10:16
by Plash
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