Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_tally
Message
From
06/03/2003 06:23:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/03/2003 06:07:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: _tally
Miscellaneous
Thread ID:
00762047
Message ID:
00762053
Views:
17
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform