Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Eli Pod
  Where is Eli Pod?
 Bihac
 Bosnia and Herzegovina
 Eli Pod
 To: Jorrel Detaunan
  Where is Jorrel Detaunan?
 Las Piñas
 Philippines
 Jorrel Detaunan
 Tags
Subject: RE: MySQL Connection Client Only
Thread ID: 181432 Message ID: 182323 # Views: 31 # Ratings: 0
Version: Visual FoxPro 9 Category: ODBC, ADO and OLEDB
Date: Tuesday, July 08, 2008 4:12:43 PM         
   


> Hi there, can anyone teach me how to connect VFP9 to MySQL whithin a network? Should i download something? Thanks...

Hi dude,
In order to connect from VFP to MySQL you need software-mediator, called ODBC-driver. It's possible to get on Internet, like MySQL ODBC 3.51 and sub-version,and some example of code is here:

*make connection string (all in one row):
connStr = [DRIVER={MySQL ODBC 3.51 Driver};SERVER=10.0.0.1;DATABASE=your_base;UID=user_name;PWD=user_password;OPTION=1]
*handler parameter:
h = SQLSTRINGCONNECT(connStr)
kveri1="select * from addresse where a_name = 'Elvir'"
************
*execute query:
rez=SQLEXEC(h, kveri1, "kurzor1")
* check result of execution:
IF rez>0 then
SELECT kurzor1
BROWSE
ELSE
? kveri1
WAIT WINDOW STR(rez)+"No such records" nowait
endif
*break connection with MySQL
SQLDisconnect(h)
.............................................
Its' smart to be good, it's good to be smart!



COMPLETE THREAD
MySQL Connection Client Only Posted by Jorrel Detaunan @ 7/3/2008 9:14:19 AM
RE: MySQL Connection Client Only Posted by surinder singh @ 7/3/2008 9:58:54 AM
RE: MySQL Connection Client Only Posted by Eli Pod @ 7/8/2008 4:12:43 PM