Struggling to get RTF data into RVE component
Posted: Fri Jul 22, 2011 7:13 pm
Hi, I have data originally saved as RTF into an interbase database. However, when I read it out I can convert it into another RichEdit component but fail to put it into a Richview component.
First I retrieved the data into a file as follows:
I then put it into a RVE Component without success as follows:
Putting it into a RichEdit field however works fine
Could you please tell me what I am doing wrong
Bennie
First I retrieved the data into a file as follows:
Code: Select all
GetaMemoBlob(self, mySpecies.ASubSpc.CurrSubFamily, mySpecies.ASubSpc.CurrSubSpeciesID,
aMemotype, myFile, IsValid);
procedure GetaMemoBlob(AOwner: TComponent; SubFamily : string; SubSpeciesID : integer;
theMemoType : string; ThePath : string; var MemoValid : boolean);
var
myQry: TSQLQuery;
TempField: TBlobField;
begin
if assigned(SpeciesDBCnx) then
begin
try
myQry := TSQLQuery.create(nil);
myQry.SQLConnection := SpeciesDBCnx;
myQry.SQL.Clear;
myQry.SQL.Add('SELECT * FROM MEMOS WHERE SUBSPECIES_ID = '
+ '''' + inttostr(SubSpeciesID) + '''' +
' AND MEMOTYPE=' + '''' + theMemoType + '''');
myQry.open;
if not myQry.Eof then
begin
MemoValid := true;
TempField := TBlobField(myQry.FieldByName('MEMODATA'));
TempField.SaveToFile(ThePath);
end
else
MemoValid := false;
myQry.close;
finally
FreeAndNil(myQry);
end;
end;
end;
Code: Select all
if IsValid then
begin
aRVComponent.LoadRVF(myFile);
aRVComponent.Format;
end;
Code: Select all
if IsValid then
begin
aREComponent.Lines.LoadFromFile(myFile);
end;
Bennie