Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TABLEUPDATE() Fails
Message
 
To
20/09/2016 20:41:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01641157
Message ID:
01641161
Views:
65
>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

As Tore said you try to insert record with the same PK.
If you only UPDATE record then you should check what VFP sends back to MySQL.
In MS SQL Server there is a tool named SQL Server Profiler, but I have no idea how it is called in MySQL :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform