-
Foxpro, MySQL and ODBC
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
Similar Threads
-
By airrazor in forum Database
Replies: 6
Last Post: 10-04-2005, 04:00 PM
-
By felix in forum ASP.NET
Replies: 2
Last Post: 04-05-2002, 06:01 AM
-
By Confused in forum VB Classic
Replies: 3
Last Post: 12-07-2001, 04:38 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|