Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I evaluate if a database is empty
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00107610
Message ID:
00112606
Vues:
56
>>>>>When filtering, reccount() will always return the true record count while ignoring the filter. Might I suggest an sql into a cursor and then an _tally to verify that you have one record.
>>>>
>>>>Why not just use COUNT? Set the filter and COUNT. A rushmore optimized count is FAST.
>>>
>>>How's this for speed...
>>>
>>>LOCATE FOR .T.
>>>IF EOF()
>>>*...table is empty
>>>ENDIF
>>
>>Would it be all that much faster than a count? I am not too sure.
>
>If the table is _not_ empty, even a rushmore optimized count can take a long time (depending on the number of records).

Good point. P.S. You don't need the condition on the locate. You could:
LOCATE
IF EOF()
   *...table is empty
ENDIF
and get the same results.
Menachem Bazian, CPA
President
BC Consulting Services, Inc.
973-773-7276
Menachem@BazianCentral.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform