Physics Forums

Physics Forums (http://www.physicsforums.com/index.php)
-   Computers (http://www.physicsforums.com/forumdisplay.php?f=190)
-   -   Compare and/or combine two Access database tables (http://www.physicsforums.com/showthread.php?t=573498)

Studiot Feb2-12 11:55 AM

Compare and/or combine two Access database tables
 
I have just discovered that two people have been typing into separate copies of 'the same' MS Access database for some while.

It came to light when one said, "Why can't Jo see the changes I make?"

Any suggestions on how to combine the two tables or at least compare them with a view to copy/pasting/appending the differences so that a great deal of work is not lost?

The two copies are of the same database so all the fields are the same.

JaredJames Feb6-12 01:27 PM

Re: Compare and/or combine two Access database tables
 
If it was me, I'd write a script to open both tables, read a line from one and then iterate through the whole of the second table to check for a duplicate. If found, skip it. If not found, add to the end and generate a unique ID (or let Access do it if it's automatic).

I'm pretty sure you could even use the SQL to compare the two. But I'm not entirely sure on that.

Haven't used Access in a few years, but I can have a go at coding it roughly if you need it?

Studiot Feb6-12 01:33 PM

Re: Compare and/or combine two Access database tables
 
Hello Jared, welcome back, hope the exams or whatever went well.

Yes please coding/ programming is not my bag.

JaredJames Feb6-12 01:38 PM

Re: Compare and/or combine two Access database tables
 
Actually, simpler would be for you to use an append query.

It will add the rows from one to the other and ignore duplicates. If it throws errors, ignore it.

Studiot Feb6-12 02:32 PM

Re: Compare and/or combine two Access database tables
 
OK thanks, however I'm not sure that append will work since only one field in a record may have been changed, so the record may appear in both copies, but one may have an updated field. I would need the latest version by date in that case.

JaredJames Feb6-12 02:46 PM

Re: Compare and/or combine two Access database tables
 
You'll have to give me a day or so then so I can try and work through it.

It's actually really simple, I just haven't done it in ages.


All times are GMT -5. The time now is 02:23 AM.

Powered by vBulletin Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2014 Physics Forums