McKirahan wrote on 11 feb 2008 in
> "Charlotte" <> wrote in message
>> i've googeled to find a asp-script that can compare all the records
>> in two different access databases
>> the mdb's have exactly the same tables
>> what i want is that (the output) all the differences comes in a
>> html-table in a webpage
>> can anybody help me, are give me a example ?
>
> Is a primary key defined?
> What do you want the output to look like?
>
> Given this layout: "key,field1,field2"
> where table 1 contains
> 1,a,b
> 2,c,d
> and table 2 contains::
> 1,a,b
> 3,e,f
> How would you want the differences reported?
>
> Perhaps just identifying the "key" differences?
> table1 : 1=,2+,3-
> table2 : 1=,2-,3+
Interesting thought.
That however, wouldn't be really usefull for the OP, methinks,
as the goal would probably be to be able to correct inter table mistakes.
=========
Say you have two tables t1 and t2, each containing these fields:
id,lastname,firstname,street,postcode,haircolour
and each 100 records:
if there are no more than single equivalent records,
and even if you ignore the id-field differences
each record of t1 has 99 or 100 non-aequal records in t2 to report,
so there would be 9900 or more lines in the report plus 9900 seen from t2
to tt1, totalling 19800 to 20000 reportlines.
Not very useful imho.
==========
Better report a subset, [a view in relational database parlance]:
-- ignore the id field as above
-- only test the records with the same last names
-- order by last name, firstname, haircolour
Now you get a reasonable amount of report lines, perhaps 5 or 60,
but If you have a lot of records of one extrended family, the members
will report on eachothers differences and the report lines could swell to
2000 or more easily, if all lastnames are alike, perhaps to the 19800 of
above.
Also you will then loose writing mistakes of one of the corresponding
lastname fields.
This cannot be helped unless you develop an algorithm to define
'nearequal' or 'sounds-like' for the last name or define another field
that is assumed correct as key field, like a social security number in
this person-table example, or assume two fields to be correct, like
lastname plus postcode, but I would not think that is reasonable.
===========
So Charlotte, even before you touch the sql and the niceties of inner and
outerjoin, please reconsider what you really want.
Read about view in relational databases:
<http://en.wikipedia.org/wiki/View_(database)>
and oh yes, define what database engine you are using,
otherwize only a general sql advice can be given.
<http://en.wikipedia.org/wiki/SQL> [ook in Nederlands]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)