MATLAB: Do I get the error “Invalid string or buffer length” when using an ODBC driver with the Database Toolbox on Windows 64-bit

64bitdatabaseDatabase Toolboxjdbcodbcserversql

I am attempting to retrieve data from my database over an ODBC connection using Database Toolbox. When using the Query Builder or command line functions, I receive the following error:
[Microsoft][ODBC Driver Manager] Invalid string or buffer length Please verify that login information and database url are valid.

Best Answer

If you receive this message you may be using the wrong driver. For nearly all databases, you must use JDBC drivers with 64-bit machines.
This information can be found in the documentation: