Hi

Hi
i need help, i create mysql database on web hosting and i am trying to save jpg file to to table using following code

var
lJpeg: TJPEGImage;
lBitmap: TBitmap;
lms: TMemoryStream;
begin
TCompany.Open;
if not (TCompany.State in [dsEdit, dsInsert]) then
TCompany.Edit;
if OpenPictureDialog1.Execute then
begin
lJpeg := TJPEGImage.Create();
try
lJpeg.LoadFromFile(OpenPictureDialog1.FileName);
lBitmap := TBitmap.Create();
try
lBitmap.Assign(lJpeg);
lms := TMemoryStream.Create();
try
lBitmap.SaveToStream(lms);
TCompanyCLogo.LoadFromStream(lms); // this is the line gives Error //
TCompany.Post;
finally
lms.Free;
end;
finally
lBitmap.Free;
end;
finally
lJpeg.Free;
end;
end;
end;

i am have no issue to connect Database in host, connection fine,
same code working ok with my local PC MSSQL Database. is it differant coding when we do with MySQL ? please help me, thanks

Comments