MartyConnelly
martyconnelly at shaw.ca
Mon Oct 24 13:28:08 CDT 2005
Easy way is Total Access Detective from FMS $199.
http://www.fmsinc.com
Here is a function that should do part of the trick (it assumes that
there are the
same records in each table matching on primary key ID. If not, just put in
logic to move the recordsets until the keys match.)
If they are out of sync the coding gets busy real fast.
Function CompTables()
Dim DB As DAO.Database, i As Long
Dim rs1 As DAO.Recordset, rs2 As DAO.Recordset
Set DB = CurrentDb()
Set rs1 = DB.OpenRecordset("Vc")
Set rs2 = DB.OpenRecordset("Vp")
Do Until rs1.EOF
For i = 0 To rs1.Fields.Count - 1
If rs1(i) <> rs2(i) Then
'do something here like write it to a log table
End If
Next i
rs1.MoveNext
rs2.MoveNext
Loop
rs1.Close
rs2.Close
Set rs1 = Nothing
Set rs2 = Nothing
End Function
John Colby wrote:
>Does anyone have any code for discovering the DIFFERENCES between the tables
>in two Bes? I can't remember if this is available in the BE Updater.
>
>John W. Colby
>www.ColbyConsulting.com
>
>Contribute your unused CPU cycles to a good cause:
>http://folding.stanford.edu/
>
>
>
>
--
Marty Connelly
Victoria, B.C.
Canada