Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I PACK a table while my program is running
Message
From
14/01/1998 04:19:40
 
 
To
30/12/1997 03:05:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00068300
Message ID:
00071326
Views:
49
>>I'm trying to remove the deleted records from a table in my program. When I try to pack the table using code in my program it doesn't work (and I get no error messages) but when I use the same command at the command line it works.

>Are you really in the current table ?
>Use:
>SELECT yourtable
>PACK
>
>May be your try to pack with a buffering table. If your table is buffered, use TABLEUPDATE to commit or TABLEREVERT to rollback then open again the source table and pack it.

Another thing to consider is whether the table is opened exclusively. Most of the time, a developer's default setting in VFP is to open files exclusively, while in an application, files are often opened as shared, and PACK can only be executed against a file that is opened exclusively.

Unless there is some overriding reason to PACK a file during normal program execution, my standard solution is to provide a separate utility program that, among other things, opens all relevant files in the system exclusively and PACKs them one at a time.
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform