Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoNumber field abnormal after mdb file changed to origin... 2

Status
Not open for further replies.

chenwenjun

Technical User
Nov 9, 2002
58
RW
My AutoNumber field (set as Key) jumped from 3 to 1043567493 after I change my mdb file to origin...?
Why? How can I solve this problem....

Thanks. "Learn till the last breath."
 
The most likely cause is that you have changed the auto-number new values property from increment to random.
 
No, I met this problem 2 times. both happened after I change the database into a design master.....
I don't know why..... "Learn till the last breath."
 
Arrrr....

So now you tell us the rest of the story.

You have REPLICATED the database - haven't you.

AutoNumbers in Replicated databases MUST be set to Random to reduce the risk of two users in different replication copies adding new records and causing a clash of Id number.

The whole point about Replication is that users can work on their copy ( & add records to their copy ) independently. Combining the data again during Synchronisation. Therefore AutoNumber fields must be 'Random' ( Presented on the screen as a signed long integer ).


'ope-that-'elps.



G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Thanks, that means the only way to synchronize the mdb file is to change it to design master?
then, I'd better change my automumbered field in to number , am I right? "Learn till the last breath."
 
No, NO, NO

You synchronise the database WITH the design master ( and any other replicas that you have )

If you want a numerically incrementing number then you'll need to go to a completely separate Index database that is universally availavle, all of the time, to hand out the next number in the sequence.
If you can do that - then WHY have you produced a Replicated database to start with ?




G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Thanks....It is ....I guess I understand you in principle.
well,technically I do not how to build and link a separate a numerically incrementing number to replicated database, I think it is beyond me.

Can I let you know the rest of the rest of the story?
And I guess I did not make myself clear in last post,(sorry about that) I wanted to ask, do I have to make a replicated database in order to synchronize it from local computer to web server?
I know one advantage of replicated database is you can synchronize it from either design master or any replica, however,I might not need that, I only need to synchronize it from my local to web server.....

"Learn till the last breath."
 
Okay, you've lost me .. .. ..

Can your 'local' computer always see ( is it always connected to ) the Web Server ?

Or is the 'local' computer you refer to on a laptop of something ?

If there is a permanent connection betwen the two, via the network, then there is no need for replication, or synchronisation, or anything.

In there is NO permanent link then EITHER you need the facility to establish a link every time a new number is required - or you do not work with "numerically incrementing numbers".



'ope-that-'elps.


G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Well, the story is, I am still testing my web site on my LAN before I eventually upload it to web server, so, I have a 'local' remote end set by IIS.
I think with growth of the mdb file, simply copying might not be the best way, so I think if I can find a way of synchronisation would save a lot of uploading time in the future.
And based on my limited knowledge of Access, I do not know if replication is the only way of synchronisation and if there is any other ways, because of that numeric problem and I only need one-way synchronisation..

Thank you very much "Learn till the last breath."
 
You said
I do not know if replication is the only way of synchronisation

Replication is what you do to the DATABASE
Synchronisation is what you do to the DATA in a replicated database.

If you just have ONE active database and a 'copy' that you want to update on a one way basis every 'now and then' :- you could consider adding a changed flag to each table and making sure that the code remembers to set then 'Changed' flag whenever a record has some data updated ( 'Changed' defaults to True for new records )

Then write some code in the 'copy' database to download just the 'Changed' records - and also reset the flag for each record that it finds.


'ope-that-'elps.

G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
oh, and one last change you'll need to so in order to get the above to work - replace all of the AutoNumber fields with Long Integer fields in the copy database.

As you will never be creating new records in this copy - you won't find that a problem.

You aught to ensure that all forms in the copy database are prevented from making new records by setting the Allow Addition property to NO


'ope- that-'elps.

G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top