I am just moving over to MyDac from dbExpress because I am now using MySQL 4.1.7.and Delphi 6.
The following snippet attempts to insert a record with a few text fields and also a
jpeg photo into a blob field from an image on the form. This fails with the message 'Datatype is not supported'.
This used to work with dbExpress.
It works ok with MyDac if I remove the jpeg part.
Uses clause contains 'jpeg'.
Any suggestions gratefully received.
MyQuery1.SQL.Clear;
MyQuery1.SQL.Add('INSERT INTO idcards (Id,surname,othername,photo) VALUES (:id,:surname,:othername,:photo)');
MyQuery1.Params[0].AsString:='A12345';
MyQuery1.Params[1].AsString:='Bloggs';
MyQuery1.Params[2].AsString:='Joe';
MyQuery1.Params[3].Assign(Image1.Picture.Graphic);
MyQuery1.Execute;
Regards
Ray V
Inserting jpeg images
Re: Inserting jpeg images
Please set Param Datatype:
MyQuery1.Params[3].DataType := ftBlob;
MyQuery1.Params[3].Assign(Image1.Picture.Graphic);
MyQuery1.Execute;
MyQuery1.Params[3].DataType := ftBlob;
MyQuery1.Params[3].Assign(Image1.Picture.Graphic);
MyQuery1.Execute;