Struggling to convert RTF format into RVE
Posted: Tue Dec 27, 2011 6:40 am
Hi
I have a lot of data in a db, stored in rtf memos. I wish to convert this to rve so that i can use a RV Editor in future. However I battle to do this conversion. The old data is stored in a Paradox Table
The above works but it seems to leave the data in RTF format as I can only read it with a
command. LoadRVF simply returns a blank screen. This would have been OK but after editing the data in the RV Editor it now seems to be in RV format as the LoadRTF now doesn't work but LoadRVF does.
I need to fix the original conversion but cannot get it right. Some assistance would be useful, please
I have a lot of data in a db, stored in rtf memos. I wish to convert this to rve so that i can use a RV Editor in future. However I battle to do this conversion. The old data is stored in a Paradox Table
Code: Select all
with GenSQLQry do
begin
SQL.Clear;
SQL.Add('UPDATE MEMOS SET MEMODATA = :MEMO' +
' WHERE SUBSPECIES_ID = ' + '''' + inttostr(SubSpeciesID) + '''' +
' AND MEMOTYPE = ' + '''' + MemoType + '''');
// I need to convert it to RVE here
RTStream := TMemoryStream.Create;
aRVEObject := TRichViewEdit.Create(AOwner);
TBlobField(imgtable.FieldByName('Memo' + inttostr(i))).SavetoStream(RTStream);
RTStream.Position := 0;
aRVEObject.LoadRTFFromStream(RTStream);
aRVEObject.Format;
RTStream.Position := 0;
aRVEObject.SaveRVFToStream(RTStream,false);
Params[0].LoadFromStream(RTStream,ftBlob);
RTStream.Free;
aRVEObject.Free;
try
GenSQLQry.ExecSQL;
except
on E: Exception do
MessageDlg('DataInsert Error (SubSpecies - Memos)',
mtWarning, [mbOK], 0);
end;
end;
Code: Select all
if aRVComponent.LoadRTF('aRVEMemo_' + inttostr(i) + '.rvf') then
aRVComponent.Format;
I need to fix the original conversion but cannot get it right. Some assistance would be useful, please