Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for Candidate Key
Message
From
28/10/2003 05:20:44
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/10/2003 05:09:28
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00843412
Message ID:
00843417
Views:
32
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform