> 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!