Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete empty tables
Message
From
23/02/2005 10:25:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
23/02/2005 10:06:13
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:
00989631
Views:
16
That should work, but might be slow for large tables. For efficiency, I would suggest:
  • If empty records count as "records", simply check reccount().
  • Otherwise:
    locate
    llEmptyTable = eof()
    >
    USE Temp\TableA SHARED
    >COUNT TO lnRecCnt
    >USE
    >
    >IF lnRecCnt = 0
    >   DELETE FILE Temp\TableA.DBF
    >ENDIF
    HTH
    >DELETE FILE Temp\TableA.DBF>
    >This command will delete tableA, but how should findout this table has no records?
    >>I want delete only empty tables within directory called TEMP.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Reply
    Map
    View

    Click here to load this message in the networking platform