MATLAB: Do I receive an error regarding “Too Few Parameters” when using the Database Toolbox 3.5.1 (R2009a) to work with an MS Access database

accessDatabase Toolboxfewmicrosoftodbcparameterstoo

I have setup an ODBC data source to connect to an MS Access database. I run the following commands to update a certain row in the database table:
 
conn=database('mydbsource','user','user');
str = 'update my_table set colA=0.501 where ID=2';
curs = exec(conn,str);
curs = fetch(curs);
However, this code produces the following error message: ERROR: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

Best Answer

This error message is returned by the ODBC driver for the MS Access database. It indicates that the column you are trying to access in the table does not exist. Additional information regarding this error message may be found at the following location:
You may also receive this error message when using double quotes instead of single quotes in a WHERE clause. For example:
Incorrect SQL statement:
SELECT * FROM myTable WHERE myField="Hello World"
Correct SQL statement:
SELECT * FROM myTable WHERE myField='Hello World'