!没有重复! [英] !No Duplicates!

查看:58
本文介绍了!没有重复!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库用于跟踪进来的样本。我需要样本ID不允许重复,但是......我不想使用自动编号。即使删除了号码,自动号码也不允许我再次使用号码。我需要我的数字是顺序的,没有重复。如果我删除了一条记录,我希望能够用diff样本填充它。这不可能那么复杂......我错过了什么?任何帮助?


谢谢

I have a database for keeping track of samples that come in. I need the Sample ID''s to not allow duplicates, but...I don''t want to use an auto number. The auto number will not allow me to use a number again even if it is deleted. I need my numbers to be sequential with no duplicates. If I delete a record I want to be able to fill it in with a diff sample. This can''t be that complicated...what am I missing? Any help?

Thanks

推荐答案

编辑表属性并将Sample ID字段设置为Indexed(No Duplicates)。
Edit the table properties and set the Sample ID field to Indexed(No Duplicates).


解决方案1)使用SampleID作为数字(不是自动编号)构建表,并使其成为主键。您必须跟踪现有但未使用的密钥。

解决方案2)SampleID为AutoNumber,但有一个Deleted字段,如果样本不再有效,则将其标记为True。然后,您可以使用新样本覆盖。

解决方案3)拥有一个自动编号字段,然后忽略它。不一定是第一个领域。将其命名为ToKeepAccessHappy。如果它接近但不完全像您的SampleID,则使其随机,而不是顺序。然后很容易忽略。


OldBirdman
Solution 1) Build your table with SampleID as number (not AutoNumber) and make it the Primary Key. You will have to keep track of existing but unused keys.
Solution 2) SampleID as AutoNumber, but have a Deleted field and mark it as True if the sample is no longer valid. You can then overwrite with new sample.
Solution 3) Have an AutoNumber field, and just ignore it. Doesn''t have to be the first field. Name it something like "ToKeepAccessHappy". If the fact that it is close to, but not exactly, like your SampleID, make it random, not sequential. Then it is easy to ignore.

OldBirdman


全部谢谢。我会先给它们一些。
Thanks all. I''ll give some of these a go.


这篇关于!没有重复!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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