Re: How to detect my application is currently running

Tech-Archive recommends: Fix windows errors by optimizing your registry



"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.


.



Relevant Pages

  • Re: Network access
    ... multiple times by the same user or by multiple users. ... folder in which the app resides. ... "All computers on the network are Vista Home Premium" ...
    (microsoft.public.access.modulesdaovba)
  • Re: Network access
    ... multiple times by the same user or by multiple users. ... folder in which the app resides. ... "All computers on the network are Vista Home Premium" ...
    (microsoft.public.access.modulesdaovba)
  • RE: Network access
    ... simultaneously by multiple users. ... network, but not two at once, unless the second instance is from the ... folder in which the app resides. ... All computers on the network are Vista Home Premium. ...
    (microsoft.public.access.modulesdaovba)
  • Network access
    ... I have an Access VBA app on a network folder that I'd like to run simultaneously by multiple users. ... I can run one instance over the network, but not two at once, unless the second instance is from the folder in which the app resides. ...
    (microsoft.public.access.modulesdaovba)
  • Re: ODBC Connection with SQL Managed Provider
    ... One thing to remember is when running application from a network share, ... > So it was our intent to put a lot of the "forms" into the main app. ... the odbc manager is no quicker than the odbc. ... >>> authorizing the user against a table in the SQL server database. ...
    (microsoft.public.dotnet.framework.adonet)