473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Generic coding

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
2 1264
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Roman Suzi | last post by:
Hi, I wonder, does Python support generic programming paradigm, and to what extent (I guess, it doesn't do it in full)? And (or) does it move in that direction? Will we ever see concept...
49
by: Steven Bethard | last post by:
I promised I'd put together a PEP for a 'generic object' data type for Python 2.5 that allows one to replace __getitem__ style access with dotted-attribute style access (without declaring another...
6
by: gong | last post by:
hi i recently looked at alexandrescu's book on c++, and i found it pretty much unintelligible. i have a few points which i wonder about. 1. as a developer, it is important, from a bottom line...
1
by: Stewart Rogers | last post by:
Hi all, I have been working on an ASP.NET application that is a kind of wizard ( a list of sequential pages ). We built that application for the CLIENT-A and it worked fine. After six months...
6
by: Doug Dew | last post by:
This won't compile: using IEnumerable<T> = System.Collections.Generic.IEnumerable<T>; namespace MyNamespace { public class MyClass<T> : IEnumerable<T> { // Appropriate stuff here }
5
by: Richard Brown | last post by:
Ok, I've been looking through the .NET SDK docs and stuff. I'm wondering if you can provide a control extender that does generic validation or functionality just by dropping it on the form. For...
10
by: Dimsion | last post by:
Hi everyone, I have been using VB5/VB6 and loving it but since my upgrade/new installation to VS.net 2003 and even the new VB.net 2005 beta 1. The GUI design is very slow and generic looking....
2
by: Nir.Hazan | last post by:
When I try to update my GridView I get the error: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: CustomerID, EmployeeID, OrderDate,...
8
by: MMAS | last post by:
Hey everyone -- Curious about some strange behaviour I'm seeing that seems to be related to my lack of understanding on how generics work in C#. Here's some simplified code (sorry for strange...
0
by: =?Utf-8?B?TW9ydGVuIFdlbm5ldmlrIFtDIyBNVlBd?= | last post by:
"Anders Borum" wrote: Hi Anders, I'm afraid the GetMethod() does not currently support filtering on generic parameters so you will have to loop through the existing methods using...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.