Subject Re: Looping logic is "loopy"
Author mss@smart.net
I am not using the BDE at all. I am using IBX components in
connection with Delphi 5. I am also not using any type
of "StartTransaction - Commit" type logic. The total logic is
contained in the simple example:


tblSource.Active := TRUE;
tblIBDest.Active := TRUE;

while not tblSource.Eof do begin
tblIBDest.Append;

if not (tblIBDest.State in dsEditModes) then tblIBDest.Edit;
{do something here - add field values for example to new record}

tblSource.Next;
end;

tblIBDest.Post;


If I walk thru this logic using the debugger, I notice that each
record reaches the "Append" statement and is processed. When I
examine the resulting table, however, the last record is missing
(even though I saw it being appended using the debugger).

This same problem is repeated in other places in my application. I
use a loop to process from beginning to end, and each "append"
statement is executed (as evidenced by stepping with the debugger),
but when I examine the resulting Interbase table, the last record
(associated with the last "append" statement) is missing. I am using
the tblIBDest.Post method but this doesn't seem to help.

Any ideas as to what I am doing wrong?

Thanks,

- Dale F.


--- In ib-support@y..., ded_spb@y... wrote:
> Hi, Dale.
>
> If you use BDE and your DataBase.TransIsolation=tiRepeatableRead
> and you don't explicitly start/commit transaction, I know reason.
If
> not, specify your connectivity components and how you handle
> transaction around this loop. In this case I can help only tomorrow
> (go home), maybe someone else helps just now, but this info is
needed
> for anyone.
>
> Best regards.