且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

关于创建表的新手问题

更新时间:2021-10-29 02:26:41


我的问题是,在表BatchNumCode / Quantity中,ProductCode将被删除并经常被新的批号替换。  如果我使用
一个带有autonum / increment或ramdom的主键,考虑到条目会被删除并不时更换,这样可以吗?  从长远来看这将如何影响。

嗨罗纳德,

你可以安全地使用自动编号/增量的主键。这些数字只能由Access在内部使用以加入记录,因此没有理由打扰这些空白。

You can safely use the primary key with autonumber/increment. The numbers will ONLY be used internally by Access to join records, so there is no reason to bother on the gaps.

自动编号存储为长数,因此范围为0到0约65000 * 65000.如果您每天添加约200条记录,或每年约65000条记录,则需要大约65000年才能用尽数字。当你达到
的数字限制时,你也会用随机数字到达它们。在这种情况下,您可以进行64位处理。

The autonumber is stored as a Long number, thus a range of 0 to about 65000 * 65000. If you add about 200 records per day, or about 65000 per year, it will take about 65000 years before you are exhausted of numbers. When you reach the limits of the numbers, you would also have reached them with random numbers. In that case you are ready to move to 64-bits processing.

Imb。