ACC97: "Too few parameters. Expected 1" Error Message When You Export Parameter Query as Text (262837)



The information in this article applies to:

  • Microsoft Access 97

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

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 issue, create a SQL statement similar to the SQL statement created in the following steps:
  1. Open the sample database Northwind.mdb.
  2. In the Database window, click the Employees table, click Insert, and then click Query.
  3. In the New Query dialog box, click OK.
  4. On the View menu, click SQL View.
  5. Type 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. Note that a text file named "Employees.txt" was 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, click Insert, and then click Query.
  3. In the New Query dialog box, click OK.
  4. Double-click EmployeeID in the field list to add it 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 this 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 Save As/Export. Click To an External File or Database, and then click OK.
  9. In the Files of type list, click Text Files, and then click Export. Note that you receive the error message mentioned in the "Symptoms" section of this article.

Modification Type:MajorLast Reviewed:9/27/2003
Keywords:kberrmsg kbprb KB262837