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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Questionabout ZAP and PACK

Status
Not open for further replies.

safarijoe2000

Programmer
Jul 25, 2002
38
GB
Hello All,

I have a Form where I have a dummy table (dummy_table). I use this table throughout the program. I move fields, values, do calculations, etc, with the data in dummy_table.

At the end of the program, I want to delete everything from dummy_table (including records marked for deletion).

I have an Exit button, which contains my CLEAR EVENTS clause.

I also have an Exit option, on my Main Menu bar, which also has the CLEAR EVENTS clause.

My question is: I want to delete everything from dummy_table. Should I use ZAP or PACK ? Which one is more efficient and more appropiate?

I've tried both, and have used the following code:

close databases
open database myDatabase
use dummy_table excl
zap
use
close databases
 
I would use zap. but there is no difference. Attitude is Everything
 
An alternative solution is to re-create the table in the load of the form. Everytime you re-create it it will be empty, that might be an easier solution for a multi-user environment since PACK and ZAP require EXCLUSIVITY.
 
HI,
I generaly, dont like opening the table exclusive again in the above case. ZAP, PACK etc are EXCLUSIVE nature.

SO I prefer to have a view (not updatable) and have it indexed the way we want. In the view, you can add whatever records you want and when you want it blank.. just issue REQUERY(). (assumed the basic table on which the view is built is a blank table. Even otherwise, REQUERY() for .f.

Even easier, if you like SQL statements.
SELECT * FROM myTable WHERE .f. INTO DBF myOpenTable

The choice is yours anyway :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Thank you guys for all your suggestions.

You are right about ZAP and PACK requiring exclusivity, and perhaps that wouldn't be the way to go in a multiuser environment.

I tried the re-creation of the table and worked fine. I'll tried the View.

Thanks
 
safarijoe2000

I tried the re-creation of the table and worked fine.

Since the table is only temporary, an even better solution is to use a cursor (re-created in the load of the form)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top