Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Save command
Message
De
07/03/2006 05:37:11
 
 
À
06/03/2006 23:09:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
01101936
Message ID:
01101987
Vues:
10
The trouble is that the table ALREADY HAS a record whose SHIPNO = the value you have in thisform.text1.value.
I presume that ShipNo is the primary key (PK) of your table and is therefore meant to be unique.

You COULD make ShipNo an integer, AutoInc field. Otherwise you need to check the table to ensure that there isn't a record with the new pk already.

>hi all,
>
>any idea ,help
>
>i try to run save command, i have error message Uniqueness of index "shipno" is violated
>
>Append From Dbf('temp')
>
>
>this is the code
>
>cAlias = Thisform.DataEnvironment.InitialSelectedAlias
>Select (cAlias)
>IF act_flag="1"
>     GO BOTTOM
>      LOCATE FOR UPPER(shipno)=ALLTRIM(thisform.text1.Value) AND  act_flag="1"
>  IF!FOUND()
>     Append From Dbf('temp')
>     replace transtype with "RE"
>     replace SHIPNO with ALLTRIM(thisform.text1.value)
>
>    With thisform.grid1
>          .recordsource = ''
>            Select temp
>          *  Zap  &&& another error ,many users can use this form
>          *delete all
>         .recordsource = 'temp'
>          thisform.text1.SetFocus
>         thisform.refresh
>   endwith
>**********************
>            with thisform.Grid1
>              .Recordsource = .Recordsource
>            endwith
>ENDIF
>endif
>
>
>
>thanks
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform