>thanks for the code....
>
>but it says file must be opened exclusively even when I have issued the statement:
>SET EXCLUSIVE ON
>What goes?
>Thank You
>Zaraq Bari
Zaraq,
The PACK command requires exclusive use of the table being packed. You may have SET EXCLUSIVE ON somewhere but I'll bet you this form has a private datasession and the set excl command is scoped to the data session. That means that your set exclusive doesn't count inside this form. In the form's Load event put SET EXCLUSIVE ON.
I hope this is a single user system, because openning tables exclusively is not a good thing in a multiuser environment. Also Packing can take time if a table is large, you might want to consider SET DELETED ON and doing the packing as a utility run at off peak times.