This article was written by MysticGeek, a tech blogger at the How-To Geek Blogs.
本文由How-To Geek Blogs的技术博客MysticGeek撰写。
Running into duplicate data in an Access Database can be quite annoying during the hectic workday, so I decided to write up a technique to help identify the duplicate records so you can manually handle them.
在繁忙的工作日中,在Access数据库中运行重复数据可能会很烦人,因此我决定编写一种技术来帮助识别重复记录,以便您可以手动处理它们。
There are many causes for duplicate data: for instance if you have multiple users entering data simultaneously via linked tables, or you might inherit a table with duplicate data already entered.
重复数据的原因有很多:例如,如果您有多个用户通过链接表同时输入数据,或者您可以继承一个表,其中已经输入了重复数据。
First open the MDB (Microsoft Database) containing the table you want to check for duplicates. Click on the Queries tab and New.
首先打开包含要检查重复表的MDB(Microsoft数据库)。 单击查询选项卡,然后单击新建。
This will open the New Query dialog box. Highlight Find Duplicates Query Wizard then click OK.
这将打开“新建查询”对话框。 突出显示“查找重复项查询向导”,然后单击“确定”。
Now highlight the table you want to check for duplicate data. You can also choose Queries or both Tables and Queries. I have never seen a use for searching Queries … but perhaps it would come in handy for another’s situation. Once you’ve highlighted the appropriate table click Next.
现在突出显示要检查重复数据的表。 您也可以选择查询,或者选择表和查询。 我从未见过用于搜索查询的用途…也许它会对另一个人的情况派上用场。 突出显示适当的表后,单击“下一步”。
Here we will choose the field or fields within the table we want to check for duplicate data. Try to avoid generalized fields.
在这里,我们将选择表中要检查重复数据的一个或多个字段。 尽量避免使用广义字段。
Name the Query and hit Finish. The Query will run right away and pop up the results. Also the Query is saved in the Queries section of Access.
命名查询并单击完成。 查询将立即运行并弹出结果。 该查询也保存在Access的“查询”部分中。
Depending upon the selected tables and fields your results will look something similar to the shots below which show I have nothing duplicated in the first shot and the results of duplicates in the other.
根据所选的表和字段,您的结果将类似于下图所示,这些图显示我在第一张照片中没有重复的内容,而在其他照片中没有重复的结果。