Page 1 of 1

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

Posted: Thu 15 Jul 2010 15:34
by alf.krause
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

Posted: Mon 19 Jul 2010 09:36
by Dimon
To solve the problem set the TMyQuery.Options.FullRefresh property to True and the TMyQuery.RefreshOptions property to [roAfterInsert].