Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TABLEUPDATE() Fails
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01641157
Message ID:
01641159
Views:
59
>>Hi all:
>>
>>I have a system which was written in Visual Maxframe (about which I know virtually nothing). One of the methods calls FetchData and populates a cursor. This cursor has Table Buffering (5).
>>The backend is MySql.
>>
>>When we move off a particular record a TABLEUPDATE(.T.,.T.) is issued (straight from VFP and not through a Maxframe call) against this cursor. As best I can tell, nothing has changed. The record count is the same, there are no deleted records.
>>
>>
>>ab = TABLEUPDATE(.T.,.T.)
>>IF NOT ab
>>     =AERROR(abcde)
>>     ?abcde[2]--->  "Connectivity error: CCMD"
>>ENDIF
>>
>>We then run a Maxframe SAVEACTION method and it generates the following
>>Connectivity error: [MySQL][ODBC 3.51 Driver][mysqld-5.6.21-log]Duplicate entry '7375102' for key 'PRIMARY'
>>
>>I checked the cursor when it was created and the key was there.
>>I tried the following
>>=AFIELDS(aflds)
>>FOR ifld = 1 TO ALEN(aflds,1)
>>MESSAGEBOX(GETFLDSTATE(ifld))
>>endfor
>>
>>and got a "1" (not been modified) for each field
>>
>>
>>This is from a system which has been running successfully since 2012. The last update for the EXE was back in February. The data issues have suddenly started appearing and I don't think that we have a situation where it was happening before and nobody was reporting it.
>>
>>I'm pround that my hair is still mostly not grey and want to keep it that way. All help appreciated.
>>
>>........Rich
>
>Seems like you have some data problem where two records have the same key value '7375102', and which should have had different values.

If the record is being appended - then that would be the problem. If you're trying to update an existing record - then you don't want to update the primary key field when you do the tableupdate - just all the other fields.
ICQ 10556 (ya), 254117
Previous
Reply
Map
View

Click here to load this message in the networking platform