Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking some field for uniqueness
Message
From
12/06/2001 16:14:19
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00518556
Message ID:
00518585
Views:
7
>>Hi Nadya,
>>If you didn't want to use a candidate index and trap the errors you could try adding the following:
>>
>>SELECT FunName ;
>>	FROM AllFunctions ;
>>	GROUP BY FunName ;
>>	HAVING COUNT(FunName)>1 ;
>>	ORDER BY FunName ;
>>	INTO CURSOR csrDups
>>	nDups = IIF(_Tally > 0, .T., .F.)
>>	USE IN csrDups
>>IF nDups = .T.
>>	=MESSAGEBOX("Cannot save, the Function Name is already used",0,"")
>>	nDups = .F.
>>	RETURN .F.
>>ENDIF
>>
>>
>We have a class, which uses this method, but it does not work for buffered tables, since SQL works with table directly.


Ahhh... that's why I resorted to using cursors for this form...


VFP6 SP5, VFP8 SP1, VFP 9 SP 1 and Win XP SP 3 (unless otherwise specified)


www.wulfsden.com
Previous
Reply
Map
View

Click here to load this message in the networking platform