Connection.AfterDisconnect not triggered
Posted: Sat 08 Apr 2017 07:55
Hello,
I make an empty project, add a Datamodule unit, place a MSConnection on this Datamodul and link this Datamodule to a SQLServer.
Then I add following code:
Running this in Delphi XE5 it works like expected, but in Delphi 10.1 the event afterDisconnect is not triggered.
In LiteDAC there is the same behavior.
Is this a bug in Delphi?
best regards
Hans
I make an empty project, add a Datamodule unit, place a MSConnection on this Datamodul and link this Datamodule to a SQLServer.
Then I add following code:
Code: Select all
procedure TDataModule2.DataModuleCreate(Sender: TObject);
begin
MSConnection1.Connect;
end;
procedure TDataModule2.DataModuleDestroy(Sender: TObject);
begin
MSConnection1.Close;
end;
procedure TDataModule2.MSConnection1AfterDisconnect(Sender: TObject);
begin
ShowMessage('MSConnection disconnected');
end;
In LiteDAC there is the same behavior.
Is this a bug in Delphi?
best regards
Hans