• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

Close MS Access 2007 program after cancelling the login prompt of a mdw protected database

my front end Access 2007 database is secured with an MDW file (via a shortcut, see below). If a user launches the database, they are prompted for a logon (as expected). However, if they cancel the logon screen, the database closes, but MS Access stays open. How do I make it so MS Access quits if they cancel the logon?

The shortcut launches the front end DB via this command " 
MSACCESS.EXE "%userprofile%\Mars\MARS.mdb" /WRKGRP "\\server\db\Service.mdw"

1 Solution
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:

  Interesting and I had never thought of that before.

  Short answer is I don't think you can.  User level (workgroup) security is built-in and there is no real control over the login process.

  As a work around, your going to need to use some type of a launcher app, which could handle the login dialog and then using a command line with the /user and /pwd switches to pass the username and password in.

  This will by-pass the Access built-in dialog.

  One such launcher program is Tony's Auto Updater:


  However it is no longer free.  You also could write your own in VB/VB.net or some other language.  Would be simple enough.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Tony gave a demo at the Summit.  It's pretty cool, lots of new functionality.  I can see why it's no longer free.

nkraemerAuthor Commented:
Any settings that allow Access to close once the current DB is closed? Even if a MDW security file isn't used?  
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<Any settings that allow Access to close once the current DB is closed? Even if a MDW security file isn't used?  >>

  No, but you can issue an application.quit in a macro or code, which shuts Access down.  But since you have not gotten that far at the point of the login, you can't even do that.

And in A2010/accdb, no more user level security, so might be time to find another method, i.e. write your own login process in Access. If you do this you will be able to exit on incorrect login. I am currently in the middle of such a project (and will definitely keep this question in mind, as it will be a nice touch), but it will be a few weeks before I am done.

Chris B
nkraemerAuthor Commented:
I ended up using the /user /pwd switch to launch via a batch command.
nkraemerAuthor Commented:
The answer didn't fit my need completely, but only because Microsoft doesn't offer a solution. This answer helped me find a way to the solution
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now