Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking if item already exists
Message
De
18/10/2007 15:30:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01261920
Message ID:
01261929
Vues:
10
Missing informations. Is the textbox bounded to the field Banco in the cursor Bancos1 or Bancos? Is this a multi-user application? If so, your logic would not work in the case that 2 users enter the same value at the same time. Can you make the field a candidate key in the table instead? Or use a trigger?

>I need to know if an item is in a table before updating the table
>
>From the table bancos.dbf I have two cursors as below, buffered
>pessismist (4)
>
>
>SELECT BANCOS1
> BROWSE
>
>SELECT BANCOS
> BROWSE
>
> LOCATE FOR (UPPER(BANCO) = UPPER(THISFORM.TEXT1.Value)
>
>IF FOUND ()
> = MESSAGEBOX ("The record already exists")
> RETU
> endif
>
>= MESSAGEBOX ("uptade")
> SELECT bancos1
> TABLEUPDATE()
> THISFORM.Release
>
>At the first time it works fine, because as in browse test
>the new item only appear in bancos1 and not in bancos
>
>
>The problem is that if the item already exists,
>then it always will repeat "item already exists" even
>if I type a completely differente item
>
>It looks like it accour an inversion, because the item
>is not shown in bancos1 but is shown in bancos
>
>So, I have the false menssage that the item already exist
>
>Moises
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform