How to use nascontrol 1.0 Type Library

Hi,

I found this post https://forum.mibuso.com/discussion/22633/job-queue-for-unlimited-company/p2 and tried using nascontrol, but it doesn't seem to work at all.
My code is simple enough:
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;

It doesn't matter which methods or properties I try, the result is always like that
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.

How do i work this thing? Version is 2009 R2.

Best Answer

Answers

  • AKAK Member Posts: 226
    Good advice, thank you! But I started Nav with the option "run as administrator" to bypass any problems related to permissions. Shouldn't that have done the trick?
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Not really. "Run as administrator" will only help with permissions as long as your NAS is on 049WS106 and you develop and/or test on the same box.

    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.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • AKAK Member Posts: 226
    Thanks for the clarification. It was in fact the same machine, but after starting the client as administrator I must have closed and started it again the normal way without noticing. After trying it again it worked as it should.
Sign In or Register to comment.