Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Counting Records
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00465935
Message ID:
00465954
Vues:
10
>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

There will be an incorrect nCnt if there is an ORDER set on the table (GOTO BOTTOM may not put you on the last RECNO()). You can replace the

GOTO BOTTOM
nCnt = RECNO() - nDel

with

nCnt = RECCOUNT() - nDel
Chris McCandless
Red Sky Software
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform