How to use nascontrol 1.0 Type Library

AK
Member Posts: 226
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:
It doesn't matter which methods or properties I try, the result is always like that
How do i work this thing? Version is 2009 R2.
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.
0
Best Answer
-
Hi,
Never used that control, but I'd guess the computer name should start with \\, likenasccontrol.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.
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
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035
Answers
-
Hi,
Never used that control, but I'd guess the computer name should start with \\, likenasccontrol.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.
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
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
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?0
-
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-030 -
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions