472,145 Members | 1,327 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Autonumber is Not Unique

I have a table with an autonumber primary key column. When I add a row to
the table, Access is generating a number which is already in use. This makes
my application blow up. Thankfully, the table's uniqueness constraint holds
(i.e. I get an error when I try to save the row), but my entire application
is built on the premise that autonumber values will be unique, and all hell
breaks loose when that premise is violated.

I am using Access 2000, SP3. The problem persists if I compact and repair
the database. I corrected the problem once by rebuilding the primary key
column (i.e. create a new column, delete the old one), but the problem has
reoccurred. I have posted a copy of the database, stripped of all but the
relevant table, at http://MatsonConsulting.com/download...number_bug.zip.
I can recreate the problem at any time (and hopefully you can too) by adding
a row to that table.

To me, this looks a lot like the notorious autonumber reset bug
(http://support.microsoft.com/?id=257408), but I should not be experiencing
that bug with SP3. If anyone has any other ideas, I would be glad to hear
them.
-Todd Matson
Nov 12 '05 #1
4 2046
"Todd Matson" <v@x.z> wrote in news:jtchc.10997$c%3.1988@okepread02:
http://MatsonConsulting.com/download...number_bug.zip


My idea is that the table is corrupted, either by misadventure or adventure
adventure. Once copied, the table is fine and autonumber works perfectly as
it has always done for me for 12 or so years.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #2
Lyle,

Thank you for the reply.

I believe I have found the source of the corruption. I have discovered that
some of my users have a pre-SP1 version of Access. My theory is that these
users managed to break the database with the autonumber bug, so that it
doesn't work even for those users with an up-to-date version of Access.

If my theory is correct, it implies that the pre-SP1 version of Access is
very dangerous, and must be eradicated at all costs. (After browsing the
newsgroup, I have discovered that this is old news, but it never hit home
with me until now.) So, here is a new question: Is there any way to
determine, from code, which service packs have been installed? If so, I will
modify my application so that it refuses to run unless Access is up-to-date.
-Todd Matson
"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
"Todd Matson" <v@x.z> wrote in news:jtchc.10997$c%3.1988@okepread02:
http://MatsonConsulting.com/download...number_bug.zip
My idea is that the table is corrupted, either by misadventure or

adventure adventure. Once copied, the table is fine and autonumber works perfectly as it has always done for me for 12 or so years.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)

Nov 12 '05 #3
On Apr 20 2004, 12:46 pm, "Todd Matson" <v@x.z> wrote in
news:jtchc.10997$c%3.1988@okepread02:
To me, this looks a lot like the notorious autonumber reset bug
(http://support.microsoft.com/?id=257408), but I should not be
experiencing that bug with SP3.


FWIW, I've seen this bug in a database using Access 2002 file format that
was never touched by anything but Access 2002 SP2. Copy/paste did fix it.

--
remove a 9 to reply by email
Nov 12 '05 #4
On Tue, 20 Apr 2004 13:29:50 -0700, "Todd Matson" <v@x.z> wrote:

Of course. Just check any About box in Access.
The trick is to be able to read the Version information from one of
the Access DLLs such as DAO360.DLL.
Then compare that to the version numbers that are typically documented
in the readme.txt file of any product or upgrade.

Sometimes you get lucky, and the object itself implements a Version
property. I use this all the time with an ADODB.Connection object to
ensure a certain version of ADO is installed.

-Tom.

<clip>
with me until now.) So, here is a new question: Is there any way to
determine, from code, which service packs have been installed? If so, I will
modify my application so that it refuses to run unless Access is up-to-date.
-Todd Matson

<clip>

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Tony Williams | last post: by
2 posts views Thread by Charles Robinson III | last post: by
35 posts views Thread by Traci | last post: by
8 posts views Thread by mathilda | last post: by
9 posts views Thread by Gogo | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

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.