Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ellen Solomon
  Where is Ellen Solomon?
 Bet Shemesh
 Israel
 Ellen Solomon
 To: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 Tags
Subject: RE: count records of closed table?
Thread ID: 155321 Message ID: 155325 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Saturday, December 29, 2007 11:39:47 PM         
   


> > Is there a way to count the records of a table without opening it?
> No. What are you trying to do?

Select a subset of records from myTable into a cursor, ideally using
MOD(RECNO(), lnDivisor)
where
lnDivisor = RECCOUNT(myTable)/1000


However, I just discovered that the code opens the table anyway, when it selects into the cursor. So counting it without opening it is irrelevant.

But once we're on the subject, may I ask if there's a better way to do this:

USE myTable

lnDivisor = INT(RECCOUNT()/1000)
if lnDivisor < 1
   lnDivisor = 1
endif

SELECT * FROM myTable INTO CURSOR FieldChk WHERE MOD(RECNO(), lnDivisor) = 0

USE IN myTable


ENTIRE THREAD

count records of closed table? Posted by Ellen Solomon @ 12/29/2007 10:38:26 PM
RE: count records of closed table? Posted by Eric den Doop @ 12/29/2007 10:50:53 PM
RE: count records of closed table? Posted by Ellen Solomon @ 12/29/2007 11:39:47 PM
RE: count records of closed table? Posted by Koen Piller @ 12/30/2007 10:24:22 AM
RE: count records of closed table? Posted by Ellen Solomon @ 12/30/2007 10:32:35 AM
RE: count records of closed table? Posted by Koen Piller @ 12/30/2007 2:31:03 PM
RE: count records of closed table? Posted by tushar @ 12/30/2007 6:34:41 PM
RE: count records of closed table? Posted by Ellen Solomon @ 12/30/2007 8:55:08 PM
RE: count records of closed table? Posted by tushar @ 12/31/2007 4:30:32 AM
RE: count records of closed table? Posted by Mike Yearwood @ 12/31/2007 4:34:49 AM
RE: count records of closed table? Posted by Ellen Solomon @ 12/31/2007 10:43:53 AM
RE: count records of closed table? Posted by Hugo Ranea @ 12/31/2007 6:17:26 PM
RE: count records of closed table? Posted by Tamar Granor @ 1/3/2008 10:45:33 PM
RE: count records of closed table? Posted by Ellen Solomon @ 1/5/2008 5:04:13 PM
RE: count records of closed table? Posted by Tamar Granor @ 1/7/2008 11:05:53 PM
RE: count records of closed table? Posted by Ellen Solomon @ 1/9/2008 10:40:36 AM
RE: count records of closed table? Posted by Ellen Solomon @ 1/10/2008 9:13:28 AM
RE: count records of closed table? Posted by Tamar Granor @ 1/10/2008 11:16:40 PM
RE: count records of closed table? Posted by Ellen Solomon @ 1/11/2008 9:58:29 AM
RE: count records of closed table? Posted by Cetin Basoz @ 1/4/2008 1:59:06 PM
RE: count records of closed table? Posted by Mike Yearwood @ 1/5/2008 5:04:55 PM
RE: count records of closed table? Posted by Cetin Basoz @ 12/29/2007 10:52:11 PM
RE: count records of closed table? Posted by Eric den Doop @ 12/29/2007 10:53:06 PM
RE: count records of closed table? Posted by Amphie Lucas @ 1/4/2008 6:30:58 AM
RE: count records of closed table? Posted by Nishant Gupta @ 1/4/2008 2:30:07 PM