You could try this....
lcTableName = GETFILE('DBF','Select Table To Fix')
lcTableValidate = 'set tablevalidate to 0'
&lcTableValidate
use &lcTableName exclusive
alter table &lcTableName add column vvvxxxvv c(1)
alter table &lcTableName drop column vvvxxxvv
use
lcTableValidate = 'set tablevalidate to 3'
&lcTableValidate
lnYesNo = MESSAGEBOX('Finished: ' + ALLTRIM(lcTableName)
>guys,
>
>i have a database containing about a bunch of dbfs. the dbfs have field names greater than 10 characters, default values, triggers and joins. here is the problem i have:
>
>once in a while a table gets corrupted. so what i end up doing is
>
>1. set tablevalidate to 0
>2. copy the table to a backup
>3. remove the corrupt table from the database
>4. rename and then add the backup table
>5. rename all the fields and add the default values, triggers, etc.
>
>as you can see step 5 is a pain in the neck. is there a way i can do this more efficiently?
>
>thanks,
>
>nancy
ICQ 10556 (ya), 254117