Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code takes too long to run
Message
De
10/08/2006 19:39:09
Mike Yearwood
Toronto, Ontario, Canada
 
 
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 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01144231
Message ID:
01144671
Vues:
17
>>>>You did say at one point the whole thing took much longer and then suddenly it was much improved. I didn't notice if it was exclusive or not. Network traffic could be the culprit.
>>>
>>>Something happened with the PC where this process was running, I think. I have no explanation for 2h. of running this process.
>>>
>>>>Now, a difference of only 5 seconds seems to disprove the chunking theory. It would fit my thinking of there being only a difference in the number of executing lines of code. Small difference, but there. How many records are we talking about?
>>>
>>>Just 2046 records to process.
>>
>>Then there's no need to spend time optimizing this.
>
>I think I see what's going on. I'm studying right now Batch Services code and see code similar to this in various places:
>
>DO WHILE lcErr == "Error Found!"
>			TRY
>				lnAttempt = lnAttempt + 1
>				IF lnAttempt != 100000
>					OPEN DATABASE (thisform.cDatabase) SHARED
>					lcErr = "Error Not Found!"				
>				ELSE
>					lcErr = "Error Not Found!"									
>				ENDIF	
>			CATCH TO oException1				
>				lcErr = "Error Found!"				
>			ENDTRY
>		ENDDO
>
>

If you made a local copy of the DBC, you wouldn't need such code and you'd get better performance over all.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform