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
Thanks for the option string value this was a lifesaver for me! I have been struggling to retrieve a LongText as a memo in a VFP cursor - works fine on a local Mysql server, but would not work on a Remote MySql server, the option string fixed it.
ReplyDelete