Re: How to detect my application is currently running
- From: "Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 23 Oct 2008 23:01:19 -0700
"Noel Rico Tecson" <noeltecson@xxxxxxxxx> wrote in message
news:OE0BOKZNJHA.3804@xxxxxxxxxxxxxxxxxxxxxxx
Thanks to everyone, the code below works.
Private Sub Form_Load()
If App.PrevInstance = True Then End
I will try if I put the application in shared folder in the local area
network.
PrevInstance has no way of preventing multiple users on separate computers.
Only multiple copies on the same computer. There are better (and more
complicated) ways of preventing multiple instances, but even those won't
help prevent multiple users on a network.
If you have write access to the folder that contains the app, you can (in
theory, anyway) create a file on startup... and delete it when shutting
down. Now, if another user attempts to run the app, it should have code to
see if that file exists. If so, tell the user someone else is using the app
and shut it down... Also, if the app (or server) crashes, you'll have that
orphan file you'll need to get rid of.
No matter what method you choose... don't use the End keyword to close an
app. End is kinda like turning off the engine in your car to make it stop,
instead of using the brakes.
.
- References:
- Re: How to detect my application is currently running
- From: sven2000
- Re: How to detect my application is currently running
- From: Noel Rico Tecson
- Re: How to detect my application is currently running
- Prev by Date: Re: How to detect my application is currently running
- Next by Date: Re: (1/2 OT) Reasons to begin with .Net
- Previous by thread: Re: How to detect my application is currently running
- Next by thread: Re: How to detect my application is currently running
- Index(es):
Relevant Pages
|