By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,500 Members | 830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,500 IT Pros & Developers. It's quick & easy.

Generic coding

P: n/a
Hi

I have two identical databases A & B with several tables. Each table has an
ID and a timestamp. Is it possible to write a generic procedure that will
take the table name (as it is same in both dbs) and the names of the two dbs
and update tables in db A from corresponding tables in db B depending on
which record is most recent? I am just trying to avoid writing code for each
of the tables.

Thanks

Regards
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
It sounds as if you are trying to duplicate part of the functionality of
Access' replication. Have you considered using that? While it is "not for
the faint of heart", neither would be writing your own replication
substitute.

How can you be sure that there haven't been updates to the same record on
both databases -- if there have been, are you certain that the most recently
updated should just overlay the other? What if the two updates updated
different fields in the table -- one updating an address and the other
updating a numeric amount/balance? Seems to me that you'd have to keep track
of the previous value, the updated value, and the date/time of update for
every field. And, suppose each database has an update to the same field,
same previous value -- even in this case, you need to be certain which was
the "authoritative" update. Suppose each had an update to the same field,
but each showed a _different_ previous value...

Seems to me that you may have to do something a great deal more complex than
what you describe if you are going to accomplish having the most recent,
authoritative data after you synchronize your databases. And the more I
consider that, the more I think your taking a close look at replication
would be a good idea.

Larry Linson
Microsoft Access MVP

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:40***********************@news.dial.pipex.com ...
Hi

I have two identical databases A & B with several tables. Each table has an ID and a timestamp. Is it possible to write a generic procedure that will
take the table name (as it is same in both dbs) and the names of the two dbs and update tables in db A from corresponding tables in db B depending on
which record is most recent? I am just trying to avoid writing code for each of the tables.

Thanks

Regards

Nov 12 '05 #2

P: n/a
Using a query would be more efficient.

Mike Storr
www.veraccess.com

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:40***********************@news.dial.pipex.com ...
Hi

I have two identical databases A & B with several tables. Each table has an ID and a timestamp. Is it possible to write a generic procedure that will
take the table name (as it is same in both dbs) and the names of the two dbs and update tables in db A from corresponding tables in db B depending on
which record is most recent? I am just trying to avoid writing code for each of the tables.

Thanks

Regards

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.