473,591 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the largest "auto number" that can exist in an Access database? How to reset autonumber to start at 1?

Hi:

I know this is a strange question, but I have inherited a system where files are copied
and records re auto numbered (as an index field) )frequently, and I am wondering how high
the number can go without the system crashing.

An ancillary question is how one resets an auto number so that the sequence starts again
at 1.

In the case of this file, the auto number field serves no useful purpose except as an
index, and identifier of a unique record, so no problem with renumbering the records
provided one does not try and create two identical numbers (in which case the system
throws up all over you!).

Regards

John Baker

Nov 13 '05 #1
16 20470
Maximum size for an autonumber is 2,147,483,647 and the smallest it can be
is -2,147,483,648.
One way to reset it back to zero is to delete all records in the table and
then compact the database.

Jeff
"John Baker" <Ba******@Veriz on.net> wrote in message
news:i6******** *************** *********@4ax.c om...
Hi:

I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number can go without the system crashing.

An ancillary question is how one resets an auto number so that the sequence starts again at 1.

In the case of this file, the auto number field serves no useful purpose except as an index, and identifier of a unique record, so no problem with renumbering the records provided one does not try and create two identical numbers (in which case the system throws up all over you!).

Regards

John Baker

Nov 13 '05 #2
Thanks.. its good to know I can do that.

Is there any programmatic way to reset it? I would almost like to reset it every time I
use it!

Best

John
"Jeff Smith" <No***@Not.This .Address> wrote:
Maximum size for an autonumber is 2,147,483,647 and the smallest it can be
is -2,147,483,648.
One way to reset it back to zero is to delete all records in the table and
then compact the database.

Jeff
"John Baker" <Ba******@Veriz on.net> wrote in message
news:i6******* *************** **********@4ax. com...
Hi:

I know this is a strange question, but I have inherited a system where

files are copied
and records re auto numbered (as an index field) )frequently, and I am

wondering how high
the number can go without the system crashing.

An ancillary question is how one resets an auto number so that the

sequence starts again
at 1.

In the case of this file, the auto number field serves no useful purpose

except as an
index, and identifier of a unique record, so no problem with renumbering

the records
provided one does not try and create two identical numbers (in which case

the system
throws up all over you!).

Regards

John Baker


Nov 13 '05 #3
If you're even thinking you might want to reset it,
don't use an autonumber.
Autonumbers are not meant to be meaningful, just unique.

"John Baker" <Ba******@Veriz on.net> wrote in message
news:lt******** *************** *********@4ax.c om...
Thanks.. its good to know I can do that.

Is there any programmatic way to reset it? I would almost like to reset it every time I use it!

Best

John
"Jeff Smith" <No***@Not.This .Address> wrote:
Maximum size for an autonumber is 2,147,483,647 and the smallest it can beis -2,147,483,648.
One way to reset it back to zero is to delete all records in the table andthen compact the database.

Jeff
"John Baker" <Ba******@Veriz on.net> wrote in message
news:i6******* *************** **********@4ax. com...
Hi:

I know this is a strange question, but I have inherited a system where

files are copied
and records re auto numbered (as an index field) )frequently, and I am

wondering how high
the number can go without the system crashing.

An ancillary question is how one resets an auto number so that the

sequence starts again
at 1.

In the case of this file, the auto number field serves no useful
purposeexcept as an
index, and identifier of a unique record, so no problem with
renumberingthe records
provided one does not try and create two identical numbers (in which
casethe system
throws up all over you!).

Regards

John Baker

Nov 13 '05 #4
Jeff Smith wrote:
Maximum size for an autonumber is 2,147,483,647


Out of interest, when using increment, what happens to the next record
after that number? Does it roll over into the negative?

Back in the old DOS days, I wrote a program to calculate prime numbers,
as I remember my 12MHz 286 was rather slow so for speed I wrote 4
separate bits to do it, going from integer, long, single then double so
that when say the integer got over 32767 it would error and the error
trap would resume to the long bit and carry on. This worked in the IDE
(MS Basic PDS 7.1) but when compiled to a stand alone .exe file it would
not error but would wrap into negative numbers, no matter if I used x87
emulation[1] or alternate math libs.

[1] Well I didn't have a 287 co-pro on there.

--

\\\\\\
\\ \\ Windows is searching
\ \ For your sig.
\ \ Please Wait.
\__\

Nov 13 '05 #5
Trevor,
If you create a new table (or compact an empty one), then append a record
with the autonumber field set to 2,147,483,647 then start entering records
manually the first manually entered record has an autonumber field value of
1 and then they increment as normal (2, 3, 4, 5 etc).

If, however, you create a new table (or compact an empty one), then append
a record with the autonumber field set to 2,147,483,646 then start entering
records manually the first manually entered record has an autonumber field
value of 2,147,483,647 but from then on they change to negative values,
-2147483648, -2147483647, -2147483646 and so on; note they are still
incrementing

(Tested in XP)
--
Terry Kreft
MVP Microsoft Access
"Trevor Best" <nospam@localho st> wrote in message
news:41******** *************** @auth.uk.news.e asynet.net...
Jeff Smith wrote:
Maximum size for an autonumber is 2,147,483,647
Out of interest, when using increment, what happens to the next record
after that number? Does it roll over into the negative?

<SNIP> [1] Well I didn't have a 287 co-pro on there.

--

\\\\\\
\\ \\ Windows is searching
\ \ For your sig.
\ \ Please Wait.
\__\

Nov 13 '05 #6
John Baker <Ba******@Veriz on.net> wrote in
news:i6******** *************** *********@4ax.c om:
I know this is a strange question, but I have inherited a system
where files are copied and records re auto numbered (as an index
field) )frequently, and I am wondering how high the number can go
without the system crashing.

