Michelle,
You forgot "IN 0" or another work area. VFP is trying to open the
DBF in the same work area, so it's closing the table in the current work
area, erasing the tmp file, then trying to open it back up.
USE DBF() ALIAS testcur AGAIN IN 0
will fix it.
-Ed
>I have this code:
>
>
> SELECT DISTINCT a_arcust.custno, company, city, state, exchange,
> SPACE(80) AS list ;
> FROM a_arcust ;
> INTO CURSOR c_temp ;
> WHERE EMPTY(lc_cust) OR (a_arcust.custno = ALLT(lc_cust)) ;
> ORDER BY company
>
> SELECT c_temp
>
> USE DBF() ALIAS testcur AGAIN
>
>
>I get an error on the last line saying the file doesn't exist. So I put a SUSPEND right before it. This is what I get from the debugger:
>
>ALIAS() = "c_temp"
>DBF() = "C:\windows\temp\14266384.tmp"
>FILE(DBF()) = .F.
>
>Sure enough, that temp file doesn't exist anywhere on my hard drive. Why not? I'm not closing the cursor. I know I've used this trick before to make cursors writable and I never had a problem. I tried adding NOFILTER but that didn't make a difference.
>
>I'm completely baffled. Anyone have a clue?
>
>Thanks,
>
>Michelle