隐藏访问选项

发布于 2024-12-11 19:23:17 字数 136 浏览 0 评论 0原文

我注意到,即使当您禁用“使用访问特殊键”、禁用“显示导航窗格”并禁用功能区菜单时,您也可以轻松访问“访问选项”,转到当前数据库区域,然后重新启用所有这些选项。

有没有办法完全隐藏 Access 2007 和 2010 中的“当前数据库”选项?

I have noticed that even though when you disable the “Use Access Special Keys”, disable the “Display Navigation Pane”, and disable the ribbon menus, you can easily access the “Access Options” go to the current Database area, and re-enable all these options.

Is there a way to completely hide the “Current Database” option in Access 2007 and 2010?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

你是年少的欢喜 2024-12-18 19:23:17

在 MS Access 2007 和 MS Access 2010 中,不是使用设置选项来控制用户的访问应用程序后,可以控制“后台”的内容。所有图像和说明均适用于 Access 2010,但 2007 没有太大不同。首先阅读自定义功能区

后台

在此处输入图像描述

首先,右键单击导航窗格顶部的导航栏,然后单击导航选项在快捷菜单上。在“导航选项”对话框中的“显示选项”下,选中“显示系统对象”复选框,然后单击“确定”。这将允许您看到您创建的表。请注意,这适用于所有数据库,因此您可能希望在完成后将其关闭。

接下来,在“选项”下,选择“客户端设置”并向下滚动到“常规”。您将看到显示加载项用户界面错误,请确保选中它。

您将需要一个名为 USysRibbons 的表:

Create Table USysRibbons (ID Counter Primary Key, 
                          RibbonName Text(255),RibbonXml Memo)

您可能希望向 RibbonName 添加唯一索引,否则最终可能会得到多个同名的功能区。

您将需要一些 XML,您只需剪切并粘贴到新创建的表中即可。

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
       <!-- Ribbon XML -->
  </ribbon>
  <backstage>
   <button idMso="FileSave" visible="false"/>
   <button idMso="SaveObjectAs" visible="false"/>
   <button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
   <button idMso="FileOpen" visible="false"/>
   <button idMso="FileCloseDatabase" visible="false"/>
   <tab idMso ="TabInfo" visible="false"/>
   <tab idMso ="TabRecent" visible="false"/>
   <tab idMso ="TabNew" visible="false"/>
   <tab idMso ="TabPrint" visible="false"/>
   <tab idMso ="TabShare" visible="false"/>
   <tab idMso ="TabHelp" visible="false"/>
   <button idMso="ApplicationOptionsDialog" visible="false"/>
   <button idMso="FileExit" visible="false"/>
  </backstage>
</customUI>

将功能区名称设置为“BackstageCustom”。哪条线与后台的哪个部分相关应该是相当明显的。

您现在必须关闭并重新打开数据库(压缩和修复可能是执行此操作的最快方法,但请确保在使用此方法之前有备份)。这里面会有很多的开场和结束。

您现在可以转到“选项”->“当前数据库”并向下滚动到“功能区和工具栏选项”,在“功能区名称”下选择新创建的功能区。当您关闭选项时,您将收到一条警告,提示您必须关闭并打开数据库才能使更改生效。

当您这样做时,您将无法再看到后台的选项,除了最近的数据库列表之外,您也看不到太多内容。查看上面的 XML,您可以看到所有内容都设置为 false。

我认为摆脱这种情况的最简单方法是打开 USysRibbons 表并更改此行:

<button idMso="ApplicationOptionsDialog" visible="false"/>

再次打开

<button idMso="ApplicationOptionsDialog" visible="true"/>

并关闭,然后从“选项”下的“功能区名称”中删除功能区。打开和关闭,您或多或少会回到起点。

In MS Access 2007 and MS Access 2010, rather than setting options to control a user's access to the application, it is possible to control the contents of the "Backstage". All images and instructions apply to Access 2010, but 2007 is not very different. Read Customize the Ribbon first.

Backstage

enter image description here

First, right-click the Navigation Bar at the top of the Navigation Pane, and then click Navigation Options on the shortcut menu. In the Navigation Options dialog box, under Display Options, select the Show System Objects check box, and then click OK. This will allow you to see the table you create. Note that is applies to all databases, so you may wish to switch it back off when you are finished.

Next, under Options, choose Client Settings and scroll down to General. You will see Show add-in user interface errors, make sure it is selected.

You will need a table called USysRibbons:

Create Table USysRibbons (ID Counter Primary Key, 
                          RibbonName Text(255),RibbonXml Memo)

You might like to add a unique index to RibbonName, otherwise you could end up with more than one ribbon with the same name.

