The FOPEN() works with a table as a file. IOW, it doesn't know or cares that the file happens to be a table.
>Thanks, Sergey. I would not have thought of this. I will be interested to see if this solves the problem of the OS thinking the DBC is still open - I see that lnFH is the file handle for the table. i guess I am not clear about how the DBC opens and closes relative to how the table opens and closes. I'll let you know as soon as i test this.
>
>>You can use FOPEN.
lcDbfName = "h:\mytables\mytable.dbf"
>>lnFH = FOPEN(lcDbfName, 12)
>>IF lnFH > 0
>> =FCLOSE(lnFH)
>> * Ok to work with the table
>>ELSE
>> * The table is open somewhere else
>>ENDIF
>>
>>
--sb--