0

I have been trying to create a select-your-picture-and-upload function of a normal user's profile in Delphi 7, but I am running in some problems.

Basically what I want is the following:

  • User uploads a picture from a folder (which I have achieved through a normal OpenPictureDialog component)

  • Said picture gets stored in a database, which is where I'm stuck.

The database is a normal access database.
The table has a unique ID to identify the members and next to that is the picture of each member on the "Picture field" (which is set as a BLOB object).

So in other words my question is the following:
What components do I need to use in order to save a picture to a specified place in my database?

I have found some random code in the net but I'm running into troubles understanding what it does.

Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
BBs
  • 33
  • 6
  • http://stackoverflow.com/questions/9825513/delphi-loading-timage-from-createblobstream-ado-query – KE50 Aug 05 '13 at 18:23
  • Since you might get in trouble storing and loading different image formats without knowing the TGraphicClass needed for reloading you might consider adding information about the needed format. [retrieve image saved on database](http://stackoverflow.com/a/14726934/1699210) – bummi Aug 06 '13 at 07:41

2 Answers2

2
ADOQuery.SQL.Text := 'SELECT PictureField FROM YourTable';
ADOQuery.Open();
ADOQuery.Edit();

TBlobField(ADOQuery.FieldByName('PictureField')).LoadFromFile('PathToPictureFile');

ADOQuery.Post();
Andrey Shatilov
  • 576
  • 6
  • 10
0

You can use imageEn component. Web Site url to get information and download trial

Murat
  • 11
  • 2