>Oops, I left out an important element in the question. I want to compare the DATA to see if the file are identical.
>
>Bill
Now
that is a major challenge. You could do a byte-by-byte comparison. Or, especially if your table has a PK, you could run a SELECT statement to see, for instance, what records are in one table but not in the other, or what records have different values in certain fields.
A byte-by-byte comparison is actually quite easy:
? FileToStr("Table1.dbf") = FileToStr("Table2.dbf")
Since the tables might have the same data in a different order (especially in the memos!), I would first copy them to temp tables:
use Table1 order "MyPK"
copy to Temp1
use Table2 order "MyPK"
copy to Temp2
use
? "Table1 and Table2 are " + iif(FileToStr("Temp1.dbf") = FileToStr("Temp2.dbf"), "identical", "different")
? "The corresponding memo files are " + iif(FileToStr("Temp1.fpt") = FileToStr("Temp2.fpt"), "identical", "different")
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)