我已经继承了一个MS Access项目,我试图对一些表单进行更改。 但是,当我在MS Access 2016中打开文件时,我无法看到导航菜单,顶部功能区或编辑设计以进行任何更改。 我已经搜索过有几种方法可以绕过这一点,但也发现它们中的每一个都可能被开发人员拒绝。 如果每个人都可以被禁止,另一个开发人员将如何进行更改?
以下是我尝试过的:
压下F11但没有出现 双击文件时保持SHIFT点击,但没有显示 按CTRL + G打开VBE,但没有任何显示有没有其他方法可以查看此访问数据库上的编辑,导航和功能区菜单,以便我可以对其进行更改?
I've inherited an MS Access project and I'm trying to make changes to some of the forms. However, when I open the file in MS Access 2016, I'm not able to see the navigation menu, top ribbon, or the edit design in order to make any changes. I've searched that there are several ways to bypass this but also found out that each one of them can be disallowed by the developer. If each one can be disallowed, how would another developer make changes?
Below is what I've tried:
Pressed F11 but nothing shows up Keep SHIFT clicked while double clicking the file but nothing shows up Pressed CTRL+G to open VBE but nothing shows upAre there any other ways for me to view edit, navigation, ribbon menus on this access database so that I can make changes to it?
最满意答案
是的,您可以轻松绕过使用OLE自动化的这种“安全”措施。
从另一个Access数据库(或VBA应用程序)使用以下代码
Public Sub UnlockAccess() Dim pathToFile As String pathToFile = "C:\Path\To\My\File.accdb" Dim db As DAO.Database Set db = DBEngine.OpenDatabase(pathToFile) 'Set some restrictive properties back to normal On Error Resume Next db.Properties!StartUpShowStatusBar = True db.Properties!AllowFullMenus = True db.Properties!AllowShortcutMenus = True db.Properties!AllowBuiltInToolbars = True db.Properties!AllowSpecialKeys = True db.Properties!AllowToolbarChanges = True db.Properties!AllowByPassKey = True db.Close On Error GoTo 0 Stop 'You can open up the database using the shift bypass key here, and enable whatever you want' Dim app As New Access.Application app.OpenCurrentDatabase pathToFile app.Visible = True app.UserControl = True app.DoCmd.SelectObject acTable, , True End Sub另一种修改安全性的方法是修改限制性VBA代码。 如果无法直接从文件打开编辑器,则可以打开另一个文件,设置对要修改的文件的引用,然后从中修改该文件。
Yes, you can easily bypass such "security" measures using OLE automation.
Use the following code from another Access database (or VBA application)
Public Sub UnlockAccess() Dim pathToFile As String pathToFile = "C:\Path\To\My\File.accdb" Dim db As DAO.Database Set db = DBEngine.OpenDatabase(pathToFile) 'Set some restrictive properties back to normal On Error Resume Next db.Properties!StartUpShowStatusBar = True db.Properties!AllowFullMenus = True db.Properties!AllowShortcutMenus = True db.Properties!AllowBuiltInToolbars = True db.Properties!AllowSpecialKeys = True db.Properties!AllowToolbarChanges = True db.Properties!AllowByPassKey = True db.Close On Error GoTo 0 Stop 'You can open up the database using the shift bypass key here, and enable whatever you want' Dim app As New Access.Application app.OpenCurrentDatabase pathToFile app.Visible = True app.UserControl = True app.DoCmd.SelectObject acTable, , True End SubAn alternate way to modify security is to modify the restrictive VBA code. If you can't open the editor directly from the file, you can open another file, set a reference to the file you want to modify, and modify it from there.
更多推荐
发布评论