You will need some XML, you can just cut and paste into the newly created table.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
       <!-- Ribbon XML -->
  </ribbon>
  <backstage>
   <button idMso="FileSave" visible="false"/>
   <button idMso="SaveObjectAs" visible="false"/>
   <button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
   <button idMso="FileOpen" visible="false"/>
   <button idMso="FileCloseDatabase" visible="false"/>
   <tab idMso ="TabInfo" visible="false"/>
   <tab idMso ="TabRecent" visible="false"/>
   <tab idMso ="TabNew" visible="false"/>
   <tab idMso ="TabPrint" visible="false"/>
   <tab idMso ="TabShare" visible="false"/>
   <tab idMso ="TabHelp" visible="false"/>
   <button idMso="ApplicationOptionsDialog" visible="false"/>
   <button idMso="FileExit" visible="false"/>
  </backstage>
</customUI>

Set the Ribbon Name to say, "BackstageCustom". It should be fairly obvious which line relates to which part of the Backstage.

You now have to close and reopen the database (Compact & Repair is probably the quickest way to do this, but make sure you have a backup before you use this method). There will be a lot of opening and closing in this.

You can now go to Options->Current Database and scroll down to Ribbon and Toolbar Options, select the newly created ribbon under Ribbon Name. When you close Options, you will get a warning that you must close and open the database for the changes to take effect.

When you do, you will no longer be able to see Options on the backstage, nor will you see much except a list of recent databases. Look at the XML above, you can see that everything is set to false.

I reckon the easiest way out of the situation is to open the USysRibbons table and change this line:

<button idMso="ApplicationOptionsDialog" visible="false"/>

to

<button idMso="ApplicationOptionsDialog" visible="true"/>

Open and close again, and remove the ribbon from Ribbon Name, under Options. Open and close and you are back to where you started, more or less.

流殇 2024-12-18 19:23:17

为了补充 Fionnuala 的出色答案,Access 2013 在“文件”菜单中有不同的选项,因此需要稍微修改 XML。严格遵循答案,但用此替换 XML,这会隐藏“选项”菜单并保留“打印”和“退出”。

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
       <!-- Ribbon XML -->
  </ribbon>
  <backstage>
   <button idMso="ApplicationOptionsDialog" visible="false"/>
  </backstage>
</customUI>

To add to Fionnuala's excellent answer, Access 2013 has different options in the FILE menu so the XML needs to be slightly modified. Follow the answer exactly but replace the XML with this, which hides the Options menu and leaves Print and Exit.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
       <!-- Ribbon XML -->
  </ribbon>
  <backstage>
   <button idMso="ApplicationOptionsDialog" visible="false"/>
  </backstage>
</customUI>
牵强ㄟ 2024-12-18 19:23:17

所有,

我花了很多时间......在很多网站上......

这里的XML将:

  • 禁用QAT
  • 禁用“数据库选项”
  • 禁用“另存为”
  • 禁用“关闭”(这样你就可以以编程方式控制发生的情况)
  • 仅启用“Home”选项卡...我实际上从头开始重建了它

这段代码几乎“完全”看起来像 MS Access 2013 中的标准“HOME”选项卡。

您可以使用它来真正锁定您的应用程序...结合一些好的代码来禁用特殊键在启动时等。

