Answered by:
Keep mdb from opening depending on version of Access used

Question
-
Is it possible to keep an Access 2007 mdb from opening in other versions of Access besides Access 2007?
I'm in charge of keeping an Access 2007 mdb up-to-date and working for about 25 people. Most of these people do not have a full version of Access and use a runtime. All works well until a person that does have a full version, greater than 2007, opens the mdb. Fortunately that doesn't happen very often but when it does it causes some problems.
I opened it this morning using a full version of 2007. I know that someone opened it earlier in a full version 2016. That caused the references to attach to newer versions of dll's then what the mdb could handle. It's easy enough to correct the references but it would be nicer to just keep that person from opening it.
I wish it were a simple matter of upgrading to 2016. But it is not that simple.
Thanks for your help.
emcustom
Wednesday, February 1, 2017 5:37 PM
Answers
-
Hi emcustom,
you had mentioned that you don't want that user open database in higher version of Access then 2007.
so you can try to add "AutoExec Macro" in your database.
this macro will execute automatically when someone opens a database.
so at this stage you can check the MS Access Version.
if version is not 12.0 then you can simply close the database with message that you can't open a database in this version of Access application. try to open the database with Access 2007.
below is the code to get version of Access.
Sub demo() If Application.Version = 16# Then MsgBox "You are currently running Microsoft Access version 2016 , " & Application.Version Else MsgBox "you can't open database with this version..." CurrentDb.Close End If End Sub
this example I tested with Access 2016, you just need to change the 12.0 instead of 16.0 to work with Access 2007.
Output:
if it is not a correct version then it will close the database with message.
please refer the link below to know how to create "Autoexec Macro".
Create a macro that runs when you open a database
Note:-
To bypass the AutoExec macro and other startup options, hold down the SHIFT key while you start the database. For more information.
so in this condition it will not check and open the db. it is disadvantage of this approach here.
Regards
Deepak
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- Marked as answer by emcustom Thursday, February 2, 2017 7:58 PM
Thursday, February 2, 2017 1:07 AM -
All replies
-
Is it possible to keep an Access 2007 mdb from opening in other versions of Access besides Access 2007?
Hi emcustom,
Do your development in A2007, and give the users a copy of this application.
I still develop in A2003, while the users version range from A2003 to A2016.
Imb.
Wednesday, February 1, 2017 8:38 PM -
Hi emcustom,
you had mentioned that you don't want that user open database in higher version of Access then 2007.
so you can try to add "AutoExec Macro" in your database.
this macro will execute automatically when someone opens a database.
so at this stage you can check the MS Access Version.
if version is not 12.0 then you can simply close the database with message that you can't open a database in this version of Access application. try to open the database with Access 2007.
below is the code to get version of Access.
Sub demo() If Application.Version = 16# Then MsgBox "You are currently running Microsoft Access version 2016 , " & Application.Version Else MsgBox "you can't open database with this version..." CurrentDb.Close End If End Sub
this example I tested with Access 2016, you just need to change the 12.0 instead of 16.0 to work with Access 2007.
Output:
if it is not a correct version then it will close the database with message.
please refer the link below to know how to create "Autoexec Macro".
Create a macro that runs when you open a database
Note:-
To bypass the AutoExec macro and other startup options, hold down the SHIFT key while you start the database. For more information.
so in this condition it will not check and open the db. it is disadvantage of this approach here.
Regards
Deepak
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- Marked as answer by emcustom Thursday, February 2, 2017 7:58 PM
Thursday, February 2, 2017 1:07 AM -
-
I get the distinct impression that you have this application in a shared location on some server, and that all users open it from there. Can you confirm?
If so, that's a REALLY BAD IDEA and should be fixed right away. The only reliably working deployment is to split the database into front-end and back-end and for each user to have the FE on their local machine. Anything else is asking for trouble.
-Tom. Microsoft Access MVP
Thursday, February 2, 2017 4:52 AM -
You are right, Tom, both in your impression and opinion that it's a bad idea. But you know how it is when you inherit something and you see that it should be fixed right away. "Since it's worked successfully for a long time like this, even before you got here, we see no reason to change it" (almost verbatim from a dot-net programmer with no Access experience).
Thanks for your replies.
emcustom
Thursday, February 2, 2017 8:05 PM