Page 1 of 1

tfmtmemofield incompatible

Posted: Fri 02 Sep 2011 15:23
by luis_augusto
Having two queries over the same table, in order to copy record from one to the other.
If I have a Tfmtmemofield, an exception is raised when I try to assign it to its correspondent target field:

Query1.sql.text:='Select * from tableA where proposta=1';
Query2.sql.text:='Select * from tableA';
pp:=2;
ano:=2011;
Query1.first;
while not Query1.eof do
begin
Query2.insert;
for m:=0 to Query2.FieldCount-1 do Query2.Fields[m].Assign(Query1.fieldbyname(Query2.fields[m].fieldname));
Query2Proposta.asinteger:=pp;
Query2ano.asinteger:=a;
Query2Aprovado.AsBoolean:=false;
Query2.post; raises : Invalid character value for cast specification Parameter[35] :[Texto] - invalid Value (Status = 2h).
Query3.next;
end;
Query1.next;
end;

The content of the field "texto" is a richtext produced by a standard trichmemo delphi component.

This works fine under Sdac.

Could this be an incompatibility between Query parameter and Latin1 charset?

Posted: Mon 05 Sep 2011 08:10
by AndreyZ
Hello,

Please send a sample project that demonstrates this problem to andreyz*devart*com, including a script to create the tableA table.

Ops! I believe this can help!

Posted: Tue 06 Sep 2011 18:15
by luis_augusto
Dear sirs,

The problem I reported is due to the following reason:

Query1 fields are defined by a sentence, therefore a formatted memo field is automatically set to ftblob (blobtype property).

Query2 fields are designtime defined and the blobtype property of their tmemofields is set to ftfmtmemo, in order to support richtext contents.

This was working alright, in SDAC, now this assignment is no longer possible.

Then, in order to overcome that obstacle, I have to write the following code after the opening of query1:

tblobfield(Query1.FieldByName('Texto')).BlobType:=ftFmtMemo;

This willl be a problem, since I have several situations where I will have to make this association.

Can you fix this?

Posted: Wed 07 Sep 2011 12:27
by AndreyZ
Thank you for the information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.