Error message to disabling TMSChageNotification in Destroy

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Zebedee
Posts: 3
Joined: Sat 28 Apr 2012 10:45

Error message to disabling TMSChageNotification in Destroy

Post by Zebedee » Mon 18 Jul 2016 13:14

Hello.
I've TMSServiceBroker in my form. It works fine.
But, I get an error message when I want to make disabled TMSChageNotification in Destroy.
My code is bellow.

Code: Select all

    sbBroker: TMSServiceBroker;
    cfNotifyMessage: TMSChangeNotification;
    qNotifyCount: TMMSQuery;

procedure TForm1.CreateBroker;
begin
  qNotifyCount.Close;
  cfNotifyMessage.Enabled := False;
  sbBroker.Service := GetUniqueServiceName;
  sbBroker.CreateServerObjects('http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification');
  cfNotifyMessage.Service := sbBroker.Service;
  cfNotifyMessage.Enabled := True;
  qNotifyCount.Open;
end;

destructor TForm1.Destroy;
begin
  qNotifyCount.Close;
  if sbBroker.Service <> '' then cfNotifyMessage.Enabled := False;
  cnBase.Disconnect;
  inherited;
end;
Error Message is -->>
---------------------------
Debugger Exception Notification
---------------------------
Project PROJECT.exe raised exception class EOLEDBError with message 'Operation canceled'.
---------------------------

ViktorV
Devart Team
Posts: 2299
Joined: Wed 30 Jul 2014 07:16

Re: Error message to disabling TMSChageNotification in Destroy

Post by ViktorV » Tue 19 Jul 2016 08:06

The similar question has already been discussed on our forum. Follow the link viewtopic.php?f=6&t=30056

Post Reply