Can some one suggest what might give me a File already open
error with the following code?
CLOSE ALL && in the beginning, I find some SS
&& that is in sec.dbf
USE SEC ORDER SS
SEEK my_ss
IF FOUND() = .T.
ac_rec = RECNO() && save the record number for later
CLOSE ALL
USE EMP ORDER SS
SEEK my_ss
IF FOUND() = .T.
ss_rec = RECNO() && get the record number for it in
CLOSE ALL && the emp.dbf
ELSE
CLOSE ALL
RETURN
ENDIF
ELSE
CLOSE ALL
RETURN
ENDIF
CLOSE ALL
USE SEC ORDER SS && now I'm ready to delete the record
DELETE RECORD ac_rec
PACK && this is where the error occurs or at the next pack
CLOSE ALL
USE EMP ORDER SS
DELETE RECORD ss_rec
PACK
CLOSE ALL
CLEAR ALL
RETURN
I can run it through once and it errors. I clear up
everything run it again once or twice and its ok.
Run it a third time and it errors. (if this was C,
I'd say I had a null pointer or something). This
error does not always occur on the same number of
run throughs. I have not opened any other work
areas.
I have tried various versions of this, but they end
up with the same result. I have isolated the error to
this code. The de* shows me that things close
when I tell them to and that the databases open when
I tell them to.
This project is due next week and this is the final
error. Please help.
Thanks in advance,
Mylene Marquez