Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record Number/ SEEK() / Edit Mode
Message
 
 
To
13/09/2002 14:04:33
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00700262
Message ID:
00701237
Views:
16
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
Previous
Reply
Map
View

Click here to load this message in the networking platform