Problem with SaveRVFToStream and LoadRVFFromStream Functions
Posted: Mon Dec 19, 2016 6:04 am
Forgive my English; I start with the LoadRVFFromStream function, I try to load the information stored in database (Firebird 2.5) from a blob field of sub_type 0, using the following form:
st: = TMemoryStream.Create;
FDQuery1.Close;
FDQuery1.SQL.Clear;
FDQuery1.Open ('Select * from tests');
// TSQLBlobStream (FDQuery1.FieldByName ('text')). SaveToStream (st);
// TBlobField (FDQuery1.FieldByName ('text').) SaveToStream (st);
st: = FDQuery1.CreateBlobStream (FDQuery1.FieldByName ('text'), bmRead);
St.Position: = 0;
// st.Seek (0,0);
RichViewEdit1.LoadRVFFromStream (st);
St.Free;
Which does not happen, that is, it does not load anything.
Or this way
st := TStream.Create;
FDQuery1.Close;
FDQuery1.SQL.Clear;
FDQuery1.Open('Select * from pruebas');
// TSQLBlobStream(FDQuery1.FieldByName('texto')).SaveToStream(st);
// TBlobField(FDQuery1.FieldByName('texto')).SaveToStream(st);
st := FDQuery1.CreateBlobStream(FDQuery1.FieldByName('texto'),bmRead);
st.Position := 0;
// st.Seek(0,0);
RichViewEdit1.LoadRVFFromStream(st);
st.Free;
I throw the following error. Raised exception class EStreamError with message 'TStream.Seek not implemented'
I have reviewed the examples they recommend from this forum and it does not work. What am I doing wrong?
As for the function SaveRVFToStream, it does not generate error in fact in the database stores the information but I do not know how to check this, I simply store it in bold but when trying to load it I do not know if it stores well.
The control I'm using the RichViewEdit
st: = TMemoryStream.Create;
FDQuery1.Close;
FDQuery1.SQL.Clear;
FDQuery1.Open ('Select * from tests');
// TSQLBlobStream (FDQuery1.FieldByName ('text')). SaveToStream (st);
// TBlobField (FDQuery1.FieldByName ('text').) SaveToStream (st);
st: = FDQuery1.CreateBlobStream (FDQuery1.FieldByName ('text'), bmRead);
St.Position: = 0;
// st.Seek (0,0);
RichViewEdit1.LoadRVFFromStream (st);
St.Free;
Which does not happen, that is, it does not load anything.
Or this way
st := TStream.Create;
FDQuery1.Close;
FDQuery1.SQL.Clear;
FDQuery1.Open('Select * from pruebas');
// TSQLBlobStream(FDQuery1.FieldByName('texto')).SaveToStream(st);
// TBlobField(FDQuery1.FieldByName('texto')).SaveToStream(st);
st := FDQuery1.CreateBlobStream(FDQuery1.FieldByName('texto'),bmRead);
st.Position := 0;
// st.Seek(0,0);
RichViewEdit1.LoadRVFFromStream(st);
st.Free;
I throw the following error. Raised exception class EStreamError with message 'TStream.Seek not implemented'
I have reviewed the examples they recommend from this forum and it does not work. What am I doing wrong?
As for the function SaveRVFToStream, it does not generate error in fact in the database stores the information but I do not know how to check this, I simply store it in bold but when trying to load it I do not know if it stores well.
The control I'm using the RichViewEdit