Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to zap all tables but retaining one table intact

Status
Not open for further replies.

channelmaster

Technical User
Dec 9, 2001
52
PH
good day! How can I zap all tables but retaing one table intact. The scenario is this: I have 5 tables; table1, table2, table3, table4 and table5. I want to zap table2 to table5 but retain table1 intact. Thanks in advance.
 

USE table2 EXCLUSIVE
ZAP
USE table3 EXCLUSIVE
ZAP

and so on
Dave S. [cheers]
 
channelmaster

Code:
public array myTables[1]
Close Databases All
set default to c:\assurance\data
nCount = ADIR(MyTables,"*.DBF")
for i = 1 to nCount
   store myTables[i,1] to cName
   if cName <> &quot;Table1&quot;
     use &cName EXCLUSIVE
     ZAP
   ENDIF
NEXT

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Dear Mike
There was an error &quot;cName is not a table&quot; generated. Thanks again.
 
Gotta be some kind of typo,

The code works rather too well for me!

Griff Regards

Griff
Keep [Smile]ing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top