在多个 Access 数据库中使用集中式 VBA 模块 [英] Using a centralized VBA module in multiple Access databases

查看:25
本文介绍了在多个 Access 数据库中使用集中式 VBA 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我负责管理内联网中分布的 50 多个 Access 数据库(.mdb 和 .accdb 的各种版本),我需要向几乎所有这些数据库添加一些 VBA 函数(完全相同的代码).我希望它可以通过从每个数据库创建一个对集中 VBA 模块的引用来完成,因为我真的很喜欢能够在每个数据库中自动复制的更改.如果中央数据库中的任何其他引用可以保持完整,那么我也不必单独管理它们,这也将是一个奖励.

I've been put in charge of 50+ Access databases (.mdb's and .accdb's of varied versions) spread around an intranet, and I need to add a few VBA functions (the exact same code) to almost all of them. I'm hoping it can be accomplished by creating a reference from each database to a centralized VBA module, as I'd really like the ability to make changes down the road that are automatically replicated in every database. It would also be a bonus if any additional references in the central db could be kept intact so I wouldn't have to manage them individually as well.

我对 VBA 编程还很陌生(虽然我多年来一直是 PHP 迷),并且一直很难想出合适的词来搜索这个特定问题.我认为(根据我到目前为止所读到的内容)我可能需要 Visual Studio 来编译一个 DLL 以供参考,但如果可能的话,我想保持一切简单并包含在 Access 中,尤其是因为我们没有 VS许可证.

I'm pretty new to VBA programming (although I've been a PHP junky for years), and have been having a hard time coming up with the right words to search for this particular issue. I think (from what I've read so far) that I might need Visual Studio to compile a DLL to reference, but I'd like to keep everything simple and contained within Access if possible, especially since we don't have a VS license.

谢谢,任何指点将不胜感激!

Thanks, any pointers would be much appreciated!

推荐答案

别担心,很简单.

  1. 制作您的助手"数据库.在那里放一些程序.
  2. 在您的客户"数据库中,打开 VBA 编辑器
  3. 转到工具->参考.浏览并选择您的助手数据库.
  4. 完成!您现在可以在整个客户端数据库中使用助手数据库中的所有功能.

所以...无需担心 .dll 文件.不需要 Visual Studio.

So... no .dll files to worry about. No Visual Studio needed.

这篇关于在多个 Access 数据库中使用集中式 VBA 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