You can also use wwSql to do the same thing which is a little bit easier than raw SQL Passthrough (it still uses SQL Passthrough) but caches the connection ID and provides you an object rather than a connection handle.
cMyIPServeur="xxx.xxx.xxx.xxx" && the IP adress for the MYSQL server to use cMyDatabase="MyDataSQL" && the name of the MYSQL database to connect cMyUser="luca" && the login of the user to connect the cMyDatabase cMyPassWord="xxxxxx" && the password of the user to connect the cMyDatabase cMYConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" "SERVER="+m.cMyIpServer+";" "DATABASE="+m.cMyDatabase+";" "USER="+m.cMyUser+";" "PASSWORD="+"m.cMyPassword";" "OPTION=3;" SET CLASSLIB to wwSQL Additive loSql = CREATEOBJECT("wwSql") loSql.Connect(cMyConnectionString) lcCompany = "West Wind" lnCount = loSql.Execute("select * from customers where company=?lcCompany") lcCompany = "East Wind" ldUpdate = DateTime() lnCount = loSql.ExecuteNonQuery("insert into Customers (company,updated) values (lcCompany,ldUpdated))
One nice thing is that wwSQL provides error handling and manages the connection for you. It's optimized for SQL Server but works with any ODBC connection including MySql.
+++ Rick ---
from Maui, Hawaii