Hi Terry
FoxPro tries to optimize queries by sometimes applying the equivalent of a SET FILTER instead of building the cursor. That's why the NOFILTER clause was added.
BTW, you may get a performance boost if you don't use the property nZone directly.
lnZone = .nZone
select ... and CENSUSZN.ZONE = m.lnZone
>Hello Gurus
>
>I'm selecting census data about human populations in various zones. I have the concept of zone groups, the zones in a County, those in a district, all zones, etc. I use SQL successfully to fetch the correct data.
>
>However, on the simplest of all, feching the data for an individual zone, as soon as I access my cursor, I get the error message:
>
>Variable "NZONE" is not found.
>
>Now, when I select a zone from a combo, I set the form's numeric prop .nZone to its key. Then I select the data via:
>
>
> Select * from mclMPFAC!CENSUSZN ;
> Where CENSUSZN.VAR_ID = 0 ;
> and CENSUSZN.ZONE = .nZone ;
> Into Cursor csrCensusZn
>
>
>CENSUSZN is a collection of population fields, each rec with a Zone # and a variant # (VAR_ID) - Simple!
>
>I use the same cursor name for all the more complicated selects and no problem. But after creating the cursor in this case, I halted the prog and saw, in debug, that a filter had been created, thus:
>
>ZONE.AND.=NZONE
>
>No wonder I get the above err mess. But why!?
>
>None existed before and the filter doesn't occur in ANY of the other cases. I've put in a "Set Filt to" command to enable me to get at the data but the cursor features ALL zones, not just the one row for the selected zone.
>
>Can anyone help, please?
>
>TIA
>
>Terry