>I used to run my queries like this:
>
select * from table into cursor XXX nofilter
>select XXX
>if _tally=0
>messagebox('No data found!')
>else
>report form YYY preview
>endif
>Lately, I started to get the message even if my cursor has lines and I had to change it to the following way:
>
>select xxx
>ntotal=reccount()
>if ntotal=0...
>
>I have the problem with query that worked well till now, what's happening?
>Thank you for answer
>PS
>When I try to get the _tally value I get 0 (even with lines in the cursor).
There may be a difference between _tally and reccount(): Visual FoxPro may simply decide it is more efficient to place a filter on an existing table, instead of copying it to a temporary table (cursor). In this case, _tally is safer.
You can force VFP to copy records to a temporary table, using the NOFILTER keyword.
Hilmar.
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)