>Anyone see a problem with the code below?
>
>IF NOT USED('CPRIME')
> USE CALLLOG AGAIN IN 0 ALIAS CPRIME ORDER TAG CALLPRIME DESCENDING
>ENDIF
>
>
>Its been working for months but has suddenly decided not to co-operate and falls over with the complaint that the file is in use. I already knew that dammit! Thats why I used "again".
>
>This would seem to suggest something has gone wrong elsewhere but I haven't a clue where to begin looking...
The problem may be in logic that sets up this command. I presume you are seeing error 3 and not error 108? What have you already discounted? For example, I'd start by breaking the program on the USE command, issue SET from the command line, and check all the open datasessions and aliases.
(edited due to premature send)
I particularly wonder if you have the alias used exclusively in another datasession. For example,
SET EXCLUSIVE ON
CLOSE ALL
SET SAFETY OFF
CREATE TABLE tmpCALLLOG (CALLPRIME i)
INDEX ON CALLPRIME TAG CALLPRIME
USE tmpCALLLOG
lo=NEWOBJECT('myForm')
DEFINE CLASS myForm AS FORM
DATASESSION = 2
PROCEDURE LOAD
IF NOT USED('CPRIME')
USE tmpCALLLOG AGAIN IN 0 ALIAS CPRIME ORDER TAG CALLPRIME DESCENDING
ENDIF
ENDPROC
ENDDEFINE