你可以这样做:

   <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="true">
       <!-- Ribbon XML -->
       <tabs>
           <tab id="dbCustomHome" label="HOME" visible="true">
           <group id="dbViews" label="Views">
                   <control idMso="ViewsSwitchToDefaultView" size="large" label="View" enabled="true"/>
               </group>
           <group id="dbClipboard" label="Clipboard">
                   <control idMso="PasteSpecial" size="large" label="Paste" enabled="true"/>
           <control idMso="Cut" label="Cut" enabled="true"/>
                   <control idMso="Copy" label="Copy" enabled="true"/>
                   <control idMso="FormatPainter" label="Format Painter" enabled="true"/>
               </group>
           <group id="dbSortFilter" label="Sort and Filter">
                   <control idMso="FiltersMenu" size="large" label="Filter" enabled="true"/>
           <control idMso="SortUp" label="Ascending" enabled="true"/>
                   <control idMso="SortDown" label="Descending" enabled="true"/>
                   <control idMso="SortRemoveAllSorts" label="Remove Sort" enabled="true"/>
                   <control idMso="SortSelectionMenu" label="Selection" enabled="true"/>
                   <control idMso="FilterAdvancedMenu" label="Advanced" enabled="true"/>
                   <control idMso="FilterToggleFilter" label="Toggle Filter" enabled="true"/>
               </group>
           <group id="dbRecords" label="Records">
                   <control idMso="DataRefreshAll" size="large" label="Refresh All" enabled="true"/>
           <control idMso="GoToNewRecord" label="New" enabled="true"/>
                   <control idMso="RecordsSaveRecord" label="Save" enabled="true"/>
                   <control idMso="Delete" label="Delete" enabled="true"/>
                   <control idMso="RecordsTotals" label="Totals" enabled="true"/>
                   <control idMso="SpellingAccess" label="Spelling" enabled="true"/>
                   <control idMso="RecordsMoreRecordsMenu" label="More" enabled="true"/>
               </group>
           <group id="dbFind" label="Find">
                   <control idMso="FindDialog" size="large" label="Find" enabled="true"/>
           <control idMso="ReplaceDialog" label="Replace" enabled="true"/>
                   <control idMso="GoToMenuAccess" label="Go To" enabled="true"/>
                   <control idMso="SelectMenuAccess" label="Select" enabled="true"/>
               </group>
           <group id="dbTextFormat" label="Text Formatting" centerVertically="true">
            <box id="TopBx">
                       <control idMso="Font" enabled="true"/>
               <control idMso="FontSize" enabled="true"/>
               <buttonGroup id="buttonGroup_TopRow">
                           <control idMso="Bullets" enabled="true"/>
                           <control idMso="Numbering" enabled="true"/>
                           <separator id="separator1" />
                           <control idMso="IndentIncrease" enabled="true"/>
                           <control idMso="IndentDecrease" enabled="true"/>
                           <separator id="separator2" />
                           <control idMso="AlignLeftToRightMenu" enabled="true"/>
                       </buttonGroup>
                    </box>
                    <box id="BottomBx">
                        <buttonGroup id="buttonGroup_BottomRow">
                           <control idMso="Bold" enabled="true"/>
                           <control idMso="Italic" enabled="true"/>
                           <control idMso="Underline" enabled="true"/>
                           <separator id="separator3" />
                           <control idMso="FontColorPicker" enabled="true"/>
                           <control idMso="TextHighlightColorPicker" enabled="true"/>
                           <control idMso="FontFillBackColorPicker" enabled="true"/>
                           <separator id="separator4" />
                           <control idMso="AlignLeft" enabled="true"/>
                           <control idMso="AlignCenter" enabled="true"/>
                           <control idMso="AlignRight" enabled="true"/>
                           <separator id="separator5" />
                           <control idMso="DatasheetGridlinesMenu" enabled="true"/>
                           <separator id="separator6" />
                           <control idMso="FontAlternateFillBackColorPicker" enabled="true"/>
                        </buttonGroup>
                    </box>
               </group>
           </tab>
       </tabs>
  </ribbon>
  <backstage>
      <tab idMso="TabSave" visible="false" > </tab>
      <button idMso="ApplicationOptionsDialog" visible="false"/>
      <button idMso="FileCloseDatabase" visible="false"/>
  </backstage>
</customUI>

All,

I've spent a lot of time ... on a lot of websites ...

Here's XML that will:

  • Disable QAT
  • Disable "Database Options"
  • Disable "Save As"
  • Disable "Close" (so you can programmatically control what happens)
  • Enable only the "Home" TAB ... I actually rebuilt it from scratch

This code pretty much "exactly" looks like the standard "HOME" tab in MS Access 2013.

You can use this to really lock down your app ... in combination with some good code to disable special keys at startup, etc.

Here ya go:

   <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="true">
       <!-- Ribbon XML -->
       <tabs>
           <tab id="dbCustomHome" label="HOME" visible="true">
           <group id="dbViews" label="Views">
                   <control idMso="ViewsSwitchToDefaultView" size="large" label="View" enabled="true"/>
               </group>
           <group id="dbClipboard" label="Clipboard">
                   <control idMso="PasteSpecial" size="large" label="Paste" enabled="true"/>
           <control idMso="Cut" label="Cut" enabled="true"/>
                   <control idMso="Copy" label="Copy" enabled="true"/>
                   <control idMso="FormatPainter" label="Format Painter" enabled="true"/>
               </group>
           <group id="dbSortFilter" label="Sort and Filter">
                   <control idMso="FiltersMenu" size="large" label="Filter" enabled="true"/>
           <control idMso="SortUp" label="Ascending" enabled="true"/>
                   <control idMso="SortDown" label="Descending" enabled="true"/>
                   <control idMso="SortRemoveAllSorts" label="Remove Sort" enabled="true"/>
                   <control idMso="SortSelectionMenu" label="Selection" enabled="true"/>
                   <control idMso="FilterAdvancedMenu" label="Advanced" enabled="true"/>
                   <control idMso="FilterToggleFilter" label="Toggle Filter" enabled="true"/>
               </group>
           <group id="dbRecords" label="Records">
                   <control idMso="DataRefreshAll" size="large" label="Refresh All" enabled="true"/>
           <control idMso="GoToNewRecord" label="New" enabled="true"/>
                   <control idMso="RecordsSaveRecord" label="Save" enabled="true"/>
                   <control idMso="Delete" label="Delete" enabled="true"/>
                   <control idMso="RecordsTotals" label="Totals" enabled="true"/>
                   <control idMso="SpellingAccess" label="Spelling" enabled="true"/>
                   <control idMso="RecordsMoreRecordsMenu" label="More" enabled="true"/>
               </group>
           <group id="dbFind" label="Find">
                   <control idMso="FindDialog" size="large" label="Find" enabled="true"/>
           <control idMso="ReplaceDialog" label="Replace" enabled="true"/>
                   <control idMso="GoToMenuAccess" label="Go To" enabled="true"/>
                   <control idMso="SelectMenuAccess" label="Select" enabled="true"/>
               </group>
           <group id="dbTextFormat" label="Text Formatting" centerVertically="true">
            <box id="TopBx">
                       <control idMso="Font" enabled="true"/>
               <control idMso="FontSize" enabled="true"/>
               <buttonGroup id="buttonGroup_TopRow">
                           <control idMso="Bullets" enabled="true"/>
                           <control idMso="Numbering" enabled="true"/>
                           <separator id="separator1" />
                           <control idMso="IndentIncrease" enabled="true"/>
                           <control idMso="IndentDecrease" enabled="true"/>
                           <separator id="separator2" />
                           <control idMso="AlignLeftToRightMenu" enabled="true"/>
                       </buttonGroup>
                    </box>
                    <box id="BottomBx">
                        <buttonGroup id="buttonGroup_BottomRow">
                           <control idMso="Bold" enabled="true"/>
                           <control idMso="Italic" enabled="true"/>
                           <control idMso="Underline" enabled="true"/>
                           <separator id="separator3" />
                           <control idMso="FontColorPicker" enabled="true"/>
                           <control idMso="TextHighlightColorPicker" enabled="true"/>
                           <control idMso="FontFillBackColorPicker" enabled="true"/>
                           <separator id="separator4" />
                           <control idMso="AlignLeft" enabled="true"/>
                           <control idMso="AlignCenter" enabled="true"/>
                           <control idMso="AlignRight" enabled="true"/>
                           <separator id="separator5" />
                           <control idMso="DatasheetGridlinesMenu" enabled="true"/>
                           <separator id="separator6" />
                           <control idMso="FontAlternateFillBackColorPicker" enabled="true"/>
                        </buttonGroup>
                    </box>
               </group>
           </tab>
       </tabs>
  </ribbon>
  <backstage>
      <tab idMso="TabSave" visible="false" > </tab>
      <button idMso="ApplicationOptionsDialog" visible="false"/>
      <button idMso="FileCloseDatabase" visible="false"/>
  </backstage>
</customUI>
吾性傲以野 2024-12-18 19:23:17

由于使用[快速访问工具栏]-[自定义]访问选项仍然存在后门入口,因此使用与Fionnuala相同的方式的另一个简单解决方案可能是:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <commands>
         <command idMso="ApplicationOptionsDialog" enabled="false"/>
  </commands>

Because there remains a backdoor entrance to the access options by using [Quick Access Toolbar] - [Customization], an other simple solution using the same way as Fionnuala could be:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <commands>
         <command idMso="ApplicationOptionsDialog" enabled="false"/>
  </commands>

始于初秋 2024-12-18 19:23:17

我已经尝试过了,看起来效果很好
在数据库打开时显示的登录表单或主表单上,添加以下过程:

Private Sub Form_Open(Cancel As Integer)
       ' Go Modal to Lock Navigation Pane
       Me.Form.Modal = True
       ' Hide Navigation Pane
       DoCmd.NavigateTo "acNavigationCategoryObjectType"
       DoCmd.RunCommand acCmdWindowHide
       ' Hide Ribbon
       DoCmd.ShowToolbar "Ribbon", acToolbarNo
       ' Lock Navjgation Pane
       DoCmd.LockNavigationPane (True)
End Sub

I have tried this and it seems it works well
on your login form or main form that is shown when the database opens, add this procedure:

Private Sub Form_Open(Cancel As Integer)
       ' Go Modal to Lock Navigation Pane
       Me.Form.Modal = True
       ' Hide Navigation Pane
       DoCmd.NavigateTo "acNavigationCategoryObjectType"
       DoCmd.RunCommand acCmdWindowHide
       ' Hide Ribbon
       DoCmd.ShowToolbar "Ribbon", acToolbarNo
       ' Lock Navjgation Pane
       DoCmd.LockNavigationPane (True)
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文