How do I convert a Foxpro 2.6 database into MySQL ?

How do I convert a Foxpro 2.6 database into MySQL ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

download the mysql odbc diver and create an dsn

create a link table in access for the the foxpro database then right click select export choose the odbc database and select your dsn Thats it you are done!
can you please close 2 other questions? write to the community support to close them.
if you want to convert foxpro programtically generate the sql statements and fire them
masimiqbal:you can download mysql odbc driver from mysql's site
* Heres a program I wrote to do just that.
* 1. Copy this text to foxtosql.prg
* 2. In foxpro run: Do foxtosql "database.dbf", "outfile.sql"
* 3. Now Run: mysql -uuser -ppass database<outfile.sql
* Note:  You must first create the database in mysql this program does not
* produce the table structure.  You could easily tweak it to produce the table
* structure, but I prefer to build the table the way I want it in mysql instead
* having the program guess at data types and such.

Private xi
Private xCOLARRY


If !USED(pDbf)
      SELECT 0
      Use &pDBF



      \INSERT INTO todo VALUES ('

      For xi = 1 to int(alen(xCOLARRY)/4)
            Do Case
                  Case Inlist(xCOLARRY(xi,2),"C","M")      
                        xStr = &xCOLARRY(xi,1)
                        xStr = ""
                  Case Inlist(xCOLARRY(xi,2),"F","N")
                        xNum = &xCOLARRY(xi,1)
                        xNum = 0
                  Case xCOLARRY(xi,2) = "D"
                        xDate = &xColArry(xi,1)
                        xDate = {}
            If !(xi=int(alen(xCOLARRY)/4))      




close all

Function _FmtDate
Parameters pDate

Private xDate
Private xMon
Private xYear
Private xDay

If Empty(pDate)
      Return( "0000-00-00" )

pDate = dtos(pDate)
xYear = Left(pDate,4)
xMon = Substr(pDate,5,2)
xDay = Right(pDate,2)

xDate = xYear + "-" + xMon + "-" + xDay
Return( xDate )

Function _SpecChars
      Parameters xTodo

      xTodo = Strtran(xTodo,"\","\\")
      xTodo = Strtran(xTodo,chr(13),"\r")
      xTodo = Strtran(xTodo,chr(10),"\n")
      xTodo = Strtran(xTodo,chr(09),"    ")
      xTodo = Strtran(xTodo,'"','\"')
      xTodo = Strtran(xTodo,"'","\'")


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LOL, I just realize the _SpecChars function uses xTodo as a parameter, I built this program to convert a "TODO" database from foxpro to MySQL
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.