Set MySQL in VFP from internet VFP version 8

Asked By 0 points N/A Posted on -
qa-featured

 

Hi, I deliberated if anyone could help, I have a MySQL database that is hosted on a UNIX server on the internet I wanted to connect to it with Visual FoxPro Vr 8 from a Windows PC. Is this probable, How do I set mysql in VFP to do this ?

SHARE
Answered By 0 points N/A #171840

Set MySQL in VFP from internet VFP version 8

qa-featured

Hi Altha Tuller,

It is possible to connect VFP with MySQL database in Windows. In order to do that, you should install MySQL ODBC.
 
And make sure that your UNIX system is reachable from the Windows System.
 
You can download MySQL ODBC driver from here. The latest version is 5.2.3.
 
Below is a sample code for setting up MySQL connection using VFP.
 
lcServer="IP address of the server where mysql is installed"
lcDatabase="Your MySQL database name"
lcUser = "Username"
lcPassword = "Password"
lcStringConn="Driver={MySQL ODBC 5.2.3 Driver}"+; //If you are using 'MySQL ODBC 5.2.3 Driver'
             ";Server="+lcServer+;
             ";Database="+lcDatabase+;
             ";Uid="+lcUser+;
             ";Pwd="+lcPassWord
lnHandle=SQLSTRINGCONNECT(lcStringConn)
 
Hope it helps.

Related Questions