tfmtmemofield incompatible

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
luis_augusto
Posts: 43
Joined: Fri 14 Oct 2005 13:45

tfmtmemofield incompatible

Post by luis_augusto » Fri 02 Sep 2011 15:23

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?

AndreyZ

Post by AndreyZ » Mon 05 Sep 2011 08:10

Hello,

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

luis_augusto
Posts: 43
Joined: Fri 14 Oct 2005 13:45

Ops! I believe this can help!

Post by luis_augusto » Tue 06 Sep 2011 18:15

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?

AndreyZ

Post by AndreyZ » Wed 07 Sep 2011 12:27

Thank you for the information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.

Post Reply