|
-
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, 05:01 AM
-
By Confused in forum VB Classic
Replies: 3
Last Post: 12-07-2001, 03: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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks