Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparing 2 records
Message
De
28/07/2005 08:42:25
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
28/07/2005 08:14:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01036517
Message ID:
01036538
Vues:
10
I'm going to post a modified version of it anyway. Maybe someone else will find it useful. This one doesn't create a file of differences, but you could do any action you want once you know there is a difference. Like replacing a field value from one table into the other. The GETFILE could easily be removed and replaced with whatever tables you needed to run against.
m.FirstTable = GETFILE('DBF','Select FIRST table','Select')
m.SecondTable = GETFILE('DBF','Select SECOND table','Select')

ldifferent = .F.

USE (m.FirstTable) IN 0 ALIAS First
USE (m.SecondTable) IN 0 ALIAS Second

SELECT First
SET RELATION TO RECNO() INTO Second

SCAN
	FOR i = 1 TO FCOUNT()
		IF FIELD(i,'First') <> FIELD(i,'Second')
			* DO UPDATES
			ldifferent = .T.
		ELSE
			IF EVAL('First->' + FIELD(i,'First')) <> EVAL('Second->' + FIELD(i,'Second'))
				* DO UPDATES
				ldifferent = .T.
			ENDIF
		ENDIF
	ENDFOR
ENDSCAN
>Thanks, Jay, but I'm trying to "keep it in the family" so to speak. I don't want the user to be involved, or add any more functionality/interfaces. I'll have a go with Sergey's suggestion of CompObj().
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform