refresh(record) on query with sum doesn't work

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

refresh(record) on query with sum doesn't work

Post by jkuiper » Thu 22 Jan 2009 14:31

I put an MyQuerycomponent with this query

Code: Select all

SELECT ontvangsten.snr, ontvangsten.inkoopregelnummer, 
SUM(ontvangsten.aantal_bollen) AS ontvangenbollen 
FROM ontvangsten
WHERE ontvangsten.snr = :snr
GROUP BY ontvangsten.snr, ontvangsten.inkoopregelnummer
It is a detail query related to my master table. when I go to my childform and close it again, I use refreshrecord on the detail table, so I can see the new sum. The refreshing doesn't work and Delphi comes with the error

Project raised exception class EMySQLException with message '
#42S22Unknown column 'ontvangenbollen'in 'fieldlist''

This AV also occurs when I put the fields in the fieldlist @Designtime and set the field ontvangen.readonly := true;

I'm using MyDAC 5.70.0.42

jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

Post by jkuiper » Thu 22 Jan 2009 14:41

just upgraded to 5.70.0.44, but the problem still exists

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 23 Jan 2009 07:49

To solve this problem try to set the TMyQuery.Options.FullRefresh property to True.

jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

Post by jkuiper » Mon 26 Jan 2009 08:31

Thanks. As far as I can see, it works :lol:

Post Reply