Subject saving to a blob field
Author Grant Brown
Hi all,

Using D5, FIBPlus and FireBird 1.5

Could someone please show me how to save a rtf memo to a database record
using streams. Never doe it before and its giving me heaps of grief

// SQL - SELECT PRINTING FROM VEN_PROFILE_MEMOS WHERE DETECTID = :IDNo
stm := TMemoryStream.Create;
try
MainForm.Ven_RT_Memo.Lines.SaveToStream(stm);
stm.Position := 0;
try
SaveProfileMemoStrem.Transaction.StartTransaction;
SaveProfileMemoStrem.Prepare;
SaveProfileMemoStrem.Params[0].asInteger := IDNo;
SaveProfileMemoStrem.ExecQuery;
if SaveProfileMemoStrem.eof = false then
begin
SaveProMemo.LoadFromStream(stm);
end;
SaveProfileMemoStrem.Transaction.Commit;
Result := 0;
except
begin
Result := Err_Code_Minus_2202;
SaveProfileMemoStrem.Transaction.Rollback;
end;
end;
finally
stm.Free;
end;

--
Regards,
Grant Brown

Product Development Manager
Phone : 02 4229 1185
Mobile : 0412 926 995
Email : grant@...
Web : www.sitedoc.com.au

SiteDoc - Easy to Use - Powerful Results