MATLAB: Do I get an error “Too few Parameters. Expected 2” when I run a query in the Database Toolbox 3.5.1 (R2009a)

characterscolumndatabaseDatabase Toolboxerrorfewparametersqueryselectspecialtoo

When I execute the following query
SELECT ALL column-name FROM tablename
I obtain the following error:
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
However, I am able to run the same query on other columns of the same table in the database.

Best Answer

This error is obtained because the column names being selected have special characters. If there are special characters in the column names of the database, the name should be surrounded with brackets in the SQL query. The query should be executed as shown below:
SELECT ALL [column-name] FROM tablename