>I tried the following code:
>Select * from MyDbf into Cursor MyCur
>Select * from MyCur ---> Give an error
>
>Select * from MyDbf into Cursor MyCur where .t.
>Select * from MyCur ---> works fine
>
>Am I missing something here...how can I get consistent results ??
>
>Regards,
>Gerard
Sometimes Visual FoxPro decides to use a filter on an existing table, instead of creating the cursor as a separate table. In this case, the cursor can't be used in subsequent SELECT statements.
To avoid this, use the NOFILTER clause:
select * from MyDbf;
into cursor MyCur;
nofilter
select * from MyCur
This requires VFP 6 or later (or was it 5? - not sure); in earlier versions, a workaround is to add an additional field, which is not part of the table:
select *, .T. as UnusedField;
from MyDbf;
into cursor MyCur
select * from MyCur
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)