Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Security / August 2004

Tip: Looking for answers? Try searching our database.

Preventing mulitple instances of Access Database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob Mullen - 22 Aug 2004 16:53 GMT
Our database is running on a single workstation. It is an Windows XP based
system with only one account. Pretty straight-forward (I think). I need to
prevent the user from inadvertently opening a second or third or fourth
instance of the application (users are not highly skilled computer users).

Signature

Thanks in advance.

Bob Mullen

Jeff Conrad - 23 Aug 2004 07:11 GMT
Hi Bob,

The following link should be just what you are looking for:

http://www.mvps.org/access/api/api0041.htm

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

> Our database is running on a single workstation. It is an Windows XP based
> system with only one account. Pretty straight-forward (I think). I need to
> prevent the user from inadvertently opening a second or third or fourth
> instance of the application (users are not highly skilled computer users).
Bob Mullen - 23 Aug 2004 13:47 GMT
Thanks Jeff:

Could you give me a little direction as to how this code is to be
implemented in Windows XP Pro?

Bob

> Hi Bob,
>
[quoted text clipped - 6 lines]
> > prevent the user from inadvertently opening a second or third or fourth
> > instance of the application (users are not highly skilled computer users).
Jeff Conrad - 24 Aug 2004 01:56 GMT
Hi Bob,

I'm sure there are lots of ways to do this, but here is the method I use.

1. Copy and paste all the code to a new standard module.

2. Compile the code and save the module as modCheckMultipleInstances.

3. Create a new macro.

4. In the Action column select RunCode from the drop down list.

5. A new box in the bottom left corner will appear asking for a function name.

6. Enter this in the Function name box:   =winCheckMultipleInstances(False)
(Include the equal sign)
Now I selected False which meant there is no prompt to the user.
You can experiment with True to see what that does.

7. Now save the macro with a name called Autoexec.
With this name, this particular macro will fire any time this database is opened, unless of course
they hold down the shift key. (That can be disabled as well) If you have already created an Autoexec
macro just add this RunCode option at the bottom of any existing elements.

8. Make sure you set an application title under Tools | Startup | Application Title

9. Now save everything and close the database

10. Open the database, minimize, and then try and open another instance.
You should see some screen flickering, but only one instance in the Task Bar should show.

Hope that helps,

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

> Thanks Jeff:
>
[quoted text clipped - 13 lines]
> > > prevent the user from inadvertently opening a second or third or fourth
> > > instance of the application (users are not highly skilled computer users).
Bob Mullen - 24 Aug 2004 04:31 GMT
Thanks again Jeff. It works perfectly.

Bob

> Hi Bob,
>
[quoted text clipped - 46 lines]
> > > > prevent the user from inadvertently opening a second or third or fourth
> > > > instance of the application (users are not highly skilled computer users).
Jeff Conrad - 24 Aug 2004 06:33 GMT
Excellent, glad to help.

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

> Thanks again Jeff. It works perfectly.
>
[quoted text clipped - 50 lines]
> > > > > prevent the user from inadvertently opening a second or third or fourth
> > > > > instance of the application (users are not highly skilled computer users).
Lorenzo - 23 Aug 2004 16:35 GMT
A very simple method can be to open a dummy file in exclusive mode.
If a user open other istance of the application the system prompt and close
the secondary istance.
Put in main startup code or in open event of your main form :

   On Error GoTo noduplicate
   close #1
   Open "path\dummy.pid" For Output Access Write Lock Read Write As #1
   On Error GoTo 0

   noduplicate:
       msgbox "Another application is running"
       Application.quit

If this can help you
Lorenzo

> Our database is running on a single workstation. It is an Windows XP based
> system with only one account. Pretty straight-forward (I think). I need to
> prevent the user from inadvertently opening a second or third or fourth
> instance of the application (users are not highly skilled computer users).
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.