Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vfp7 prg as a System's Service

Status
Not open for further replies.

MrDontKnowNothing

Programmer
Jun 26, 2003
94
DE
hi folks,

i do have a little *.prg, wich does some queries on some tables and puts the result on my webserver.

now, i need that *.prg as a system's service on windows2000, so that no user has to be logged in in order to run the update.

funny thing is: i used the windows 2000 resource kit, wich makes out of any *.exe a system service, but it didn't work with my *.prg, although i saw it in the task manager.

any hints in this direction appreciated!

thanks

alex
 
The funny thing about running apps as a service is there is the issue of trapping errors, since the "service" usally does not interact with the desktop sometimes getting them to run takes a little debugging to see exactally what is failing. I use several VFP "services" and they behave like I expect them to but it can take a bit to get the desired result. Some common issues with this type of setup are "looking for mapped drives that do not exist", "Permissions to perform the oporation needed", "Dependicies on other services not yet started" among other things. To start off I would insert an ON ERROR statement that will write minor info to a .txt file even if it is just


procedure Service_error
parameter serv_error_code
list memo to file c:\service_error.txt
quit


in my code add

on error do service_error with error()


you will want to test this just like it happens usally buy booting the server, not logging on until you are sure the service did or did not do what it is supposed to do.


Steve Bowman
steve.bowman@ultraex.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top