Link to home
Start Free TrialLog in
Avatar of gianluca
gianluca

asked on

editing record moves to the last in TClientDataSet

Editing a record in a TClientDataSet, causes it to move to the last. It should keep the current position!!!

(* edit recond n.10 *)
 Table3.RecNo:=10;
 Table3.Edit;
 Table3.Fields[1].AsInteger:=Random(100);
 Table3.Post;

(* close and reopen the table *)
 Table3.Close;
 Table3.Open;
(* now the 10th record moved to last!!!! *)
ASKER CERTIFIED SOLUTION
Avatar of mokule
mokule
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gianluca
gianluca

ASKER

An index will affect the speed ?? I think it will slow Editing and Appending the records....
Generally an index is added for raising speed and maintaining desireed order.
Some slow down while adding is the cost. In most cases it is a fracton of advantages.
Avatar of Tomas Helgi Johannsson
    Hi!
Adding an index optimal to a sertain query speeds the retrieval of
the data. Same goes for a table objects.
If space allocations for the index is well designed then adding an insert
will have minimal affects on update and insert to the table.

Regards,
  Tomas Helgi