Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Access Data Produces "Too Few Parameters" Error in Microsoft Query


View products that this article applies to.

This article was previously published under Q207143
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).

↑ Back to the top


Symptoms

When you create a query in Microsoft Query based on a Microsoft Access parameter query, you may receive the following error message:
Too few parameters. Expected n.
If you click Help in the error message box, the topic states,
Driver error.
This error was returned by the driver. For more information, check the documentation for the driver you are currently using.

↑ Back to the top


Cause

This behavior is a limitation of the Microsoft Access ODBC driver. Prompting for query parameters is a functionality of the Microsoft Access user interface. However, the Microsoft Access ODBC driver doesn't have this capability; therefore, it generates an error message.

↑ Back to the top


Resolution

In Microsoft Access, create a make-table query based on the parameter query; run the make-table query, and then use the resulting table in Microsoft Query.

If you are using Microsoft Query to make the results of a Microsoft Access parameter query available to Microsoft Excel, you may want to consider exporting the parameter query to an Excel file from within Access.

↑ Back to the top


More information

Steps to Reproduce Behavior

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

  1. Start Microsoft Access and open the sample database Northwind.mdb.
  2. Open the Current Product List query in Design view.
  3. In the Criteria row of the ProductName field, type the following:
    [Enter a Product Name]
  4. Save and close the query. Quit Microsoft Access.
  5. Start Microsoft Query.
  6. On the File menu, click New.
  7. In the Choose Data Source dialog box, click MS Access Database, and then click OK.
  8. In the Select Database dialog box, locate the sample database Northwind.mdb, select it, and then click OK.
  9. In the Query Wizard - Choose Columns dialog box, select Current Product List, and then click > (right arrow) to select ProductID and ProductName as columns in your query.
  10. Click Next twice, and then click Finish. Notice that you receive the following error message:
    Too few parameters. Expected 1.

↑ Back to the top


References

For more information about parameter queries, click Microsoft Access Help on the Help menu, type what is a parameter query and when would you use one? in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For more information about make-table queries, click Microsoft Access Help on the Help menu, type create a new table from the results of a query with a make-table query in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For more information about exporting data from Microsoft Access toMicrosoft Excel, click Microsoft Access Help on the Help menu, type load the output of a datasheet, form, or report into microsoft excel in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB207143, kbprb, kbinterop, kberrmsg

↑ Back to the top

Article Info
Article ID : 207143
Revision : 2
Created on : 6/24/2004
Published on : 6/24/2004
Exists online : False
Views : 489