When using Visual Basic to connect to a MySQL database using ODBC v2.50.37, I receive the error 'Invalid string or buffer length' when trying to write to any BLOB or CHAR field. Any Ideas?
I've also encountered the same problem using vbscript in an ASP application. Any update to the database via ADO, regardless of field type (eg. integer, string, etc.), fails.
I would be interested to know if anyone has managed to get MySQL working with ADO.
You would not beleive it, I have actually managed to get it working!
I have written a client app in VB to update a MySQL database on the web using ADO, I had to use two connections, one to upload, one to download, due to some very iffy ODBC settings.
If you want the code, let me know.
I'd love to know why there is so little information on the ODBC/ADO stuff. Are windows programmers a dying breed?
The problem lies with the way in which the ODBC driver handles strings, if you try to write a string to a field which is longer than any of the strings already in the field, you get the 'Invlaid buffer....' message. Just set the 'Don't optimize column width' option on the driver.
Evan after doing this, I still had to use two connection objects, one for upload and one for download. The download connection did not have the 'optimize column width' option set, as it seemed to corrupt the data.
Hope this helps, if you still can't master it then let me know, and I'll post the code.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.