I have been using TDBRichView without problems
I now need to load a TRichView component from same blob field that I have been using with TDBRichView
The code I am using is as follows:
try
BlobStream := MyQuery.CreateBlobStream(MyQuery.FindField('SummaryDescription'), bmRead);
txtSummaryDescription.LoadTextFromStream(BlobStream, 0, 0, False);
txtSummaryDescription.Format;
except
end;
FreeAndNil(BlobStream);
I get rubbish in the control even though the content is same as I was loading with TDBRichView
I have an RVStyle compoennt associated with the TRichView component
The content was originally created in MS Word and pasted into the TDBRichView component
Problem loading from blob field
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Problem solved
For some reason the following code works but not sure why my original code did not.
try
BlobStream := TMemoryStream.Create;
TBlobField(MyQuery.FindField('SummaryDescription')).SaveToStream(BlobStream);
BlobStream.Position := 0;
txtSummaryDescription.LoadFromStream(BlobStream, rvynaNo);
txtSummaryDescription.Format;
except
end;
FreeAndNil(BlobStream);
try
BlobStream := TMemoryStream.Create;
TBlobField(MyQuery.FindField('SummaryDescription')).SaveToStream(BlobStream);
BlobStream.Position := 0;
txtSummaryDescription.LoadFromStream(BlobStream, rvynaNo);
txtSummaryDescription.Format;
except
end;
FreeAndNil(BlobStream);
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: