Yes, the solution was to use the ALIAS, not the file name. One person suggested it, then retracted it -- but it works for me.
BTW, I'm not sure how to indicate in a thread like this that a solution HAS been reached (particularly when the person who suggested it later retracted it.)
>I can't tell from all the threads and subthreads whether you solved this or not. If not, perhaps it's a caching issue? I've heard of situations where people have some form of write caching that causes a temp file not to be open-able in the nanosecond after it's written. Perhaps if you could insert a slight delay after your COPY command, say 0.1 seconds, and see it it helps that client.
>
>-- Randy
>
>>I'm getting the error message "File '58070939.dbf' does not exist." on the ALTER TABLE statement below; I don't understand how a file created by "COPY TO" could not exist, especially after I have USE'd it. (When the error occurs, the file is open in the current work area).
>>
>>Could this be related to the OS? I use XP, but my user is in NT.
>>
>>Any suggestions on alternatives would be welcome. (Note that I
want to use COPY TO, instead of SELECT, because of the current filter, if any -- which SELECT would ignore.)
>>
>>Thanks,
>>
>>Jim
>>
>>lcNewFile=SYS(2023)+"\"+SYS(3)+".DBF"
>>COPY TO (lcNewFile)
>>
>>lcAlias='_New_File'
>>USE (lcNewFile) IN 0 EXCLUSIVE ALIAS (lcAlias)
>>
>>FOR EACH oColumn IN loGrid.COLUMNS
>> lcColumn='_Col'+thorn(oColumn.COLUMNORDER)
>> DO CASE
>> CASE 'C'=VARTYPE(lcValue)
>> lcWidth=MAX(60,LEN(lcValue))
>> ALTER TABLE (lcNewFile) ADD COLUMN (lcColumn) C(lcWidth)
>>
Jim Nelson
Newbury Park, CA