Hi there,

I am trying to read in values from a local Foxpro database and export them to an online MySQL database using ODBC through Foxpro.

I set up the connection properly, and am able to update single values on the site, however, when I try to go through and update all values one by one the process is inordinately slow as one can imagine. Is there anything I can do to spruce up this code? I'm still relatively new to ODBC.

Here is the code I am trying to improve:

CLOSE ALL
STORE SQLCONNECT('mydatabase', 'myusername', 'mypassword') TO gnConnHandle
IF gnConnHandle <= 0
= MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
ELSE
= MESSAGEBOX('Connection made', 48, 'SQL Connect Message')
ENDIF

SQLTABLES(gnConnHandle)

&& this is the local table which I am reading values from
USE C:\ITMMASTF.DBF SHARED

FOR j = 1 TO RECCOUNT()
GOTO j

&& storing the local database values for the indiviudal server updates
STORE TRIM(itmmastf.p_code) TO pcode
STORE itmmastf.zf_price TO listprice
STORE itmmastf.p_sellp TO sellprice
STORE itmmastf.p_avcost TO cost

&& doing the update
SQLExec(gnConnHandle, "update products set products_price = ?listprice where products_model like ?pcode" )
ENDFOR

Thanks!

Regards,
Thomas B