Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need a a better way to do this
Message
De
04/02/2005 11:09:15
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00983858
Message ID:
00983876
Vues:
21
>I query a network table to a local table. The local table is
>used to populate a list.
>
>For every record in the local table, I need to mark it's network
>copy so that no other users can access it.
>
>I have:
>
>** Get the alias of the local table
>cAlias = ALIAS()
>			
>** Set the index of the network table
>SET ORDER TO Id IN Resh
>			
>** Loop once for each local record
>SELECT (cAlias)
>SCAN
>
> ** Locate the network record
> SELECT Resh
> =SEEK(&cAlias..Id)
>				
> ** Store the batch id and user name to the network record
> REPLACE IN Resh BatchNo WITH .nBatchNo,;
>                 Used_By WITH oApp.cUserId;
>                 NEXT 1
>
>ENDSCAN
>
>
>The problem is that this is really slow.
>
>Anyone know how to speed this up?

Try this...
** Set the index of the network table
SET ORDER TO Id IN Resh
			
** grab these values to memvars because they're
** so much faster than properties.
LOCAL lnBatchNo, lcUserID
lnBatchNo = .nBatchNo
lcUserID = oApp.cUserID

** Loop once for each local record
SELECT (cAlias)
SET RELATION TO ID INTO Resh

REPLACE ALL ;
  BatchNo WITH m.lnBatchNo, ;
  Used_By WITH m.lcUserID ;
  IN Resh
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform