Board index » delphi » Post moves to next record in Paradox table

Post moves to next record in Paradox table

Hello,

I wrote an application using Delphi 3 that works fine with Interbase.
I ran it with Paradox and I encountered a problem with the following
piece of code:

with AukoQuery do
begin
    Edit;
    FieldByName('AUKO_RE_NR').Value := ReNr_p;
    FieldByName('AUKO_RE_DAT').Value := StrToDate(ReDat_p);
    FieldByName('AUKO_STATUS').Value := 9;
    FieldByName('AUKO_BRUTTO').Value := ReBetr;
    Post;
end;

Result := true;

Immediately after the post statement and before executing the assignment
'Result := true' the edited record is not more the current record.
The record following the edited record is the new current record.

The query component has no AfterPost event handler and I'm quite sure
that
no other code of my app is executed between the post and the Result...
assignment (I put breakpoints at the beginning of all other methods).

There's nothing special with the query. It's a simple select statement
and
I added some calculated fields and lookup fields.

Can anyone help?

Thanks in advance,
        Riccardo Foschia

 

Re:Post moves to next record in Paradox table


I added BeforePost and AfterPost handlers for the query component
and I observed that in the BeforePost handler the record being
edited is still the current record. When entering the AfterPost
handler the current record is the record following the edited
record.

I know that the whole thing sounds odd but I really don't have
any idea what to do, so any suggestions will be really appreciated.

The most curious thing is the fact that everything is OK when
the application runs with Interbase.

Regards,
        Riccardo Foschia

Quote
Riccardo Foschia wrote:

> Hello,

> I wrote an application using Delphi 3 that works fine with Interbase.
> I ran it with Paradox and I encountered a problem with the following
> piece of code:

> with AukoQuery do
> begin
>     Edit;
>     FieldByName('AUKO_RE_NR').Value := ReNr_p;
>     FieldByName('AUKO_RE_DAT').Value := StrToDate(ReDat_p);
>     FieldByName('AUKO_STATUS').Value := 9;
>     FieldByName('AUKO_BRUTTO').Value := ReBetr;
>     Post;
> end;

> Result := true;

> Immediately after the post statement and before executing the assignment
> 'Result := true' the edited record is not more the current record.
> The record following the edited record is the new current record.

> The query component has no AfterPost event handler and I'm quite sure
> that
> no other code of my app is executed between the post and the Result...
> assignment (I put breakpoints at the beginning of all other methods).

Other Threads