More than one databases merged to one.(key issue)

dealwi8me

Registered User.
Local time
Today, 04:05
Joined
Jan 5, 2005
Messages
187
I'm trying to build an application that will allow the users to use databases that are not connected (because of location of some users they can't be online with main database).
Until now the keys where autonumbers generated by access but that was a problem when i tried to merge the databases.

What is the best way to assign the keys to the tables in order to merge them easily and correctly later?
The keys will be numbers generating from the application, not inserted by the user.

I thought of starting from a particular number in each database (6-digit) find the last record inserted, then add 1 and the result will be the key to the new record. I don't know if this is the best solution though.

Any suggestions will be appreciated.
 
I use random indicies to accomplish what you want. Seed the random number generator with "Now()" each time the database opens.

I've run tests generating multiple million index values without getting a duplicate.

If you don't reseed each time the database open, the Access random number generator use the same sequence creating duplicates. The Now() seed causes this method of generating index indices to work.
 

Users who are viewing this thread

Back
Top Bottom