If the USE fails and your error handler isn't handling it properly or the user chooses to ignore, they'll get that error when the PACK fires.
BTW, PACK does a REINDEX automatically, if there were any deleted records.
>One of my users is getting the message "No Table is open in the current work area". I am looking through all of the files in the database and issuing the PACK command. Does anyone know why I would get this error message?
>
> countdbfs = ADIR(dbfarray,CURDIR()+'\data\*.dbf')
> FOR stepx = 1 TO countdbfs
> THISFORM._progressbar1.UPDATE((stepx/countdbfs)*100)
> THISFORM.label2.CAPTION = ALLTRIM(dbfarray(stepx,1))
> use_string = SYS(5)+CURDIR()+'\data\'+ALLTRIM(dbfarray(stepx,1))
> SELECT 0
> USE &use_string EXCL
> PACK
> REINDEX
> USE
> NEXT
>
>Thanks!
>
>Randy Wessels