将代码与访问中的数据分开 [英] separating code from data in access

查看:157
本文介绍了将代码与访问中的数据分开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在扩展访问应用程序,同时一些用户正在使用它.这意味着用户正在更改数据库. 我创建了访问文件的备份并进行处理.这样,我可以确保在测试系统时不会对更改数据库的系统进行任何更改.但是我只能在用户不使用系统并且因此他们不更改数据库(表中的数据)的情况下进行开发.这不好,因为我无法在用户工作的同时进行工作.

I am extending an access application at the same time that some users are using it. This means that users are changing databases. I created a backup of access file and working on it. In this way I can make sure that I am not making any changes to system that change database when I am testing the system. But I only can develop when users are not using the system and hence they are not changing databases (data in tables). This is not good since I cannot work at the same time that users are working.

有什么解决办法吗?

进行此开发的一个好方法是将VBA代码与表分开.我的意思是拥有一个包含VBA代码的访问文件,另一个包含表的访问文件.

A good way to do this development is to separate VBA codes from Tables. What I mean is to have an access file which contains VBA codes and the other access file which contains tables.

有可能吗?

我该怎么做?

是否有有关如何执行此操作的文档?最佳做法是什么?

Is there any documentation on how to do this? what is the best practise on this?

此问题的第一条评论的链接中提供了很好的信息.

Good information presented in link in first comment to this question.

推荐答案

您需要将数据库分为两个数据库:前端和后端.将后端保持在中央位置,然后在其中更改数据结构.将前端的副本分发给每个用户,并让他们在自己的副本上运行查询,报告,表单等.在前端为他们提供一组一致的基础查询,这样他们实际上就不需要使用实际的表了,然后您可以自由地对其进行更改.

You need to split up the database into two databases: a frontend and a backend. Keep the backend at a central location and change the data structures there. Distribute a copy of the frontend to each user and let them run queries, reports, forms etc. on their own copies. Give them a consistent set of base queries in the frontend so that they never actually need to use the actual tables--which you can then change freely.

您可以在 Microsoft Office网站.但是基本思想是前端包含链接表,这些链接表指向后端中的实际表.您也可以使用Access数据导入向导并选择链接到表而不是导入其数据来手动执行此操作.请注意确保链接表指向共享文件夹中的数据库,而不指向您的个人文件夹.您可以通过右键单击链接表,选择链接表管理器",并在必要时更新所有表的链接来完成此操作.

You can find a walk-through tutorial on database splitting at Microsoft's Office website. But the basic idea is that the frontend contains linked tables that point to actual tables in the backend. You can also do this manually using the Access data import wizard and choosing to link to a table instead of importing its data. Just be careful to ensure that the linked tables point to the database in the shared folder and not to your personal folder. You can do this by right-clicking a linked table, selecting Linked Table Manager, and updating the links for all tables where necessary.

这篇关于将代码与访问中的数据分开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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