Access的自动编号(增量)是否可以保证递增? [英] Is Access's AutoNumber (Increment) guaranteed to increment?

查看:391
本文介绍了Access的自动编号(增量)是否可以保证递增?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于特定的表,我将我的ID字段设置为AutoNumber(增量).如果我快速连续向该表添加5行,是否保证每个ID都具有比上一个更大的ID?例如,如果删除了一些较早的值,自动编号是否会从1重新开始?

For a particular table, I have my ID field set to AutoNumber (Increment). If I add 5 rows to this table in quick succession, is each guaranteed to have a larger ID than the last? For instance, does autonumbering ever restart from 1 if some earlier values have been deleted?

推荐答案

我唯一一次遇到Access自动编号的问题是,错误地将自动编号键字段的值设置为小于当前值的数字使用追加查询的最大数量.通过删除记录在编号中创建了空白. Access允许您将值强制输入到自动编号字段中,有时(并非总是如此,我不知道为什么)将自动编号重置为较低的编号.最终,随着记录的添加,我遇到了重复键"错误.除此之外,我已经好多年没有遇到过麻烦了.

The only time I have ever had trouble with Access autonumbers is when, in error, I set the value of an autonumber key field to a number lower than the current maximum using an append query. Gaps had been created in the numbering by record deletions. Access allows you to force a value into an autonumber field, and sometimes (not always, and I don't know why) the autonumbering gets reset to the lower number. Eventually, as records were added, I ran into 'duplicate key' errors. Other than this, I've never had trouble in many years.

此问题有两个答案,涉及增量值.据我所知,访问自动编号"字段只能设置为增量"(按1)或随机",并且无法设置除1以外的数字增量.我.

There are a couple of answers to this question which talk about an increment value. As far as I know, an Access autonumber field can only be set to 'Increment' (by 1) or 'Random', and there is no way of setting a numeric increment other than 1. If I am wrong about this, please enlighten me.

这篇关于Access的自动编号(增量)是否可以保证递增?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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