>>Hi,
>>
>>I have trapped (using Try / Catch) an error "File is not open" in the following section of the code:
>>
>>
>>IF SELECT("V_WO_NUM") > 0
>> SELECT V_WO_NUM
>> INDEX ON FIELD1 TAG FIELD1
>> INDEX ON FIELD2 TAG FIELD2
>> INDEX ON FIELD3 TAG FIELD3
>> INDEX ON FIELD4 TAG FIELD4
>> INDEX ON FIELD5 TAG FIELD5
>> INDEX ON FIELD6 TAG FIELD6
>> SET ORDER TO TAG FIELD3
>>ENDIF
>>
>>
>>Before the above code the cursor V_WO_NUM is created by SQL SELECT (getting data from a VFP table).
>>
>>What could possible be wrong with the above (not one time but almost every other day) that it causes the problem? And I could never duplicate this error on my PC.
>>
>>TIA
>
>AFAIK you can not add more than 1 index if the cursor is not created with readwrite clause. And if it is, then NOFILTER is redundant.
In VFP9 SP2 that is not correct:
CREATE CURSOR Source ;
( cStr C( 1 ) ;
, iInt I )
INSERT INTO Source ( cStr, iInt ) VALUES ( "A", 1 )
INSERT INTO Source ( cStr, iInt ) VALUES ( "B", 2 )
SELECT * FROM Source INTO CURSOR Test NOFILTER
SELECT Test
INDEX ON cStr TAG cStr
INDEX ON iInt TAG iInt
DISPLAY STATUS
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up