|Subject||RE: [IBO] IB_COlumn Assign AV|
> At 02:16 PM 13/01/2005 +1100, you wrote:Just to clarify with pseudo code:
> >Just looking for a hint here..
> >I have the following code:
> > stRVF :=
> That prepares a Blob column to be *read from* as a stream. If
> you want it
> to be *written to*, you need to make its BlobStreamMode bsmWrite; or if
> you want it to be both, make it bsmReadWrite.
> > RichViewUtil.LoadRVFFromStream(AnsRVF);
> > RichViewUtil.SaveRTFToStream(AnsRTF, False);
> >--> IB_QConvertToRTF.FieldByName('ANSWERRTF').Assign(AnsRTF);
> >which AVs on the marked line...
> Yup. Change the mode of the receiving stream object and you
> should be fine.
procedure TMain.ConvertRVFtoRTF(Sender: TObject);
AnsRTF, AnsRVF : TStream;
with dmLocalStore.IB_QConvertToRTF do begin
while not EOF do begin
// create a read stream and load the stream from blob field 1
// Put the Stream into a control
// Now convert it using the control method for doing so
bSaved := RichViewUtil.SaveRTFToStream(AnsRTF, False);
// Now assign this new stream (created in the conversion method to
blob field 2
If I create the steam as writeable with
first, I don't get an error but nothing gets assigned to field 2
If I don't create the writeable stream first, then I get the AV.
If I create the stream as writable, I don't think the other control's method
writes to it.
But I know the conversion works because I can write to a file instead of
assign it to field 2 and it's there.
Where do I make the stream writable in this scenario?