HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STARTED

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STARTED

#1 Post by unixkd »

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

Cliff Wiernik
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

#2 Post by Cliff Wiernik »

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.

mzipkin
Posts: 15
Joined: Thu May 13, 2010 8:27 pm

Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA

#3 Post by mzipkin »

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

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA

#4 Post by bwolfsohn »

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

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA

#5 Post by unixkd »

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

Cliff Wiernik
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

#6 Post by Cliff Wiernik »

Why would the ADS server not normally be loaded. I like Brian have normally never seen that to be an issue.

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: HOW CAN I START ADS SERVICE ON A GIVEN SERVER IF NOT STA

#7 Post by unixkd »

It has happened in 2 of my clients sites

Joe

Post Reply