Subject | Saving rich text to a blob field |
---|---|
Author | Grant Brown |
Post date | 2005-05-25T06:56:58Z |
Hi all,
Using D5 and FB 1.5
When I try to save some rich text data to a blob field (text) it seems
to lose all of the rich text formating.
How do I overcome this ?
------ the query that I am using to save the data ------------------
try
SaveVenAdd.Transaction.StartTransaction;
SaveVenAdd.Prepare;
SaveVenAdd.Params[0].asInteger := Add_ID;
SaveVenAdd.Params[1].asInteger := Current_Vendor_ID;
SaveVenAdd.Params[2].asInteger := Vendor_ADD_DT;
SaveVenAdd.Params[3].asString := TitleText;
SaveVenAdd.Params[4].asString := Rich_Text;
SaveVenAdd.ExecQuery;
T := SaveVenAdd.FieldByName('RESULT_ID').AsInteger;
SaveVenAdd.Transaction.Commit;
Add_ID := T;
Result := 0;
except
begin
SaveVenAdd.Transaction.Rollback;
Result := Err_Code_Minus_2102;
end;
end;
------ the stored procedure used -----------------------------
SET TERM ^^ ;
CREATE PROCEDURE P_SAVE_VEN_ADD (
IDNO BigInt,
HEAD_ID BigInt,
DT BigInt,
FTITLE VarChar(250),
ADD_TEXT BLOB)
returns ( RESULT_ID BigInt)
AS
declare variable Temp_id integer = 0;
begin
Temp_id = :IDNO;
if (Temp_id < 0) then
begin
Temp_id = GEN_ID(GEN_PK_VEN_ADD_ID, 1);
insert into VEN_ADDS_REGISTER(DETECTID,HEADID,DATATYPE)
values (:Temp_id,:HEAD_ID,:DT);
end
update VEN_ADDS_REGISTER
set
ADD_TITLE = :FTITLE,
ADD_BLOB = :ADD_TEXT
where DETECTID = :Temp_id;
RESULT_ID = :Temp_id;
suspend;
end
^^
SET TERM ; ^^
--
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
Using D5 and FB 1.5
When I try to save some rich text data to a blob field (text) it seems
to lose all of the rich text formating.
How do I overcome this ?
------ the query that I am using to save the data ------------------
try
SaveVenAdd.Transaction.StartTransaction;
SaveVenAdd.Prepare;
SaveVenAdd.Params[0].asInteger := Add_ID;
SaveVenAdd.Params[1].asInteger := Current_Vendor_ID;
SaveVenAdd.Params[2].asInteger := Vendor_ADD_DT;
SaveVenAdd.Params[3].asString := TitleText;
SaveVenAdd.Params[4].asString := Rich_Text;
SaveVenAdd.ExecQuery;
T := SaveVenAdd.FieldByName('RESULT_ID').AsInteger;
SaveVenAdd.Transaction.Commit;
Add_ID := T;
Result := 0;
except
begin
SaveVenAdd.Transaction.Rollback;
Result := Err_Code_Minus_2102;
end;
end;
------ the stored procedure used -----------------------------
SET TERM ^^ ;
CREATE PROCEDURE P_SAVE_VEN_ADD (
IDNO BigInt,
HEAD_ID BigInt,
DT BigInt,
FTITLE VarChar(250),
ADD_TEXT BLOB)
returns ( RESULT_ID BigInt)
AS
declare variable Temp_id integer = 0;
begin
Temp_id = :IDNO;
if (Temp_id < 0) then
begin
Temp_id = GEN_ID(GEN_PK_VEN_ADD_ID, 1);
insert into VEN_ADDS_REGISTER(DETECTID,HEADID,DATATYPE)
values (:Temp_id,:HEAD_ID,:DT);
end
update VEN_ADDS_REGISTER
set
ADD_TITLE = :FTITLE,
ADD_BLOB = :ADD_TEXT
where DETECTID = :Temp_id;
RESULT_ID = :Temp_id;
suspend;
end
^^
SET TERM ; ^^
--
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