Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seek() cause 1884 error
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01443714
Message ID:
01443817
Views:
43
>The seek() found the value then displayed the error. The value is an 11 digit string.
>
>>Could it be that the table already had bad value? Try packing the table in question.
>>
>>>>>>>Does anyone know why a seek(value,table,index) would cause a "uniqueness of index" error.
>>>>>>>The index is the PK. Table is buffered. I thought the uniqueness error was only if it was being updated.
>>>>>>>Isn't the seek just a optimized lookup? The table's PK has a related table.
>>>>>>
>>>>>>Is the table record-level buffered? If yes, then seek will cause a record movement and if you added a new record, it will try to commit it.
>>>>>>
>>>>>>Try using INDEXSEEK instead or use table-buffering (buffering = 5)
>>>>>
>>>>>I do use table-buffering = 5 and I want the pointer to move so I can capture other data related to the found record.
>>>>
>>>>I think you may want to post some relevant code then.
>>>
>>>Here is the code:
>>>
>>>WITH This.Parent
>>>IF ! SEEK(This.Value,'contacts','corgcode')
>>>       MESSAGEBOX('NO CONTACT FOR THIS ORG CODE EXIST'+CHR(13);
>>>	+'PLEASE ENTER NEW INFORMATION';
>>>	,64,'UPDATE CONTACT')
>>>       llFocus=.F.	
>>>ELSE
>>>       .txtAddress.Value = ALLTRIM(contacts.cAddress)
>>>       .txtCity.Value = ALLTRIM(contacts.cCity)
>>>       .txtState.Value = ALLTRIM(contacts.cState)
>>>       .txtZip.Value = ALLTRIM(contacts.cZip)
>>>       .txtMailSt.Value = ALLTRIM(contacts.cMailSt)
>>>       .txtContact.Value = ALLTRIM(contacts.cContact)
>>>       .txtPhone_num.Value = ALLTRIM(contacts.cCont_phone)
>>>ENDIF	&& seek
>>>ENDWITH
>>>
Maybe a .CDX file is corrupt. You could try REINDEX, or (preferably) rebuild the tags from scratch (or overwrite a CDX with a known good but out-of-date one, then REINDEX).

You could check your data for duplicates in the PK field and/or unexpected blanks. Just DELETEing any such records is not enough to get rid of this error, as Naomi points out you need to PACK to permanently get rid of them, or change the PK value to something unique (e.g. "ZZZZZZZZZZZ")

You mentioned a related table - as in, you have a SET RELATION active? Then you could look into any or all of the above for the related table, too.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform