Hi, I am developing a system and every week a have to change same dbf of my clientes. My idea is only send a new dbf and the system analyse if has to be change or not.Of couse if the new dbf was changed. how do i do this ???
Hi
1. You can first pack the old DBFs
2. Then issue a command to rename the oldDBF suitably.
3. Copy the new DBF (empty one)
4. Append from the OLD DBF suitably replacing fields or by general append
Hope this helps
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK
[tt]
=adir(laOld, "x:\xxx\xxx\OLDDBF.DBF"
=adir(laNew, "y:\yyy\yyy\NEWDBF.DBF"
for x = 1 to 4
if laOld[x] <> laNew[x]
Use X:\xxx\xxx\OldDbf exclu
copy to X:xxx\xxx\olddbf.old
zap
pack
append from Y:\yyy\yyy\NewDbf
exit
endif
endfor
[/tt]
David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
the idea is
1- verify is the structure of the new dbf is the same of the old one
2- if .f. them modify the old dbf for iqual as the new one
3- verify the cdx files
My problem is how to compare the structure of the dbf and the cdx files.
my idea is to put into executable the structure of new dbf and them compare every time the client run's the program
The function has to read the new dbf from memory, compare the database, the index and if find any difference, them rename the old dbf 1 empty dbf from memory them append from old dbf. But i dont know how !?!?!
Appropriate command is
COPY TO old/newfile STRUCTURE EXTENDED
and compare in doubled cycle each field, each record.
First difference - you use Ramani or Dgrewe
resolutíon.
Index create always new.
Still better:
func IDENTSTR
sele OLDFILE
COLD = afields(OLD)
dime OLD(COLD * 4)
sele NEWFILE
CNEW = afields(NEW)
dime NEW(CNEW * 4)
if CNEW = COLD
i = 1
do while i <= COLD * 4
if OLD # NEW
retu .F.
endif
i = i + 1
enddo
* old and new are identical
retu .T.
endif
retu .F.
(only idea, not tested)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.