Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Repalce and Delete Commands Not Working - help needed
Message
De
13/10/1998 04:44:22
Yin Min Chen
Nec Home Electronics(M) Sdn Bhd
Sungai Petani, Malaisie
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Repalce and Delete Commands Not Working - help needed
Divers
Thread ID:
00146137
Message ID:
00146137
Vues:
63
Dear Everyone,
I have a code which doing a delete function, before delete, i want to change the primary key to 1 of the unique string by calling SYS(2015).
Below is my code :-

lnRecNo = RECNO()
Replace usercode with SYS(2015) Record lnRecNo
DELETE FROM tsmtranh WHERE usercode=thisform.txtUserCode.Value

After running the program, the usercode has been updated but the record is not deleted. If I comment the Replace command, the delete command just works fine. Why???

I suspect that the value of usercode has been change but thisform.txtUserCode.Value still keeps the old value. So I change my code to below:-

lnRecNo = RECNO()
lstrVal = SYS(2015)
Replace usercode=lstrVal Record lnRecNo
DELETE FROM tsmtranh WHERE usercode=lstrVal

But it still doesn't work.

Anyone out there knows why?

TQ.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform