Why 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?

36 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 May 2021
Edited: MathWorks Support Team on 19 May 2021
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'

More Answers (0)

Products


Release

R2009a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!