Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete empty tables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00989602
Message ID:
00989618
Vues:
36
>There are five Tables in a directory entitled "TEMP"
>Two tables have data and the rest three are empty.
>
>I want to delete empty tables programatically.
>How is it possible?


Perhaps something like this (assuming that TEMP is a subfolder of the current directory):
ADIR(aFileList, "TEMP\*.DBF")

FOR i = 1 TO ALEN(aFileList, 1)

   cTable = aFileList[i, 1]
   USE (cTable) IN 0
   iRecords = RECCOUNT(cTable)
   USE IN (cTable)

   IF (iRecords = 0)
      DELETE FILE ("TEMP\" + cTable)
   ENDIF

ENDFOR
Laterness,
Jon
Jon Rosenbaum
Devcon Drummer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform