Subject RE: [firebird-support] saving to a blob field
Author Alan McDonald
> 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

your SQL is a SELECT statement - shouldn't be an update or insert?
Alan