If you have two or more datasets that represent the same database table but do not share a data source component, then each dataset has its own view on the data and its own current record. As users access records through each datasets, the components' current records will differ.
If the datasets are all instances of TTable, or all instances of TIBTable, or all client datasets, you can force the current record for each of these datasets to be the same by calling the GotoCurrent method. GotoCurrent sets its own dataset's current record to the current record of a matching dataset. For example, the following code sets the current record of CustomerTableOne to be the same as the current record of CustomerTableTwo:
CustomerTableOne.GotoCurrent(CustomerTableTwo);
CustomerTableOne->GotoCurrent(CustomerTableTwo);
CustomerTableOne.GotoCurrent(Form2.CustomerTableTwo);
CustomerTableOne->GotoCurrent(Form2->CustomerTableTwo);
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|