crBatchMove and EOF problem

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ioda
Posts: 12
Joined: Fri 08 Feb 2008 15:11

crBatchMove and EOF problem

Post by ioda » Wed 21 Jul 2010 23:03

Hi,

Thanks to resolve RecordCount problem in crBatchMove. After many tests, I found other problem when dataset property EOF is True and I want to copy the last row in other dataset.

This is the code to you need to reproduce problem

OldDataset.Last;

BatchMove.RecordCount := 1;
BatchMove.Source := OldDataset;
BatchMove.Destination := NewDataset;
BatchMove.Execute;

If you check in NewDataset, nothing row is copied. But, if you try OldDataset.Prior and OldDataset.Next before Execute, the row will be copied.

I hope you'll resolve this problem ?

Thanks

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 22 Jul 2010 15:34

We can't change this behaviour because this influences backward compatibility so these changes will affect many users. For example, if you execute records transferring in a loop, then in many cases the last record will be copied many times. Also there is no possibility to know the reason of setting the EOF property.

ioda
Posts: 12
Joined: Fri 08 Feb 2008 15:11

Post by ioda » Thu 22 Jul 2010 16:30

I understand what you wrote but, if I want to copy last record, how I can if I can't use DataSet.Last ?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 23 Jul 2010 13:48

You can use the following code:
OldDataset.Last;
OldDataset.Prior;
OldDataset.Next;

Post Reply