Mike, I started this thread as a follow on from my previous thread [link ]
[/url] where I mentioned that I am in the process of rebuilding my "Logbook" application from scratch and taking the opportunity to improve the efficiency / look of my code based on experience gained (albeit little) since I wrote the original application.
During the initialisation of my application I copy the entire contents of the MySQL "Logbook" Database into a VFP CURSOR which is then displayed in a Grid. When I add or modify an entry in the "Logbook" it is sent direct to the MySQL Database and at the same time I ZAP the Logbook CURSOR and reload the contents of the MySQL Database back into it, so that it remains in-sync.
Now that I am re-writing my application, I thought it would probably be more efficient to update the MySQL Database and then update CURSOR using the REPLACE Command instead of having to reload the entire MySQL Database back into the CURSOR.
In the previous thread, Chris Millar mentioned using the Cursor to update the MySQL Data which was the reason for starting this thread.
The code I posted above was just a quick test to try to update a single field of a single record identified by a unique Primary_Key. Once I got that to work I would have then inserted into my application and expanded it to cover all 123 fields.
I naievly thought that the code I produced was nearly sufficient to synchronise the Cursor with the MySQL Database; your sample code shows that I am very wide of the mark. I didn't realise that I would need multiple CURSORSETPROP which shows I've not grasped the principle of using CURSORSETPROP and TABLEUPDATE.
At this moment in time I feel I can't see the wood for the trees and don't know if I should progress with using using CURSORSETPROP and TABLEUPDATE or stick with my original code (Zapping the Cursor and re-loading the revised data) or stick with my revised code of just updating the record in the MySQL Database and Cursor, both of which work ok.
Chris, I have been dabbling with DBMS (GWBASIC, dBaseIII+, dBaseIV, FoxPro, VFP) for over 40 Years BUT only as an "Hobbyist" so when you say "it's not Rocket Science", it may not be to you, but at times like this it feels that way with me. I have been retired for a few years now having spent most of my working life as a Service Engineer in Induction Heating (Melting Furnaces etc) so I guess using SCR's and IGBT's will probably be a black art to you?
I use VFP to assist me with my Hobbies of "British Railways" and "Amateur Radio" and I'm am very proud of what I have achieved with VFP (albeit that I probably only use less than 20% of VFP Capabilities). I even control my Transceiver with my VFP Logbook application.
I owe deep gratitude in particular to the likes of Mike Lewis, Olaf Doschke and ATLOPES of this parish, plus of coarse, I appreciate the help of you and other members of this forum.
I followed your advice from the other thread and printed numerous pages from the VFP Help File, but I've always struggled to "learn by reading" and much prefer to "learn by examples" and that's what I did with the code I posted above.
Regards,
David.
Recreational Developer / End User of VFP.