Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How do I rectify the following DB Tester Error "(07002) [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2"?

How do I rectify the following DB Tester Error "(07002) [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2"?

When using the DB_ExecuteSql (),

">hstmnt=DB_ExecuteSql(hdbc, "SELECT FirstName, LastName FROM MailingList, Organizeation WHERE Organization.OrganizationID=MailList.OrganizationID" )

The following error is thrown:

">[-] Testcase DB_try - 1 error [ ] *** Error: (07002) [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2. [ ] Occurred in DB_ExecuteSql [ ] Called from DB_try at database_try.t(15)

The first thing to check is that you actually are passing in the correct amount of parameters and that you are choosing the right names for your tables, columns etc....

This error is generally thrown due to typing or spelling errors. You can usually tell how many mistakes there are due to the number at the end of the error message. In the above case, there were two spelling mistakes. Because it wasn"t recognizing 2 of the parameters it throws back the error that it was getting 2 less parameters than it was expecting.

In the above example, the two errors where:
One instance of Organizeation was spelled incorrectly, should have been Organization.
One instance of the table MailingList was incorrectly referred to as MailList.

Old KB# 22178

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:28
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.