Home > Database > Mysql Tutorial > body text

在ACCESS中自动压缩当前数据库

WBOY
Release: 2016-06-07 16:21:23
Original
1538 people have browsed it

ACCESS可在菜单上选择[压缩]来压缩当前正打开的数据库,如是我们就可以通过程序临时添加一个工具条按钮,然后使用SendKeys来模拟键盘操作,实现压缩当前数据库,压缩后它会重新打开。函数如下: FunctionCompact() '添加一个工具条 WithCommandBars.Add(,mso

 ACCESS可在菜单上选择[压缩]来压缩当前正打开的数据库,如是我们就可以通过程序临时添加一个工具条按钮,然后使用SendKeys来模拟键盘操作,实现压缩当前数据库,压缩后它会重新打开。函数如下:

FunctionCompact()
 '添加一个工具条
 WithCommandBars.Add(,msoBarFloating,,True)
  '在工具条上添加一个按钮,这个按钮是从系统菜单的[工具]中[压缩]产生的
   .Controls.AddmsoControlButton,CommandBars("Tools").Controls(7).CommandBar.Controls(2).Id
  .Visible=True
  '将焦点移到该按钮上
  .Controls(1).SetFocus
  '模拟击键
  SendKeys"{ENTER}"
 EndWith
EndFunction

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template