AnyDAC - TADConnection attribute FCommands contains released objects

At the moment we are migrating the database component of our Delphi7 application from the BDE components to AnyDAC Version 8.0.5 components (in the meantime known as FireDAC).

We are using the following controls in our MDI child form:

  • TADTable
  • TDataSource
  • TDBNavigator
  • TDBEdit (a TStringField is assigned to the DataField property)
  • TDBMemo (a TMemoField is assigned to the DataField property [DB Field Type = Blob])

all database controls are connected to each other

When we change two or three records, we'll receive an EAccessViolation during the disconnect of the TADCustomConnection. The EAccessViolation appears in the following method of the TCustomConnection (inside unit DB):

procedure TCustomConnection.SendConnectEvent(Connecting: Boolean);
var I: Integer; ConnectEvent: TConnectChangeEvent;
begin for I := 0 to FClients.Count - 1 do begin if FConnectEvents[I] <> nil then begin TMethod(ConnectEvent).Code := FConnectEvents[I]; TMethod(ConnectEvent).Data := FClients[I]; ConnectEvent(Self, Connecting); end; if TObject(FClients[I]) is TDataset then // <-- raises the EAccessViolation TDataSet(FClients[I]).DataEvent(deConnectChange, Integer(Connecting)); end;
end;

Reason for this EAccessViolation is the fact that the TADCustomConnection.FCommands attribute contains released TADCommands. Normally everything works like a charm, but if we exclude fiBlobs in the TADTable.FetchOption.Items or if we just execute the RefreshRecord method in the event TADTable.BeforeEdit we receive the EAccessViolation.

Any help is greatly appreciated.

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like