Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: surinder singh
  Where is surinder singh?
 Pune/New Delhi/Kangra
 India
 surinder singh
 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: 181439 # Views: 47 # Ratings: 0
Version: Visual FoxPro 9 Category: ODBC, ADO and OLEDB
Date: Thursday, July 03, 2008 9:58:54 AM         
   


> Hi there, can anyone teach me how to connect VFP9 to MySQL whithin a network? Should i download something? Thanks...
you can connect by using SQLSTRINGCONNECT() function

This example is using ODBC driver for MySQL
for more details check:

http://fox.wikis.com/wc.dll?Wiki~VFPCommandSQLStringConnect~VFP

lcServer="localhost"
lcDatabase="test"
lcUser = "root"
lcPassword = "root"
lcStringConn="Driver={MySQL ODBC 3.51 Driver};Port=3306"+;
             ";Server="+lcServer+;
             ";Database="+lcDatabase+;
             ";Uid="+lcUser+;
             ";Pwd="+lcPassWord
*** Don't prompt for login
SQLSETPROP(0,"DispLogin",3)
lnHandle=SQLSTRINGCONNECT(lcStringConn)
IF lnHandle  > 0
   ? SQLTABLES(lnHandle,"TABLES")
   browse last nocaptions
   SQLDISCONNECT(lnHandle)
ELSE
   =AERROR(laError)
   MESSAGEBOX("Error at Connecting"+CHR(13)+;
              "Description:"+laError[2])
ENDIF



-----------------------------------------------------------------------------------------------
Regards
Surinder Singh
Email: sur200@indiatimes.com
Check my blog for details: http://weblogs.foxite.com/sur200
----------------------------------------------------------------------------------------
*If you understand what you're doing, then you're not learning anything.



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