Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updatable cursors with MySQL
Message
 
 
To
06/02/2004 11:23:55
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00874859
Message ID:
00875284
Views:
29
You've to check return value of TABLEUPDATE() to make sure that that it was executed w/o error. If it returns .F, use the AERROR( ) function to get error info.

>I have a back-end database running on MySQL. I am trying to update a Form in Foxpro 7.0 (SP1) to use an updatable cursor. Everytime I think I've updated a record though, I get an error saying the table has uncommitted chages.
>
>Keeping things simple, I made a new table in my database, named TransactionTest. It contains 4 fields:
>
> ID INT (Primary Key)
> Field1 varchar(100)
> Field2 varchar(100)
>
>I then created a new form with 3 textbox controls bound to the three database fields. In the form's Load event I've placed this code:
>
>
>SQLEXEC( Handle, "select * from transactiontest", "TranTest" )
>CURSORSETPROP("Tables", "TranTest" )
>CURSORSETPROP("UpdateNameList", "Field1 TranTest.Field1, Field2 TranTest.Field2" )
>CURSORSETPROP("KeyFieldList", "ID" )
>CURSORSETPROP("UpdatableFieldList", "Field1, Field2" )
>CURSORSETPROP("SendUpdates", .T. )
>SELECT TranTest
>thisform.Refresh
>
>That works fine; the form loads and displays the first record. I also have a command button that executes the following when clicked:
>
>TABLEUPDATE( 0, .T., "TranTest" )
>
>If I change one of the two editable fiels on the form and click the button, all appears well. However, if I close the form and try rerunning it I get an error stating
>
>Table buffer for alias "TRANTEST" contains uncommitted changes."
>
>I don't understand why these changes are not making it back to the MySQL database, despite the TableUpdate command. Are updatable cursors incompatible with SQL servers such as MySQL?
>
>Any help would be greatly appreciated. Thanks.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform