This video is the second in a 2-part series. It demonstrates a simple method to prevent users accessing the tables, queries and macros to protect your data. This is designed to block knowledgeable users from meddling with your database. The ideas build on the approach used in the earlier article, https://isladogs.co.uk/protect-data-tables-queries and video: https://www.youtube.com/watch?v=6coPMh8My44, in which tables & queries were made read only.
This was made possible by the fact that tables & queries behave in many ways like datasheet forms with similar code used to manage their properties.
In this new example, users cannot view the data in tables and queries, nor copy or export objects to another application. They will also be unable the code used in the visual basic editor - access to the VBE is blocked even in an ACCDB file.
Related article with example app and all code: https://isladogs.co.uk/lock-down-database-objects
Times:
0:00 Intro
0:23 Outline of the approach used
1:17 DEMO - users can open forms and reports as normal either from a switchboard menu or the navigation pane (if it is visible)
1:58 However if tables/queries are opened, these are immediately closed
2:24 Right click context menus disabled also disabled in Access options - cannot copy data or export objects to another application
2:32 Users cannot open the Visual Basic Editor to voew code using default shortcut keys (also disabled)
2:55 The VBE is immediately closed if opened using the ribbon / quick access toolbar (QAT).
3:15 Explanation of how the code works unlock database using shortcut key set in an autokeys macro. This allows the VBE to be opened
3:42 Hidden form frmHide runs from autoexec macro at startup and stays open until trhe app is closed. Timer event runs every 0.5 seconds and runs 3 lines of code:
4:04 BlockViewTableQuery function in modSecurity checks for the currently active datasheet and closes it immediately if its a table or query. Same code allows datasheet forms to stay open
5:24 UnlockApp code used in this video closes the hidden form frmHide so tables & queries can be opened normally. LockApp function reverses this change
6:26 ModifyStartupProps function runs from autoexec macro to lock down the database - can over ride this for development purposes
7:53 Thanks for watching. Please like, leave a comment & subscribe.
9 Comments