[AccessD] AutoNumber in replication

Heenan, Lambert Lambert.Heenan at AIG.com
Thu Aug 14 08:23:58 CDT 2003


I'm a bit late in coming into this debate, but the answer to your question
is, *you* don't handle it, Access does,

Briefly this is how it works. When you set a table to be replicable Access
automatically (and irrevocably) changes any AutoNumber fields to randomly
increment. So all the replication copies are using the same pool of 4.2
billion integer values. In addition Access adds a GUID field to the table
which is guaranteed to be unique.

Then, when you synchronize replicas, if any contain duplicate AutoNumber
values (and access can tell this using the GUID), Access will resolve the
conflict automatically, assigning a different AutoNumber value to one of the
conflicting record and all of it's child records. SO Access automatically
maintains the referential integrity.

This is of course just one more nail on the coffin for the idea of
*displaying* an AutoNumber field as a substitute for an "order number". The
human usable identifiers need to be generated manually. The simplest scheme
is perhaps a string, with a replica location  prefix or suffix and an
incrementing number, generated via the use of Dmax() in a form's
BeforeUpdate event.

Lambert

> -----Original Message-----
> From:	Don Elliker [SMTP:delliker at hotmail.com]
> Sent:	Wednesday, August 13, 2003 3:42 PM
> To:	accessd at databaseadvisors.com
> Subject:	[AccessD] Autonumber in replication
> 
> How do you all handle autonumber fields in replicated database schemas, so
> 
> that the autonumber remains unique? I have this as a pending issue where a
> 
> database tool is potentailly being rolled out to more users than a single
> BE 
> /multi FE setup would be good for. I have the primary key on the main
> driver 
> table set up as autonumber and I am trying to get my head around this 
> concept as applied to replicated db.
> _d
> 
> 
> "Things are only free to the extent that you don't pay for them".-Don 
> Elliker
> 
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*  
> http://join.msn.com/?page=features/junkmail
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com


More information about the AccessD mailing list