Board index » delphi » Either BOF or EOF is True, or Current record has been deleted

Either BOF or EOF is True, or Current record has been deleted

I'm reposting this because I believe I asked the wrong question
by mixing up two different issues...

I am using Delphi 6 (ADO) with SQL Sever 7.0.
When I delete a record I need to look at the values of that
deleted record to update a different table with SQL.  But when I
set the FilterGroup = fgPendingRecords and Filtered = True and
then attempt to CancelBatch so I can look at the values, I get
"Either BOF or EOF is True, or current record has been deleted".
How do I get Around this?  I have installed Delphi 6 Update 1 and
Update 2.

{*** First check for deleted records ***}
AAR_DM.RqstPhoneMail.FilterGroup := fgPendingRecords;
AAR_DM.RqstPhoneMail.Filtered := True;
while not(AAR_DM.RqstPhoneMail.EOF) do
begin
  if (rsDeleted in AAR_DM.RqstPhoneMail.RecordStatus) then
  begin
    { Undelete the record so we can read the data }
    AAR_DM.RqstPhoneMail.CancelBatch(arCurrent); -- ERROR OCCURS HERE --
    try
      { Copy the values into update paramenters }
      qryInsert.Parameters.ParamByName('PHONE_MAIL').Value := AAR_DM.RqstPhoneMail.Fields[0].Value;
       .
       .
       .
    finally
       { Re-delete the record }
       AAR_DM.RqstPhoneMail.Delete;
    end;
  end;
  AAR_DM.RqstPhoneMail.Next;
end;

 

Re:Either BOF or EOF is True, or Current record has been deleted


Quote
> deleted record to update a different table with SQL.  But when I
> set the FilterGroup = fgPendingRecords and Filtered = True and
> then attempt to CancelBatch so I can look at the values, I get
> "Either BOF or EOF is True, or current record has been deleted".

You are experiencing a bug of TCustomADODataSet.
http://web.orbitel.bg/vassil/BUGS.htm#BUG_TCustomADODataSet_CancelBatch

HTH
--
Vassil Nazarov
http://web.orbitel.bg/vassil/

Other Threads