Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete empty tables
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00989602
Message ID:
00989618
Views:
38
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform