Solved

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

Posted on 2011-03-17
7
289 Views
Last Modified: 2012-05-11
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"

0
Comment
Question by:nkraemer
7 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 35165285

  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:

http://autofeupdater.com/
 

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

JimD.
0
 
LVL 75
ID: 35166870
Tony gave a demo at the Summit.  It's pretty cool, lots of new functionality.  I can see why it's no longer free.

mx
0
 
LVL 1

Author Comment

by:nkraemer
ID: 35168095
Any settings that allow Access to close once the current DB is closed? Even if a MDW security file isn't used?  
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 57
ID: 35168545
<<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.

JimD.
0
 
LVL 28

Expert Comment

by:burrcm
ID: 35174437
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
0
 
LVL 1

Author Comment

by:nkraemer
ID: 35315873
I ended up using the /user /pwd switch to launch via a batch command.
0
 
LVL 1

Author Closing Comment

by:nkraemer
ID: 35315906
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
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
unable to save new report from old one 9 25
access pop-up form 3 30
How to run a VBS file in a MS access macro? 2 27
DCount Type Mismatch 2 21
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now