I have a DBRichViewEdit, called 'rve' and I want to transfer the content to a DBRichEdit called 'FindingRTF'.
RVE is in RichView format, and I want the contents converted to RTF format and stored in a DBRichEdit called FindingRTF.
So I guess I want to convert the contents in a RichViewEdit and put them in a RichEdit.
I have now asked it 3 times so I will shut up and await an answer.
Move DBRichviedEdit(rve) contenets to DBRichEdit field
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Do you want to store data in the same field, or in another field?
1) If you want to store data in the same field (rve and FindingRTF are linked to the same field), you need to convert data from RVF to RTF.
The simplest way to do it is assigning rve.FieldFormat=rvdbRTF and calling this code (assuming that the field is in Table1):
This code resaves rve content to all records. Since FieldFormat=rvdbRTF, it will be resaved as RTF.
2) If you do not want to modify the original data, you can save them as RTF using SaveRTFToStream.
The code above saves the content of rve to the field FieldName2 of the table2 as RTF (I assume that FindingRTF is linked to this field)
PS: I did not receive your previous questions about this problem
1) If you want to store data in the same field (rve and FindingRTF are linked to the same field), you need to convert data from RVF to RTF.
The simplest way to do it is assigning rve.FieldFormat=rvdbRTF and calling this code (assuming that the field is in Table1):
Code: Select all
table1.First;
while not table1.Eof do begin
table1.Edit;
rve.Change;
table1.Post;
table1.Next;
end;
2) If you do not want to modify the original data, you can save them as RTF using SaveRTFToStream.
Code: Select all
var Stream: TStream;
table2.Edit;
Stream := Table2.CreateBlobStream(Table2.FieldByName(FieldName2), bmWrite);
rve.SaveRTFToStream(Stream);
Stream.Free;
table2.Post;
PS: I did not receive your previous questions about this problem
A misunderstanding...my apology to you...
I apologize for your misunderstanding the last sentence of my post. I wanted to convey that I had stated the problem 3 different ways in this post. I did it 3 ways to make sure you understood what I was trying to ask. You did. Thanks
You did not ignore my question. There was only one post You are always prompt answering questions.
Sorry for the misunderstanding.
Donald
You did not ignore my question. There was only one post You are always prompt answering questions.
Sorry for the misunderstanding.
Donald
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: