无法在 MS Access DB 中查看导航和功能区
Unable to view Navigation and Ribbon in MS Access DB
我继承了一个 MS Access 项目,我正在尝试对某些表单进行更改。但是,当我在 MS Access 2016 中打开文件时,无法看到导航菜单、顶部功能区或编辑设计,无法进行任何更改。我搜索过有几种方法可以绕过这个,但也发现开发人员可以禁止其中的每一种方法。如果每一个都可以被禁止,那么其他开发人员将如何进行更改?
以下是我试过的:
- 按了 F11 但没有任何显示
- 双击文件时按住 SHIFT 键但没有任何显示
- 按 CTRL+G 打开 VBE 但没有任何显示
是否有任何其他方法可以让我查看此访问数据库上的编辑、导航、功能区菜单,以便我可以对其进行更改?
是的,您可以使用 OLE 自动化轻松绕过此类 "security" 措施。
使用来自另一个 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 代码。如果无法直接从文件打开编辑器,可以打开另一个文件,设置对要修改的文件的引用,然后从那里修改它。
我继承了一个 MS Access 项目,我正在尝试对某些表单进行更改。但是,当我在 MS Access 2016 中打开文件时,无法看到导航菜单、顶部功能区或编辑设计,无法进行任何更改。我搜索过有几种方法可以绕过这个,但也发现开发人员可以禁止其中的每一种方法。如果每一个都可以被禁止,那么其他开发人员将如何进行更改?
以下是我试过的:
- 按了 F11 但没有任何显示
- 双击文件时按住 SHIFT 键但没有任何显示
- 按 CTRL+G 打开 VBE 但没有任何显示
是否有任何其他方法可以让我查看此访问数据库上的编辑、导航、功能区菜单,以便我可以对其进行更改?
是的,您可以使用 OLE 自动化轻松绕过此类 "security" 措施。
使用来自另一个 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 代码。如果无法直接从文件打开编辑器,可以打开另一个文件,设置对要修改的文件的引用,然后从那里修改它。