Topic: Locate bug...

Locate method raise access violation. neutral

I fixed that below.

procedure TSqlitePassDataset.LocateMoveToRecord;
begin
  FLocateMoveState:= grError;
  if (FLocateCurrentItem > -1) and (FLocateCurrentItem < FLocateFoundRecords.Count) then
     begin
     MoveBy(Integer(FLocateFoundRecords.Items[FLocateCurrentItem]) - PInteger(ActiveBuffer)^); // changed
     FLocateMoveState := grOk;
     if FLocateCurrentItem = 0
        then FLocateMoveState := grBOF
        else if FLocateCurrentItem = Pred(FLocateFoundRecords.Count)
             then FLocateMoveState := grEOF;
     end;
end;

It works ok in delphi.

Re: Locate bug...

Thanks again Parcel,

I check this and let you know...

I working on filters and should upload the next release in a couple of weeks...

Re: Locate bug...

Thank you, luckylazarus. smile

Re: Locate bug...

Parcel, This bug was already solved in next 0.42. The current implementation is :

procedure TSqlitePassDataset.LocateMoveToRecord;
begin
  FLocateMoveState:= grError;

  if FLocateFoundRecords.Count = 0
     then Exit;

  if (FLocateCurrentItem > -1) and (FLocateCurrentItem < FLocateFoundRecords.Count) then
     begin
     MoveBy(Integer(FLocateFoundRecords.Items[FLocateCurrentItem]) - PInteger(ActiveBuffer)^);
     if FLocateCurrentItem = 0
        then FLocateMoveState := grBOF
        else if FLocateCurrentItem = Pred(FLocateFoundRecords.Count)
                then FLocateMoveState := grEOF
                else FLocateMoveState := grOk;
     end;
end;

I let you catch some more bugs...

Thanks