Subject Re: [IBO] Different insert behavior (BDE->IBO)
Author Lucas Franzen
Joe Martinez schrieb:
>
> I just noticed a strange difference in behavior in my app since
> converting from BDE to IBO (TDataset compatability). I'm using a
> TDBNavigator to insert, delete, navigate, etc. When I was using BDE, if
> I hit the "+" button to insert a record, it would put the new record at
> the end of the dataset. Now, under IBO, it sticks in right in the
> middle of the dataset (right before whatever record I was currently on
> before clicking the "+" button. If I exit my app and come back in, the
> record has moved to the end of the dataset.
>
> Why is this? Is there a way to go back to the BDE way of putting it at
> the end?

Joe,

Adding a record "at the end" is just a matter of the executed client
method. In BDE it seems that hitting the "+" button caused an APPEND
while in IBO it does an INSERT.

But these are just methods of the VCL, the server itself has got no idea
what APPEND is in SQL you can just insert new records by INSERT INTO
.... and new records are stored aynwhere in the database!

Append (on the client side) does nothing else than fetching ALL records
(by calling LAST) and then doing an insert "visually" after the last
record, while INSERT does the insert just at the place where you are; I
think it's quite obvious to see that this is much faster than having to
read all records before doing an insert.

If you see the record at the end after restarting your app it's just a
matter of the ordering of records; if you haven't got any order by
clause new records may appear at the end but they also may appear
somewhere in the middle of the grid since IB/FB has got no fixed
position for any record - you're working with a SQL server, not with a
desktop database!

Luc.