ACC2000: "Too Few parameters. Expected X" Error Message When You Export Parameter Query as Text (269671)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q269671
Novice: Requires knowledge of the user interface on single-user computers.

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

SYMPTOMS

When you export a parameter query as a text file, you may receive the following error message, where X is the number of parameters in the query:
Too few parameters. Expected X.

RESOLUTION

To work around this behavior, create a SQL statement similar to the SQL statement that is created in the following example:
  1. Open the sample database Northwind.mdb.
  2. In the Database window, click the Employees table, and on the Insert menu, click Query.
  3. In the New Query dialog box, click OK.
  4. On the View menu, click SQL View.
  5. Type or paste the following SQL statement:

    SELECT * INTO [Text;FMT=Delimted;HDR=Yes;DATABASE=C:\;].[Employees#txt] FROM Employees WHERE [EmployeeID] = [Enter an EmployeeID];

  6. Save the query as Query1.
  7. On the Query menu, click Run. Type a valid EmployeeID, and then click Yes in the dialog box that asks if you want to create a new table.

    Note that a text file named "Employees.txt" is created on drive C, and that it contains only the data for the EmployeeID that you entered in the parameter box.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open the sample database, Northwind.mdb.
  2. In the Database window, click the Employees table, and then on the Insert menu, click Query.
  3. In the New Query dialog box, click OK.
  4. Double-click EmployeeID, LastName, and Title in the field list to add the fields to the query design grid.
  5. In the Criteria row of the query design grid, under EmployeeID, type the following criteria:

    [Enter an Employee ID]

  6. Save the query as Query1.
  7. On the Query menu, click Run. Type a valid EmployeeID, and note that one record is returned.
  8. On the File menu, click Export.
  9. In the Files of type list, click Text Files, and then click Save All. Note that you receive the error message mentioned in the "Symptoms" section of this article.

Modification Type:MajorLast Reviewed:6/25/2004
Keywords:kberrmsg kbprb KB269671