跨远程 Access 数据库同步表
我正在通过提供 Access DB 来管理各种类型的请求来帮助企业。由于他们是一家建筑公司,因此他们在建筑工地的“办公室”中拥有一台机器,在其主办公室中还拥有 3 台机器。现场机器没有互联网连接。
是否有任何(相当简单的)方法可以经常同步场外和现场数据库?我意识到这些表可以合并,但每个表都有一个自动增量字段,必须在实例之间同步(即,当合并两个表时,应根据记录的组合重新分配自动增量)。
提前干杯,
保罗
I'm helping out a business by providing an Access DB to manage requests of various types. As they are a construction company, they have one machine in an 'office' on the building site, plus 3 based in their main office. The machine on site has no internet connectivity.
Is there any (reasonably simple) way to synchronise the offsite and onsite databases every so often? I realise the tables could be merged, but each has an autoincrement field which must be synced between instances (i.e. when merging two tables the autoincrement should be reassigned based on the combination of records).
Cheers in advance,
Paul
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Jet Replication 是一种答案,但并不容易,因为对于远程位置,您必须使用间接或 Internet 复制,这两种方法的设置都相当复杂,并且需要定期维护才能保持可靠运行。也就是说,间接复制效果非常好(我从未使用过 Internet 复制,因为对 IIS 的硬连线依赖,我认为这是不可接受的)。
有关 Jet Replication 主题的一站式购物,请参阅 Jet Replication Wiki。
Microsoft 正在逐步取消 Access 中对 Jet 复制的支持(尽管我希望只要支持 MDB 文件而无需转换),因此解决该问题的更好方法可能是使用 Microsoft 已推出的工具来替代Jet 复制提供的功能。当然,这就是 Sharepoint。在 A2007 年,Sharepoint 的能力还不足以成为 Jet 复制的适当替代品,但从 A2010 和 Sharepoint 2010 开始,一切都发生了变化。
如果有新客户向我提出此要求,即使我在 Jet 复制方面拥有多年的经验,我也会推荐 A2010 和 Sharepoint 2010 作为问题的解决方案,并会说等待。
客户端可能不希望使用 Sharepoint 服务器,在这种情况下,有可用的托管 Sharepoint,它应该在 5 月份 Office 2010 发布后不久支持 Sharepoing 2010。
当然,也可以手动编程同步,但这在多主场景中相当复杂。但是,如果两个数据库中的记录不重叠(即,在一个数据库中创建的记录不会在另一个数据库中更新,或者换句话说,它主要是每个数据库的仅添加应用程序),那么问题就不那么严重了。删除是一个更难的问题,但并非无法解决。
Jet Replication is one answer, but not an easy one, as for a remote location you have to use indirect or Internet replication, both of which are pretty complex to set up and require regular maintenance to keep running reliably. That said, indirect replication works very well (I've never used Internet replication because of the hardwired dependency on IIS, which I consider unacceptable).
For one-stop shopping on the subject of Jet Replication, see the Jet Replication Wiki.
Microsoft is gradually phasing out support for Jet replication in Access (though I expect it to be supported as long as MDB files are supported without conversion), so a better solution to the problem might be to use the tools Microsoft has put in place to replace the functionality Jet replication provided. This would be Sharepoint, of course. In A2007, Sharepoint was way too inadequate to be a proper replacement for Jet replication, but starting with A2010 and Sharepoint 2010, all that changes.
If I had a new client coming to me with this requirement, even though I've got years and years of experience with Jet replication, I'd recommend A2010 and Sharepoint 2010 as the solution to the problem, and would say to wait.
It may be that a client doesn't want to spring for a Sharepoint server, and in that case, there's hosted Sharepoint available, which should be supporting Sharepoing 2010 shortly after the release of Office 2010 in May.
Of course, it's also possible to program synchronization manually, but that's quite complex in a multi-master scenario. However, if the records in the two databases do not overlap (i.e., records created in one are not updated in the other, or put another way, it's mostly and add-only app for each database), it's not as bad a problem. Deletes are a harder problem, but not unresolvable.
对于自动编号 PK 字段,请使用 ReplicationID (GUID) 而不是 long,这样数字在数据库的所有副本中都是唯一的,即使它们已断开连接。
使用 Access 进行复制有很多选项。这是一篇帮助您入门的文章。
了解访问复制
For your Autonumber PK field use a ReplicationID (GUID) instead of a long so that the numbers will be unique across all copies of the database, even if they are disconnected.
There are a lot of options for replication with Access. Here is an article to get you started.
Understanding Access Replication