HI ALL
HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STARTED
If my application returns error 6420 I want to be able to start the ADS service and try to reconnect again.
Thanks.
Joe
HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STARTED
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA
From the services management tool for windows:
From command line: enter services.msc and press enter
Or Control Panel - Administrative Tools - Service
Select Advantage Database server and click restart.
From command line: enter services.msc and press enter
Or Control Panel - Administrative Tools - Service
Select Advantage Database server and click restart.
Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA
Joe,
Sounds like you want to do this under program control...
Although I've not tried this myself, it looks like you'd need to perform the following steps using Windows API calls:
1) OpenSCManager, to open the service control manager on the desired machine
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
2) OpenService, to get a handle to the desired service.
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
3) StartService
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
4) CloseServiceHandle (for the handle returned in #2)
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
5) CloseServiceHandle (for the handle returned in #1)
Regards,
Mark
Sounds like you want to do this under program control...
Although I've not tried this myself, it looks like you'd need to perform the following steps using Windows API calls:
1) OpenSCManager, to open the service control manager on the desired machine
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
2) OpenService, to get a handle to the desired service.
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
3) StartService
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
4) CloseServiceHandle (for the handle returned in #2)
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
5) CloseServiceHandle (for the handle returned in #1)
Regards,
Mark
Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA
Once you have ads running and set-up on a server, it should be set to start automatically when the server reboots. if you're getting 6420's, something is wrong with your set-up.. in over 10 years of running ads, we haven't had more than 1 or 2 instances of the ads server going down...
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA
I use the ADS API below to check if ADS service is running:
nRetVal := AdsIsServerLoaded(LEFT(DC_Path(AppName(.t.)),2), @nServerLoaded )
IF nRetVal is 6420, then ADS service is not running and I would like to start it.
Thanks
Joe
nRetVal := AdsIsServerLoaded(LEFT(DC_Path(AppName(.t.)),2), @nServerLoaded )
IF nRetVal is 6420, then ADS service is not running and I would like to start it.
Thanks
Joe
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA
Why would the ADS server not normally be loaded. I like Brian have normally never seen that to be an issue.
Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA
It has happened in 2 of my clients sites
Joe
Joe