Board index » delphi » Formated Text field in Paradox

Formated Text field in Paradox

Hello,

I'm trying to insert a RichEdit text into a table that has the field defined
as Formated Memo.

I've used every possible adjective for the param and none of them worked.

This is what I've tryied;

    ParamByName('FTMEMO').AsBlob:= ResumenRichEdit.Text;
    ExecSQL;

I got a Type Mismatch error

Thank you very much!!

Ernesto Pareja
ernesto.par...@prebel.com.co

 

Re:Formated Text field in Paradox


Thank you Bill,

I changed the field definition to Binary and my query is expecting a tBlob
parameter type.

I'm doing this

    ParamByName('resumen').AsBlob := RichEdit1.Text;
    ExecSQL;

I'm getting the same error. What am I doing wrong?

Thank you

Quote
"Bill Todd" <b...@notthis.dbginc.com> wrote in message

news:3vk0cv0o9uid2r6qaabkk20q28bds9sasa@4ax.com...
Quote
> Use a Binary field. Do not use FormattedMemo.

> --
> Bill (TeamB)
> (TeamB cannot respond to questions received via email)

Re:Formated Text field in Paradox


Quote
Ernesto Pareja wrote:
> Thank you Bill,

> I changed the field definition to Binary and my query is expecting a tBlob
> parameter type.

> I'm doing this

>     ParamByName('resumen').AsBlob := RichEdit1.Text;
>     ExecSQL;

> I'm getting the same error. What am I doing wrong?

I would use an TBlobStream, or would ask at b.p.d.d.desktop.

Re:Formated Text field in Paradox


Thank you Dettmer but how should I pass the RichEdit text to the Database
field with the TBlobStream object?

Best regards

"Dettmer, A. L." <arma...@eps.ufsc.br> wrote in message
news:3EC062C8.4010103@eps.ufsc.br...

Quote
> Ernesto Pareja wrote:
> > Thank you Bill,

> > I changed the field definition to Binary and my query is expecting a
tBlob
> > parameter type.

> > I'm doing this

> >     ParamByName('resumen').AsBlob := RichEdit1.Text;
> >     ExecSQL;

> > I'm getting the same error. What am I doing wrong?

> I would use an TBlobStream, or would ask at b.p.d.d.desktop.

Re:Formated Text field in Paradox


Quote
Ernesto Pareja wrote:
> Thank you Dettmer but how should I pass the RichEdit text to the Database
> field with the TBlobStream object?

If anybody see any problem please point it, but I would do this:

Var
     aFileStream : TFileStream;
     aBlobStream : TBlobStream;
...

begin

...
     aFileStream:= TFileStream.create(<your RTF file name>,fmOpenRead);

     aSomeTable.edit;

     aBlobStream:= TBlobStream.Create(aSomeTableBlobField,bmWrite);
     aBlobStream.CopyFrom(aFileStream,0);
     aBlobStream.free;

     aSomeTable.post;

     aFileStream.free;

...

end;

I really recomend you to read the help file about TBlobStream and TBlobStream.CopyFrom
first. I take this example from code I developed some time ago to store images into
paradox blobs.

Other Threads