Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete ,append
Message
 
 
À
02/05/2005 02:58:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Divers
Thread ID:
01010089
Message ID:
01010111
Vues:
22
>hi all.
>i try via code under to update my data, via temp.table ,
>but if i remove any item,or update any item , and i call it again isee the items. increase.
>and i get error message file must be opend exclusively, som times
>at delete--->pack ---->infinit loop
>
>
> IF USED('table1')
>  SELECT table1
>ELSE
>  SELECT 0
>  USE table1 AGAIN
>ENDIF
>  SELECT * FROM table1 WHERE dvno==THISFORM.TEXT2.VALUE  AND table1.dat=thisform.text5.value  INTO ARRAY laResults
>
> scan
>   DELETE FOR dvno==THISFORM.TEXT2.VALUE  AND    table1.dat==thisform.text5.value
>       PACK          &&infinet loop
>       GO TOP
>endscan
>
>Append From Dbf('temp')
>SCAN  FOR   table1.dvno==THISFORM.TEXT2.VALUE  AND table1.dat==thisform.text5.value
>replace dat WITH thisform.text5.value
>replace dvno WITH thisform.text2.value
>replace peri WITH thisform.combo2.value
>endscan
>
>DELETE ALL  IN temp
>thisform.grid1.Refresh()
>
>
>thanks.

Hi Mohammed,

Remove PACK and GO TOP from the scan loop. You can do PACK after you're done the job. In order to PACK you would need to open your table exclusively.

I just quickly re-viewed your code and it seems to me you don't need to use SCAN at all since you're using DELETE FOR
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform