Page 1 of 1

Error message to disabling TMSChageNotification in Destroy

Posted: Mon 18 Jul 2016 13:14
by Zebedee
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'.
---------------------------

Re: Error message to disabling TMSChageNotification in Destroy

Posted: Tue 19 Jul 2016 08:06
by ViktorV
The similar question has already been discussed on our forum. Follow the link viewtopic.php?f=6&t=30056