vfp9 force network machines to quit vfp9 programme

Hi Experts
I have an application running on LAN and sometime at the close of the day some LAN machines are left running VFP9 application. I would like to quit programme on LAN machines  from Server before I turn the server off. I can provide the IP address of all LAN machines. Is there a way to force quit LAN machines from server through VFP9 programming.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Many ways to achieve this requirement exist.

1) Shared network table (easy and reliable enough)
Open given shared network table and check its record periodically in a timer which fires every minute. Timer code:
LOCAL lnWorkArea
lnWorkArea = SELECT(0)
USE d:\NetworkPath\SharedTable
IF ShutDownRq  
  DO AppExitProcedure
SELECT (m.lnWorkArea)

You may instantiate the Timer on the _screen:
_screen.AddObject('ShutDownTimer', 'MyTimer')
and the MyTimer class (with above Timer event) must be defined in your code or VCX library.

Once you replace the SharedTable.ShutDownRq field by .T. all running instances of your app will exit when their timer fire.

2) Public OLE object
You may define Public OLE class which contains Exit procedure in your app:
    *-- You may check the call validity here
    DO AppExitProcedure

And now you may call this class by CREATEOBJECT() or CREATEOBJECTEX() from any computer. This way requires a setup which is not trivial in some cases... More info: http://msdn.microsoft.com/en-us/library/ms917477.aspx

3) Network messaging
You may use Windows network functionality in VFP. It requires some ports open (and some donations...). More info: http://www.news2news.com/vfp/?example=410

Remember the fact if the client PC application becomes frozen the only way how to close all files is to force LAN PC disconnection from the server.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Olaf DoschkeSoftware DeveloperCommented:
If you have the needed privileges you could even shutdown the whole client/windows via:http://www.news2news.com/vfp/?example=122&function=-18

You can also simply disconnect the server from LAN to gain exclusive access to local files. The hard way is to restart the server.

Bye, Olaf.

PS: If it's about the EXE on the server, you shouldn't let users run the exe from there, because of problems with shared file usage. The EXE should be copied to clients before being run. It runs there anyway, no matter if they start it from their local or a mapped drive it runs on their client. A good idea would be to give them a link to a cmd using xcopy or robocopy for updating them and starting the copied EXE.

What remains is the need to get exclusive access to central dbfs, of course you don't copy them to local. One solution for that is like Pavel has given you, another is to disconnect when needed to update the database and a third of course is to move from dbfs to an sql server.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.