Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting Records
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00465935
Message ID:
00465952
Views:
11
>I have a large table that I need to count the number of records on a regular basis. I was using - Count to nRecords - but it got to be too slow. So I created an index on Deleted() and am now using the following code. It is now instant.
>
>Does anyone see a problem with this? TIA
>
>Set Deleted Off
>Select TableName
>Count To nDel For Deleted()
>Goto Bottom
>nCnt=RecNo()-nDel
>Set Deleted On

If you want the number of undeleted records you could also take the difference of RECCOUNT() - nDel. No big deal since this only saves you 1 line of code.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform