If you SET EXCLUSIVE ON and then OPEN DATABASE or USE, then data is open exclusively. It's not straightforward, because firstly you should close all data, then open some exclusively, then close it, and then reopen in shared mode for normal application flow. You see, it depends on your application design. I don't think you should spend much time on that until you finish 'normal application flow'. So far, you may always PACK from VFP itself, i.e. command window.
>How do I open my table exclusively and pack my table?
>
>>You application may have separate 'maintenance' module where data will be open >exclusively and you will give a user options to PACK, REINDEX, VALIDATE, etc.
>
>I might need these options later on as well. Please help.
>
>
>DELETE FROM testdata ;
>WHERE testdata.serialnum = m.lcSerialNum AND ;
> testdata.testdatewrk = m.ldDateWrk
>
>* I am not sure about this. I get File in use program error...
>USE testdata EXCLUSIVE
>PACK testdata
>
>
>Thanks,
>Sam
Edward Pikman
Independent Consultant