New inserted record ignores sort order

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
BlueMoon
Posts: 12
Joined: Tue 30 Mar 2010 17:22

New inserted record ignores sort order

Post by BlueMoon » Mon 18 Oct 2010 11:25

Hi,

I use a DBNavigator, a DBGrid and a IBCTable. When I insert a new record than the record is inserted one row above the cursor in the DBGrid. Afer post the record stays at this position. My table and DBGrid is ordered by the first field called Date. I want to have the new record at the correct position. How to to do this? Why is the record not inserted at the right position?

AndreyZ

Post by AndreyZ » Tue 19 Oct 2010 08:55

Hello,

You should put an index into the IBCTable.IndexFieldNames property. Here is an example:

Code: Select all

IBCTable.IndexFieldNames := 'Date';

BlueMoon
Posts: 12
Joined: Tue 30 Mar 2010 17:22

Post by BlueMoon » Tue 19 Oct 2010 10:05

Good! That works. Thanks!

AndreyZ

Post by AndreyZ » Tue 19 Oct 2010 11:22

I am happy that this problem has been solved. If any other questions come up, please contact me.

Post Reply