Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record Number/ SEEK() / Edit Mode
Message
 
 
À
13/09/2002 14:04:33
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00700262
Message ID:
00701237
Vues:
17
Then your code would be:
SELECT COUNT(*) KOUNT FROM MYTABLE WHERE CCode = ?cCCode INTO CURSOR crsTemp
IF crsTemp.Kount > 1
   * disallow the change
ELSE
   * Then there is no other record with that code
ENDIF
Since you use pessimistic buffering, the result should always be exactly 1 which would be your courrent record. If the result is 2, then there obviously is another record plus the current record. If the result is more than 2, then you have other problems. In the SQL above, the parameter cCCode needs to be a memory variable name and not have a matching field name in the table. To be sure, you could always code it as m.cCCode or some other varname.

>I tried the code:
>
>It finds the "ccode" always, whether it has been previously in the file or not.
>
>I am using pessimistic record locking.
>
>Is there anything else I should be looking at?
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform