Topic: LoadFromFile and Edit record
Hello my friends,
MVD version 2.8
I used to use the LoadFromFile procedure to put an image in a dbimage and save it to database, and this works fine on new records.
It's done like :
try
HTTPGet(URL,image_name,True);
Form1.DBImage1.Picture.LoadFromFile(image_name);
Form1.DBImage1.dbfilename := image_name;
except
ShowMessage(ExceptionMessage);
End;
As I said, this works fine with new records, the save button is a standard MVD button with fields linked and no script.
But if I use a button with function EditRecord on an already existing record to which I want to append an image, the very same procedure does not work anymore.
The picture is displayed in the dbimage on the form, but not saved to database when I click on the save button.
Does it have something to do with the edit procedure instead of new record ?
Cheers
Mathias
PS : in the attached project, if you create a new record, use the Loadfromfile button and then save, the image is saved in database (just edit the record to see it). But if you first create a new record, save it with only a name, and the edit it to add image with the button LoadFromFile and save again, then the image is not saved (edit the record again and you'll see no image).
Each time I get a divorce, I keep the house
Zaza Gabor