Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between count and actual records

Status
Not open for further replies.

virgo

Programmer
Jun 21, 1999
88
US
People asked for a count of things in a particular file. <br><br>count for rcode=&quot;A&quot; gave 2771 records.&nbsp;&nbsp;The same things in Visual FoxPro version 6 gave 2774 records.<br><br>However, when I retrieved the data from the same file...<br><br>Select * from file where rcode=&quot;A&quot;, I only got 2338 records.<br><br>What caused the difference?<br><br>
 
I can understand the difference of a couple of numbers, 2771 and 2774, because of file locking and set delete commands.&nbsp;&nbsp;FPW sometimes does not access records that are locked.&nbsp;&nbsp;&nbsp;A good example of this is to open to FPW table and lock a record.&nbsp;&nbsp;Then open the table again and print a report. The record that is locked will not be on the report.&nbsp;&nbsp;This was fixed in VFP5.&nbsp;&nbsp;Try the test again on a back up copy of the tables so enviroment around the table can be controlled and the test conditions are the same.&nbsp;&nbsp;No one else is using the file and set deleted is off in both FP versions.<br><br>As far as the select statement.&nbsp;&nbsp;My FPW experience is exactly as you discovered.&nbsp;&nbsp;The results vary to much from run to run. I stopped using the select command in FPW and brute force coded what I wanted. I also found out the old brute force method runs faster then the select command.&nbsp;&nbsp;VFP is better at the select statements if the SQL is saved in the DBC.&nbsp;&nbsp;My experience still finds that, even in VFP, that the old brute force method is faster that an off-the-cuff select command. <p>David W. Grewe<br><a href=mailto:Dave@internationalbid.net>Dave@internationalbid.net</a><br><a href= > </a><br>
 
Brute force?&nbsp;&nbsp;like what David?&nbsp;&nbsp;<br>I was unable to duplicate inaccurate results with either RLOCK or DELETE regardless of the SETting of DELETE.&nbsp;&nbsp;But I am a loser&nbsp;&nbsp;:eek: <p>John Durbin<br><a href=mailto: > </a><br><a href= > </a><br>ICQ VFP ActiveList #73897253
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top