Icon View Incident Report

Serious Serious
Reported By: Howard Sanderon
Reported On: 9/11/2007
For: Version 1.05 Build 2
# 2450 Locates that Can Use an Existing Index Return True After Last Table Row Deleted

The following code works for me unless there is only one record in the table. It fails after deleting the final record.

while peTbl.Locate('peID',peID,[]) do  
    peTbl.Delete;
end;

Here is a test app:

In Button1Click (below)
                  
If you run the program with one person in the database, then
LocateBeforeDelete = True and LocateAfterDelete = true;

If you immediately click Button1 a second time, you get a True, followed by
an Exception on Delete.

If you Close and then Open the table after the first locate, things work as
they should.

procedure TForm1.Button1Click(Sender: TObject);
var
  LocateBeforeDelete, LocateAfterDelete: boolean;
begin
  {--- locate single record before delete (Returns True)---}
  LocateBeforeDelete := EDBTable1.Locate('peID', 1, []);
  if LocateBeforeDelete then
    ShowMessage('Locate Before Delete = True')
  else
    ShowMessage('Locate Before Delete = False');

  {--- delete single record in table ---}
  EDBTable1.Delete;

  {--- locate single record after delete (Returns True)---}
  LocateAfterDelete := EDBTable1.Locate('peID', 1, []);
  if LocateAfterDelete then
    ShowMessage('Locate After Delete = True')
  else
    ShowMessage('Locate After Delete = False');
end; {Button1Click }



Resolution Resolution
Fixed Problem on 9/14/2007 in version 1.06 build 1


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image