Datacontrol not refreshed (set not emtpy) on TMyQuery.Insert

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
alf.krause
Posts: 7
Joined: Wed 20 Sep 2006 09:44

Datacontrol not refreshed (set not emtpy) on TMyQuery.Insert

Post by alf.krause » Thu 15 Jul 2010 15:34

Hallo,

i have a Query with calculated fields - i work with with this Query.insert the database controls was not refreshed - i can see the old values from prevorius Record in TDbEdit etc.

here ist the Query:

select vorgang.*,
IF(STATUSVORGANG="BUCHUNG", PERSONEN+PERSONENZUGEBUCHT-PERSONENSTORNO, PERSONEN ) as PERSONENBERECHNET,
IF(STATUSVORGANG="BUCHUNG", BETREUER+BETREUERZUGEBUCHT-BETREUERSTORNO,BETREUER) as BETREUERBERECHNET,
IF(STATUSVORGANG="BUCHUNG", BETREUERW+BETREUERZUGEBUCHTW-BETREUERSTORNOW, BETREUERW) as BETREUERBW,
IF(STATUSVORGANG="BUCHUNG", BETREUERM+BETREUERZUGEBUCHTM-BETREUERSTORNOM , BETREUERM) as BETREUERBM,
IF(STATUSVORGANG="BUCHUNG", PERSONENM+PERSONENZUGEBUCHTM-PERSONENSTORNOM, PERSONENM) as SCHUELERBM,
IF(STATUSVORGANG="BUCHUNG",PERSONENW+PERSONENZUGEBUCHTW-PERSONENSTORNOW, PERSONENW ) as SCHUELERBW from vorgang where vorgangsnummer=1

If i use

select vorgang.* from vorgang

it is work fine, but i have an Exception "missing Fields".

Set the SQL-Statement (insert, refresh, update) to all fields from vorgang table does not work. I also set the update table. The RefreshRecord Method also doesn't work.

THX

Alf

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

Post by Dimon » Mon 19 Jul 2010 09:36

To solve the problem set the TMyQuery.Options.FullRefresh property to True and the TMyQuery.RefreshOptions property to [roAfterInsert].

Post Reply