简体   繁体   English

使用DoCmd.Transferdatabase命令时更新表,而不是覆盖它们

[英]Update tables, not overwrite them when using the DoCmd.Transferdatabase command

Okay for this I am tasked with creating an Archive database for the Primary database. 好的,我的任务是为主数据库创建一个存档数据库。 They want this done to keep the one they use clean. 他们希望这样做能保持清洁。 Basically a database for a database. 基本上是数据库的数据库。 I have been able to set up the queries for the tables that they want to get the information from to be archived out. 我已经能够为他们想要从中获取信息的表设置查询。 Then once the data is pushed to the archive they want some method to go back in to deleted the data that was just pushed from the tables, making them smaller, which I have working. 然后,一旦将数据推送到存档中,他们希望返回某种方法以删除刚刚从表中推送的数据,从而使其变得更小,这已经在我的工作中了。 Everything works fine until I run it a second time. 一切正常,直到我第二次运行为止。 Because The code goes back in to query from the deleted fields the queries that are run and then the information pushed no longer has information(blank table) coupled with the way the DoCmd.transferdatabase works. 因为该代码返回到从已删除字段中查询的查询,所以将运行查询,然后推送的信息不再具有信息(空白表)以及DoCmd.transferdatabase的工作方式。 It is just overriding the tables of information with a blank table in the archive database. 它只是用存档数据库中的空白表覆盖信息表。 This would not be a problem except for them having to implement the archiving again later down the road with new parameters for the queries for the tables. 这将不是问题,除非他们以后必须再次使用针对表查询的新参数再次实施归档。 It would then just over ride the table instead of combining them. 这样一来,它就会超越桌子,而不是将它们组合在一起。 I need a way to get the tables to combine. 我需要一种方法来合并表格。 They are the same table just need to add different information periodically that does not delete the existing table in the Archive. 它们是同一个表,只需要定期添加不同的信息,而不会删除存档中的现有表。

I am fairly new at this and nothing I have tried has made it work. 我在这方面还很陌生,但我尝试过的任何方法都无法使它起作用。 I am wondering if this is even possible to combine table information from two separate DB's? 我想知道是否有可能合并来自两个单独数据库的表信息?

Instead of moving archived data back & forth, just link to the archive table instead. 无需来回移动已归档的数据,只需链接到归档表即可。 The command will begin like this: DoCmd.TransferDatabase acLink 该命令将像这样开始: DoCmd.TransferDatabase acLink

The you can run queries against the production or archive tables whenever you want. 您可以随时在生产或存档表上运行查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM