mysqldatabase-connectionconnection-stringvisual-foxpro

how to keep MySQL connection alive from Visual Fox Pro


I have a Visual Fox Pro app which connects with MySQL database via ODBC. Everything is working fine until users stop to work (some minutes) in the forms (but forms are open in the fox pro app) and when they return to work the fox pro app show errors about cursors that were created from MySQL tables, so I guess is a timeout disconnection between the fox pro app and the MySQL server.

Please help me how can keep the connection alive from fox pro? Do you think Do I ping the MySQL all the time (for example each second? or do I set the MySQL timeout with a new value? I need to fix this but without losing performance.


Solution

  • Use SQLSetProp to set the IdleTimeout property for the connection. 0 means indefinite.

    Tamar