Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add records
Message
De
25/08/2004 10:19:24
 
 
À
25/08/2004 08:57:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00935865
Message ID:
00936293
Vues:
31
>hi,
>thank you,
>i insert at thisform.text7.value="121" or "112"
>and thisform.text8.value=15
>but i get at toto 15 records with char1="111",i mean different data.
>
>and can i delete from newammar66 the records i put it at toto.
>
>thank you very much.
>
>CLOSE all
>SELECT * FROM newamar66 ;
>WHERE char21=(thisform.text7.value);
>INTO CURSOR tmpAppend
>
>USE Toto IN 0
>
>FOR I = 1 TO THISFORM.text8.Value
>
>    SELECT Newamar66
>       SCATTER NAME oData
>    INSERT INTO Toto FROM NAME oData
>ENDFOR
>
>
>best regards.
>m.qasem

Several problems.

1. You are selecting the records you need from NEWAMAR66 and putting them into a cursor called tmpAppend. But then you scatter the values from NEWAMAR66

2. Even if you had selected the proper workarea, you never move the record pointer and consequently always get the data from the same record.

Try this (code is untested and may need a tiny bit of tweaking - my version of fox does not seem to support INSERT INTO FROM NAME object)
CLOSE TABLES ALL
SELECT RECNO() AS delrecno,* FROM newamar66 ;
WHERE char21=(thisform.text7.value);
INTO CURSOR tmpAppend

USE Toto IN 0
lnScope = THISFORM.text8.Value
SELECT tmpAppend
SCAN NEXT lnScope
     SCATTER NAME oData
     INSERT INTO Toto FROM NAME oData
     SELECT newamar66
     GOTO tmpAppend.delrecno
     DELETE
     SELECT tmpAppend
ENDSCAN
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform