使用具有自动增量功能的Access数据库中的已删除密钥 [英] using the deleted keys from an access db with autoincrement

查看:93
本文介绍了使用具有自动增量功能的Access数据库中的已删除密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用在ms访问中使用自动递增形式生成的已删除密钥..
我该如何实现?
例如,如果我有PK 1-5的记录并且我删除了第3条记录,我希望下一条记录PK从3开始...以及如果我在用户定义的记录后插入一条记录,我希望其余键跟随一样的时尚...

请回答

I want to use the deleted keys which are generated in the forms using auto increment in ms access..
How can i achieve it?
For ex if i have records with pk 1-5 and i delete 3rd record i want the next record pk to start from 3 ...as well as if i insert a record after a user defined record i want the remaining keys to follow the same fashion...

Kindly reply

推荐答案

那是一个非常非常糟糕的主意-您可以做到,但是它会引起各种各样的问题.例如,如果您同时收到来自两个不同用户的新记录请求,该怎么办?他们俩都可以决定使用ID为"3"的标识问题,这将引起问题.
如果您确实想要记录的序号,则不要使用记录ID-将其保留为单独的对象-而是使用序号.
That is a very, very bad idea - you can do it, but it can cause all sorts of problems. For example, what if you get a new record request from two different users at the same time? They could both decide to use an id of "3" with the identification problems that that will cause.
If you really want a sequential number for records, then don''t use the record ID - keep that as a separate object - and use the ordinal number instead.


这篇关于使用具有自动增量功能的Access数据库中的已删除密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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