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