Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy Tables
Message
De
27/08/2007 08:37:33
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Copy Tables
Divers
Thread ID:
01250615
Message ID:
01250615
Vues:
54
Dear Experts

In curdir() there are two folders as
1- Tables
2- Backup

I want to copy all tables, those are not corrupted, from TABLES to BACKUP folder

For this I use following procedure but it does not copy

Please help
close all
close database

delete file 'Backup\*.*'

CD FULLPATH(CURDIR()) + [Tables]
m.no=0
m.missed=0

mfilename=sys(2000,"*.DBF") && GET FIRST FILENAME

do while not empty(mfilename) && LOOP UNTIL NO NEW FILENAME
	x=0
	on error x=1 && DETECT AN ERROR

	use &mfilename shared again
	if x=0 && NO ERROR OPENING TABLE SO LETS COPY IT!
		copy to [Backup\]+&mfilename with cdx && COPY TO FILE USING FOXPRO COPY FILE
	endif
	on error     && TURN OFF ERROR TRAP
	if x=1 && THE COPY CREATED AN ERROR
		m.missed=M.missed+1
	endif
	mfilename=sys(2000,"*.DBF",1) && GET NEXT FILENAME
	m.no=M.no+1
enddo

cd..

release thisform
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform