IF CREATE(nasccontrol,TRUE,TRUE) THEN BEGIN nasccontrol.ComputerName := '049WS106'; //omitting this doesn't make a difference nasccontrol.ServiceName := 'TEST'; message(nasccontrol.ServiceStateText); //this is where the error occurs END;
An exception was raised in method ServiceStateText. The OLE control or Automation server has returned error (HRESULT) -2147352567. The component did not provide the exception description.
nasccontrol.ComputerName := '\\049WS106';Also - does your account have a permission on the 049WS106 machine to access services? Make yourself a local admin on the 049WS106 box as a part of your testing.
Answers
Never used that control, but I'd guess the computer name should start with \\, like Also - does your account have a permission on the 049WS106 machine to access services? Make yourself a local admin on the 049WS106 box as a part of your testing.
Before testing things in NAV try to use sc.exe in command line to see what your account can do with the services on the 049WS106 box
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
You need to have enough permissions on the remote machine, 049WS106. "Run as administrator" will only give you the admin permission to the local machine where you started your session with it.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03