Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Retrieving blob (image) from database

Posted on 2000-03-15
3
Medium Priority
?
203 Views
Last Modified: 2010-04-02
Hi,

I'm sending a picture to a database and storing it in an image column
StoredProc1->Params->Items[2]->LoadFromFile(EditAttach->Text,ftBlob);

where EditAttach is the path for the picture.
This all seems to work. However I don't know how to get this information back.
I'd like to have the name of the file or a simple notification (I can set up some kind of icon) to tell the user that a picture exists. He could then double-click on it...
But for now I'm more worried about getting the info back.
Any help would be greatly appreciated.
Thanks.
0
Comment
Question by:Your_Momma
  • 2
3 Comments
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2622297
Try the easy way. Use TDBImage to handle your graphics in the DB.
If a Datasource is linked to your table quParam and a TDBImage is linked to the
field BData of your table, your DBImage always shows the actual image. To port
it to a "normal" TImage just type

MyImage.Picture.Assign(MyDBmage.Picture);
I hope, it helps. Alex

0
 

Author Comment

by:Your_Momma
ID: 2623649

Sorry to reject this but this is not quite what I was looking for. Here are some more details that I should have mentioned.
The image is stored in a particular column of a table on my database. Depending on the unique key selected there may or may not be an image.

Therefore (maybe I misunderstand this part) if I associate Table1->TableName to the table on my database, I don't see how I can specifiy the column in which the image is stored.
I would like to associate the datasource by calling a stored procedure that is on my DB.

Thanks
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 200 total points
ID: 2633334
Hi. Do you have FishFact example of Borland, that makes
Link between TDBImage and TDBGrid ?
Method a bit different, that i prepose:
TDBImage and TDBGrid use same TDataSource object
(DataSource1) and during TDBGrid change line of table,
automatically TDBImage had been changed , too.
If no image in line, i prepose will be empty.
If you have't rthis example, i can send you it
(write you EMail).You can easy make same in your
project.
Alex

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

927 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