Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for Candidate Key
Message
De
28/10/2003 05:20:44
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/10/2003 05:09:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00843412
Message ID:
00843417
Vues:
33
>Hi all,
>
>I'm using views for my forms. Each of my table (VFP) has generated primary field. All the indexes whether primary or candidate, the type is regular index. The checking for the primary is done under the hood but it does not check for candidate. So before saving, I tried to SQL Select for the DBF to check whether the similar record with same candidate key exist. However, the SQL Select always return records including the current 1 I'm adding. How do I overcome this?
>
>Thanks in advance.

Farouk,
BEFORE moving the pointer off the new record, check with indexseek().

If you already moved off the record (I mean you went to another row then came back) :

lnKey = myKey
lnRecno = recno()
locate for myKey = lnKey and recno() # lnRecno
llExists = !eof()

PS: SQL select wouldn't work for buffered recs.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform