Access VBA:有什么方法可以获取计算机规格吗?
我正在 Access 中创建一个表单,该表单处理数百万行数据,需要几个小时(取决于您的计算机)。 我想实现一个功能来读取计算机规格,例如 CPU 速度和 RAM 数量,并确定该过程需要多长时间。
是否可以使用 VBA 获取计算机规格?
I'm creating a form in Access that processes millions of lines of data, and takes several hours (depending on your computer).
I want to implement a feature that will read the computer specs, such as CPU speed and amount of RAM, and determine how long the process will take.
Is it possible to get the computer specs using VBA?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1)有一个“环境”功能,可以为您提供有关“计算机”环境的信息。它通常用于获取用户名或临时文件夹等内容,但据说会返回以下值:
2)您有一些 shell 函数,可用于启动外部程序并获取返回值。除了标准的 VBA shell 函数之外,您还有一些有趣的东西,例如这个“shell 并等待”函数。
3) 当然,您始终可以在 VBA 代码中声明 Windows API 中的函数,并使用它们来获取所需的值...
1) There is this "environ" function that can give you informations on the "computer" environment. It is usually used to get things such as user name or temp folder, but it is said to return the following values:
2) you have some shell functions that can be used to launch external programs and get a value back. In addition to the standard VBA shell function, you also have some interesting things such as this "shell and wait" function.
3) Of course, you can always declare functions from the windows API in your VBA code and use them to get needed values ...
您应该能够通过调用 WMI 服务对象来检索系统信息。
WMI 任务:计算机硬件
WMI 帐户和计算机信息
在 Microsoft Access VBA 中使用 VBScript 和 WMI 的强大功能
You should be able to retrieve System Information by calling WMI Service Object.
WMI Tasks: Computer Hardware
WMI Accounts and Computer Information
Using the Power of VBScripts and WMI in Microsoft Access VBA