I am getting this error while resolving delete operation from ClientDatset to TAdoDataset (which bound to access table). I am using Delphi 2010.

My DatasetProvider between TClientDataset and TAdoDataset :

object dspTarifeler: TDataSetProvider
  DataSet = DM.qryTarifeler    
  ResolveToDataSet = True
  Options = [poPropogateChanges, poUseQuoteChar]
end

Error occurs in this function which is called by TDataSetResolver.EndUpdate();

procedure TCustomADODataSet.InternalGotoBookmark(Bookmark: Pointer);
begin
  Recordset.Bookmark := POleVariant(Bookmark)^;
end;
4

There are 4 answers

1
Serguzest On BEST ANSWER

I had to bypass the provider and apply delete operation manually. it keeps error in Debug mode, but i can live with that.

procedure Tfrm.dspTarifelerBeforeUpdateRecord(Sender: TObject;
  SourceDS: TDataSet; DeltaDS: TCustomClientDataSet; UpdateKind: TUpdateKind;
  var Applied: Boolean);
begin
  if updatekind = ukDelete then
  begin
   if dm.qryTarifeler.Locate('Prefix',DeltaDs['Prefix'],[]) then
      dm.qryTarifeler.Delete;
   applied := true;
  end;
end;
2
Linas On

I've had the same issue with TAdoDataset. Haven't found what's wrong with it, so I just overrided the method in try except block.

Try this:

TADODataset = class(ADODB.TADODataSet)
  public
    procedure InternalGotoBookmark(Bookmark: Pointer); override;
  end;

{ TADODataset }

procedure TADODataset.InternalGotoBookmark(Bookmark: Pointer);
begin
  try
    inherited InternalGotoBookmark(Bookmark);
  except

  end;
end;
0
Jørn E. Angeltveit On

Try to set

ResolveToDataSet = False
0
Fabricio Araujo On

For some unexplainable cause which I cannot guess, I believe that after the delete the bookmark parameter of InternalGotoBookmark is going to the deleted record position...

So, the Linas solution would make the thing work...

But I agree with others, swallowing the exception is bad....