Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to QUICKLY determine if table does not have any reco
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01413534
Message ID:
01413592
Vues:
43
>>>>The only way you can have a performance problem with reccount() is, not with the function itself, but in opening the table - for example, if it starts with thousands of deleted records, and you have SET DELETED ON. Also, some users have reported performance problems (again, when opening tables), with certain antivirus products.
>>>
>>>Good point!
>>
>>I have SET DELETED ON at the beginning of the program.... sigh.... so I had to resort to this... what do you think???
>>
>>What I want to do is Enable or Disable a command button (cmdRelease) if I have at LEAST one record that is not deleted in the table poshold.... SET DELETED is ON
>>
>>
>>LOCAL llEOF, llBOF
>>
>>*TMT 07/21/09 llEOF and llBOF
>>llEOF = .F.
>>llBOF = .F.
>>
>>SELECT poshold
>>GO bottom
>>IF EOF()
>>	STORE .T. to llEOF
>>ENDIF 
>>GO TOP
>>IF BOF()
>>	STORE .T. to llBOF
>>ENDIF 
>>DO case
>>	*No records at all
>>	CASE llBOF AND llEOF
>>		Thisform.cmdrelease.Enabled = .F.
>>	*One (or more) record(s) (at least one is not deleted), period
>>	CASE NOT llBOF AND NOT llEOF
>>		Thisform.cmdrelease.Enabled = .T.
>>	*All records are deleted 
>>	CASE NOT llBOF AND llEOF
>>		Thisform.cmdrelease.Enabled = .F.
>>ENDCASE 
>>GO TOP IN poshold 
>>
>>Thisform.Closable=.F.
>>
>>
>>I could tighten this up and just have...
>>
>>
>>DO case
>>	*One (or more) record(s) (at least one is not deleted), period
>>	CASE NOT llBOF AND NOT llEOF
>>		Thisform.cmdrelease.Enabled = .T.
>>ENDCASE 
>>
>>
>>since that was the only condition that made the cmdRelease Enable to be True... (that we have at least ONE record that is not deleted).
>>
>>Tommy
>
>You could do
>
>
>SELECT poshold
>LOCATE
>Thisform.cmdrelease.Enabled = NOT EOF()
>
>
>Locate will try and find the first record if it's at EOF then it found none.

Interesting..... Thanks!
Tommy Tillman A+ NetWork+ MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform