Synch Database

Moore71

DEVELOPER
Local time
Today, 20:11
Joined
Jul 14, 2012
Messages
158
Hi,
I want code to synchronize 2 or more databases.
The databases are the same, but in different media,like in mobile flash drive,backup drive and main system
Thank you
Moore71
 
you can only sync .mdb files (not .accdb) and you need to have set up a master and copies originally.

If your db's are not like this, then syncing as such is not possible. You may be able to merge tables by comparing record by record and importing records in one table that are not in the other. However where you have the same record in both db's but with different data, how will you decide which is the correct record?

To merge tables then you can use a query like this pseudo code which assumes that both tables have the same structure.

Code:
INSERT INTO Table1
SELECT Table2.*
FROM Table1 LEFT JOIN Table2 ON Table1.id = Table2.id
WHERE Table2.id Is Null

Where you have sub records (e.g. invoice line records are sub records to the invoice header record) you will need to ensure that the linking fields are preserved.
 

Users who are viewing this thread

Back
Top Bottom