Any idea?
thnx 4 help
Code: Select all
procedure TFoNew.ulozblob(id:string);
var
Lstream: TStream;
begin
OpenDialog1.Title := 'Načíst smlouvu...';
if OpenDialog1.Execute then
begin
OCAttachment.CreateObjectFromFile(opendialog1.FileName, False);
dmmain.SQLCD101.Locate('id',id,[]);
try
dmmain.SQLCD101.Edit;
try
LStream := dmmain.SQLCD101.CreateBlobStream(dmmain.SQLCD101.FieldByName('priloha'),bmReadWrite);
OCAttachment.SaveToStream(LStream);
dmmain.SQLCD101.Post;
except
end;
finally
OCAttachment.DestroyObject;
Stream2.Free;
end;
end;
end;