An ancillary question is how one resets an auto number so that the
sequence starts again at 1.

In the case of this file, the auto number field serves no useful
purpose except as an index, and identifier of a unique record, so
no problem with renumbering the records provided one does not try
and create two identical numbers (in which case the system throws
up all over you!).


Others have already pointed out that if you actually care about the
values of the autonumber, then you're mis-using it.

Let me also point out that there's nothing magical about an
autonumber: it is just a special kind of default value. If you want
to re-use numbers, simply append your record with the autonumber set
to a value that is presently unused.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #7
Normal autonumbers are long numbers. See the specification for Long.

If the table is empty, compacting the database will reset the auto
number to 1.

(david)

"John Baker" <Ba******@Veriz on.net> wrote in message
news:i6******** *************** *********@4ax.c om...
Hi:

I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number can go without the system crashing.

An ancillary question is how one resets an auto number so that the sequence starts again at 1.

In the case of this file, the auto number field serves no useful purpose except as an index, and identifier of a unique record, so no problem with renumbering the records provided one does not try and create two identical numbers (in which case the system throws up all over you!).

Regards

John Baker

Nov 13 '05 #8
Terry:

If I understand what your saying correctly, overflowing an auto number will cause no
problems at all. In other words rather than the maximum number of UNIQUE auto numbers
being 2,147,483,647, it is in fact twice that, since you have the negative value AND the
positive one.

Have I understood that correctly?

Best

John

"Terry Kreft" <te*********@mp s.co.uk> wrote:
Trevor,
If you create a new table (or compact an empty one), then append a record
with the autonumber field set to 2,147,483,647 then start entering records
manually the first manually entered record has an autonumber field value of
1 and then they increment as normal (2, 3, 4, 5 etc).

If, however, you create a new table (or compact an empty one), then append
a record with the autonumber field set to 2,147,483,646 then start entering
records manually the first manually entered record has an autonumber field
value of 2,147,483,647 but from then on they change to negative values,
-2147483648, -2147483647, -2147483646 and so on; note they are still
incrementing

(Tested in XP)


Nov 13 '05 #9
Yes, you have the full range of an unsigned long to play with.

--
Terry Kreft
MVP Microsoft Access
"John Baker" <Ba******@Veriz on.net> wrote in message
news:rd******** *************** *********@4ax.c om...
Terry:

If I understand what your saying correctly, overflowing an auto number will cause no problems at all. In other words rather than the maximum number of UNIQUE auto numbers being 2,147,483,647, it is in fact twice that, since you have the negative value AND the positive one.

Have I understood that correctly?

Best

John

"Terry Kreft" <te*********@mp s.co.uk> wrote:
Trevor,
If you create a new table (or compact an empty one), then append a recordwith the autonumber field set to 2,147,483,647 then start entering recordsmanually the first manually entered record has an autonumber field value of1 and then they increment as normal (2, 3, 4, 5 etc).

If, however, you create a new table (or compact an empty one), then appenda record with the autonumber field set to 2,147,483,646 then start enteringrecords manually the first manually entered record has an autonumber fieldvalue of 2,147,483,647 but from then on they change to negative values,
-2147483648, -2147483647, -2147483646 and so on; note they are still
incrementing

(Tested in XP)

Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4588
by: J. Campbell | last post by:
When the bitwise NOT operator, is placed in front of an integer variable type (bool, char, short, int, long), the return value is a signed int, regardless of the variable type. An example can be seen in this code: #include<iostream> using namespace std; int main(){
3
3100
by: matt | last post by:
Greetings: I appoligize if I'm asking a question that's already been answered in the group - I've scoured for about two hours and I can't find a solution. I also appoligize if I over complicate my question, but I want to be sure that I communicate my thought(s). The database I'm working on will generate tens, perhaps hundreds of thousands of records, each of which need to be identified uniquely. Using the autonumber would be ideal...
1
2111
by: ComputerGuyCJ | last post by:
I have an application that I've used click-once deployment to publish out to a shared network path. From there I installed the app on a few client machines, including my own. Since then I published a few updates that were recognized by the app, and the users installed them, so everyone's on the most current version. A couple of glitches are now showing up. 1. One of my users received a prompt when she opened up the app that there is a...
9
18828
by: Beowulf | last post by:
I was having this problem: http://groups.google.com/group/microsoft.public.sqlserver.server/msg/e36e423972323378?dmode=source with it taking an inordinate amount of time to enumerate the databases on my local SQL Server instance, so I went through all the local databases and unchecked "Auto Close" on the "Options" tab of the Database properties in Enterprise Manager. This cleared up the problem nicely. In EM or through SQL-DMO, the...
0
1643
barbk
by: barbk | last post by:
Hey all, In DB2 v9 is it possible to have an auto generated number field within a primary key that is a combination of multiple fields? For example resv locn sale_no 1234 789 1 1234 789 2 1234 567 1 1234 345 1 I would like sale_no auto generated based on resv and locn, without using a trigger. Is this possible?
2
23108
by: VSS | last post by:
Hello, I need to know what is the maximum number of records Access can hold? I need approx. 6 million records, do you know if Access can hold this amount? Thank you everyone.
3
17232
by: Simon van Beek | last post by:
Dear reader, What can be wrong in my ComboBox, the property "Auto Expand" is set to Yes, but by typing in the ComboBox it doesn't expand. Is this because the source of the ComboBox is a query.
0
7934
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7870
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8362
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7992
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5732
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5400
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3850
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1465
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.