473,654 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Autonumber repeats exisitng values

My customers have reported strange behaviour of the locally used modules
for running the register on stroke patients, specifically, adding new
patient to the register. When analising a sample, I have found that an
autonumber variable (id) doesn't behave as expected. At some instant
after the record with id=180, the next record is coming with id=158.
I can't find any reasonable explanation. Could anybody?
V.M.

Nov 13 '05 #1
4 2111
Vladislav wrote:
My customers have reported strange behaviour of the locally used modules
for running the register on stroke patients, specifically, adding new
patient to the register. When analising a sample, I have found that an
autonumber variable (id) doesn't behave as expected. At some instant
after the record with id=180, the next record is coming with id=158.
I can't find any reasonable explanation. Could anybody?
V.M.


I did a recent search of the newsgroup on google for some information on
alternatives to sequences other than using autonumber. There are some
circumstances when autonumber will start generating numbers randomly.
Replication, is one instance, I seem to recall.

As long as your application does not depend upon the autonumber for
ordering records, you're fine. If you need an ascending sequence
number, I'd be curious as to what others might suggest.

I normally develop with Oracle in which sequences can be created and
associated with a table via a "trigger" on or after inserting a record.
The nice thing about this is that you can set at any time how the
sequence advances, ie, by 1, or by any number (2, 4, 10, 1000, etc, etc,
even reverse order with negative numbers).

However, in my situation I mentioned at the first para above, I was
desperate for some kind of in order sequence number for records in a Jet
application and didn't want to rely on date() or now() as these depend
upon the user's clock setting, which could potentially be screwed up.
Autonumber was the other alternative, so I did the above mentioned
search to make sure it was OK. Apparantly it is not.

What I ended up doing was relying on a default value for a form text box
control for the sequence number or a function which used the domain max
function +1

dmax("FieldName ", "TableName" ) +1

for the next number in sequence. This was for a single user application
(ie, not multiple front ends). I'm not sure how this would work with
multiple front end users. I would assume OK.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #2
Thanks for message.

As to how to create a unique identifier for a record in MS Access - this
problem I have identified and solved using simple function returning
the maximal value of IdVar in question over a set of exisitng records.
After that increment is a parameter, I am fully happy with 1.
The current problem came with autonumber variable Id which is used for
some internal references, like lines in combo box which by clicking
call the complete set of variables in the rest of a form. And it is not
so interesting how it could be done in Oracle ( I know simple and
perfect way to do this in SAS), but the task is to find solution for MS
Access, 2000+ (in Access97 I never encountered such a problem). It seems
clear bug, such a behavior of autonumber, when no replication is used,
just very plain and straightforward use of basic declared features of
Access 2000.

Nov 13 '05 #3
Vladislav wrote:
Thanks for message.

As to how to create a unique identifier for a record in MS Access - this
problem I have identified and solved using simple function returning
the maximal value of IdVar in question over a set of exisitng records.
After that increment is a parameter, I am fully happy with 1.
The current problem came with autonumber variable Id which is used for
some internal references, like lines in combo box which by clicking
call the complete set of variables in the rest of a form. And it is not
so interesting how it could be done in Oracle ( I know simple and
perfect way to do this in SAS), but the task is to find solution for MS
Access, 2000+ (in Access97 I never encountered such a problem). It seems
clear bug, such a behavior of autonumber, when no replication is used,
just very plain and straightforward use of basic declared features of
Access 2000.


I found this in Access 2000 as well, and stayed with 97 until 2002 came
out. I don't know if it's been resolved, have you got all the service
packs installed?

--
This sig left intentionally blank
Nov 13 '05 #4
Trevor Best wrote:
I found this in Access 2000 as well, and stayed with 97 until 2002 came
out. I don't know if it's been resolved, have you got all the service
packs installed?


I have installed the whole package 2000. I have to stay with it, since I
am running the centralzied data collection in a multicentral study by
developing and sending to the data providing centres MS Access product
for local data entry and project management.

Nov 13 '05 #5

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

Similar topics

33
4280
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and setting default value to a UDF that manages the auto-numbering. Access won't take a UDF as a default value. Okay, I'll use SQL WITHOUT any aggregate functions, for the default value. Access won't do that either. Okay, I create a second...
1
1750
by: BT Openworld | last post by:
I've just had to upgrade to Access 2003. Our company's main sales database started in Access V1.0 and has progressed through V2.0 and 97 without problems. I've converted it to 2003 format and have been going through a process of testing it. To my horror I noticed that seemingly without provocation, it has started re-using old Autonumber values. For example, I have an archive routine which removes completed sales enquiry records out of the...
35
7258
by: Traci | last post by:
If I have a table with an autonumber primary key and 100 records and I delete the last 50 records, the next record added would have a primary key of 101. Is there any way to have the primary key start at 51 after the last 50 records are deleted? Thanks! Traci
4
5162
by: yf | last post by:
A KB article "http://support.microsoft.com/default.aspx?scid=kb;en-us;209599" tells that the maximum number of records that a table may hold if the PRIMARY key data type is set to AUTONUMBER is 4,294,967,295. Suppose the PRIMARY key data type is set to "RANDOM" AutoNumber. Suppose an application (a) successfully INSERTS "X" records, then (b) successfully DELETES "Y" records (X >= Y), then
26
3803
by: jimfortune | last post by:
Sometimes I use Autonumber fields for ID fields. Furthermore, sometimes I use those same fields in orderdetail type tables. So it's important in that case that once an autonumber key value is assigned to a record that it doesn't change. Occasionally I find that due to corruption or an accidental deletion and restore of a record from a backup the autonumber field needs to be tidied up. So when I create (through AddNew) the autonumber...
11
4484
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any AutoNumber* fields in them. Correct me if I'm wrong, but I'm assuming this means that I cannot now alter these existing Access tables and change their primary key to an "AutoNumber" type. If I'm right about this, I need some suggestions as to the...
4
38376
by: Lyn | last post by:
Hi, Is there an "easy" way to write a full record (all fields) using "INSERT INTO..." into a table which has an AutoNumber field? Normally, to write a full new record I would use: INSERT INTO VALUES (Value1, Value2, ...); If (say) the first field (Value1) is an AutoNumber, what value can you put that will preserve the auto-increment function?
6
8059
by: Wayne | last post by:
I'm using the following SQL statement to find the next highest autonumber value in a table where "CDUGActID is the autonumber field in the "CDUGActuals" table: SELECT CDUGActuals.CDUGActID, CDUGActuals.ActualTonnes, +1 AS NextID FROM CDUGActuals; This works well as long as no autonumber values have been skipped due to deletions or cancelled entries. Is there a simple change I can
6
11756
by: ashes | last post by:
Hi, I am creating an ecommerce website using Microsoft Visual Studio, VB.Net and MS Access 2003. I am new to VB.Net When someone wants to register on the website, they fill out a form and the contents of the form is inserted into the MS Access database. The Customer table in the database already has 30 records (with CustomerIDs 1 - 30) in it (from when the database was first created). The CustomerID field in the database is an...
0
8294
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
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
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
8494
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,...
0
8596
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
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
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.