Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IndexSeek ... Trap ?
Message
De
26/03/2002 11:33:32
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
26/03/2002 08:22:03
Emanuele Bonin
EB Soluzioni Informatiche
Tezze S/B, Italie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00637120
Message ID:
00637315
Vues:
16
>>It's known and intended behaviour, no bug. It's primary usage is to check for existence of key during a new record insertion. If it returned .t. for your newly inserted record then you'd be doing old workarounds to check. Once you move off the record indexseek would return .t. for the newly inserted record regardless of it was row or table buffered.
>
>
>I think that isn't a good behavior ... if i want to introduce a code that must be unique and i want to be proactive, i test the existance of code -'CODE1'- before inserting record, now i introduce a second code (without moving record pointer) -'CODE1'- that is the same of the first one (caused by my amnesia 8-)), i test the existance of code, indexseek return .f. ... so i insert the record ..... my primary key emit an error ..... isn't true?

Emanuele,
It might be considered as a bug just for it returns .T. even if the table buffer was used. Other than that it's true.
What you want to do is impossible doing a seek, indexseek, keymatch or whatever when buffered tables + multiuser is in question. You should do it via another procedure like GetNextId in solution.app using intermediate tables or other means like GUID generation.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform