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

Zap DBF file

Status
Not open for further replies.

ronphx

Programmer
Jun 24, 2004
64
US
I have a file in dBase that is a temporary file. I want to delete the items in that file (Zap it) with Access 2003 VBA code, then I want to add new items to the temp file. It really isn't difficult to do, but the problem is that when I bring up the temp file in dbase, the deleted items still show. They are marked for deletion, but they are still present. I have to then go into dBase and pack the file. Is there a way from access to get rid of these old items so they don't show when I use the file from dBase? In other words, can I ZAP the file from Access VBA? This file is given to other users, so I'd really not like to make a dBase setting or set up an ODBC database if possible.

Thanks.
 
When you say "Zap it" are you referring the dBase ZAP command? This effectively deletes all records in the table and then packs that table so deleted records just shouldn't be visible.

I'm afraid I'm not up to date on dBase - I switched to FoxPro many years ago. If this were Fox I'd be calling it as an Automation server from Access:
Code:
Set oFox = CreateObject("VisualFoxPro.Application")
oFox.DoCmd "Use TempTableName Exclusive"
oFox.DoCmd "Pack in TempTableName"
but I don't know whether dBase can do this.

Geoff Franklin
 
Thanks for the idea. I'll explore this to see if I can create a dbase application object. I'll let you know if it works.

Thanks again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top