• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 529
  • Last Modified:

Saving Image to DBF table.

I placed 'DBIMAGE'component on my form which connect to DataSource and Datafield and using popup menu I load image from my ClipBoard with follow lines of code in runtime.
        Table1.Open;
        DBImage1.PasteFromClipboard;
But I failed to save that image to my DBF table which got MEMO field inside.
Can anybody help me to save a image to my DBF table(memo field) from my form.

        Table1.Open;
        Table1.Edit;  
        DBImage1.PasteFromClipboard;
        Table1.Post;
If I try to put Edit and Post to above code its giving "Stream Read Error"..

Please help me asap. Thank you.
0
VENKAT
Asked:
VENKAT
  • 2
  • 2
  • 2
  • +2
1 Solution
 
DragonSlayerCommented:
MEMO fields are only for text.

If you want to save images, use a BLOB field.
0
 
VENKATAuthor Commented:
Can you tell me how to use/create BLOB field. Actually I dont know what is BLOB field. Can u please help me clearly. Thank you.
0
 
DragonSlayerCommented:
since you are using .dbf files, I assume you are using DBase?

Whether or not you can use BLOB fields depends on which dBase version your table is. If you are using a dBase IV table, then you are out of luck.

In dBase for Windows, there is a field type called Binary. To get more info on BLOBs, check out the Delphi help file.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
SBSenCommented:
Hi,
 if u have Dbase IV or Paradox then use Deliphi menu Tools -> database desktop to create the table.

HTH ;)
Senthil Kumar.
0
 
VSFCommented:
When working with images and databases I allways use to save on the database only the path where the image file is located on my HD, this ensures that my database wont grow too much, and wont get corrupt so often.

Follow this link and download a demo:
www.victory.hpg.com.br/Samples/ParadoxAndImages.zip

Hope it helps!
VSF
www.victory.hpg.com.br 
0
 
aikimarkCommented:
I agree with VSF about storing the actual image files outside the database.

BTW...BLOB = Binary Large OBject
0
 
VSFCommented:
Far more safe!

VSF
0
 
VENKATAuthor Commented:
your comments helped me to find a way to solve my things.Thank u.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now