Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index violation error
Message
From
18/12/2008 11:39:10
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01367400
Message ID:
01368563
Views:
8
>>i use a Candidate index, the error seems to be related to my record command class.which contains the add and edit commands. What I do not understand is why the save command gets and error if I find a record using a valid method and the drop down which uses an interactive change method.
>
>Claude,
>
>I don't understand (too tired today, had ~4 hours sleep and this is not enough for me), so please explain with some code.

If I use a "Candidate" index the code
		IF !EMPTY(m.cErrorMessage)
			=MESSAGEBOX(E_FAIL_LOC+m.cErrorMessage)
		ENDIF
produces the error message "Table not updated: relpos. Unique index violation:". if I change to a "Regular" index I may get more than 1 record for the key field "crelpono" with the code
	UPDATE relpos SET 	dpodate		= Thisform.txtPoDate.Value 		, ;
						drecieved	= Thisform.txtDateRecieved.Value	, ;
						dreleased	= Thisform.txtDateReleased.Value	, ; 
						corderedby	= Thisform.txtOrderedBy.Value		, ;	
						ccomment	= Thisform.txtComment.Value 		. ; 
						cvname		= ThisForm.txtvendName.Value	   ;			
			       WHERE crelpono	        = Thisform.txtFindRelPoNo.Value 

	ThisForm.txtPoNo.Value = Thisform.txtFindRelPoNo.Value 
	ThisForm.txtFindRelPoNo.SetFocus()
	ThisForm.lblstatus.Caption	= 'Viewing Data'
What I do not understand is why the "Save" command gives the error message when I find the value via a "Vaid" method which has extra validation code and an "Interactive Change" method which has only valid values in the drop down. If I change to a "Regular" index I may get multiple records. What I need to know is either how to avoid the error message for a "Candidate" index or multiple records for a "Regular" index.

If I try adding the code that is in the "Interactive Change" method to the "Valid" method I get the error message that "Setfocus" is not allowed in a valid method. I seem to be stuck.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform