As far as I have seen, VFP always selects an empty area for the cursor. If you have tables opened in areas 1, 2 and 4, VFP will probably select area 3.
To open tables safely, don't specify a work area by number. Change your code to:
USE MyTAble ALIAS tbl1 in 0
USE MyTable ALIAS tbl2 in 0
This will automatically select an empty area for your tables.
Of course, you won't be sure in what work area your table is selected, but this doesn't matter. That's what you have the alias for!
To change work area later, change
SELECT 1
To:
SELECT tbl1
HTH, Hilmar.
>hi,
> I have problem that, SELECT-SQL ...INTO CURSOR statement may "overlap" my opened workarea.
>
>
>USE mytable ALIAS tbl1 IN 1
>USE mytable2 ALIAS tbl2 IN 2
>
>**the code above work fine
>SELECT * FROM mytable3 WHERE f1 = "A" INTO CURSOR csrTemp
>
>
>VFP doesn't create the cursor on workarea 3, instead it may overlap the previous workarea..work area 1 or 2.. so.. i try to not open any tables on that workarea which VFP will always create the cursor in. It work fine at my office. However, the error occured again if i move my project to other computer!!!
>
>How to solve this?
>
>Thank you
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)