Tuesday, May 3, 2011

VFP memo field - MySQL longtext field

Finally I found the solution for this problem.
Make Sure that the field at MySQL is more than 255 characters(longtext field)
see sample script below:
lcDSNLess="DRIVER={MySQL ODBC 5.1 Driver};UID=root;PWD=sa;Database=bill;Server=localhost;DRIVER ={MySQL ODBC 5.1 Driver};PORT=3306;NO_PROMPT=1;OPTION=134217728;"
gnConnHandle = SQLSTRINGCONNECT(lcDSNLess,.T.)
SQLEXEC(gnConnHandle,"SELECT * from mytable",'SQLResult')
SELE SQLResult
BROWSE

note: at connection string OPTION must have a value of 134217728