Microsoft Knowledge Base Email Alertz

(282390) - When you attempt to upsize your database, you may receive an error message similar to the following: Server Error 134: The variable name '@Forms......' has already been declared. Variable names must be unique within a query batch or stored procedure....

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 282390 - Last Review: May 30, 2006 - Revision: 4.2

ACC2002: "Server Error 134" Error Message When You Attempt to Upsize Your Database

This article was previously published under Q282390
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986  (http://kbalertz.com/Feedback.aspx?kbNumber=256986/EN-US/ ) Description of the Microsoft Windows Registry
Moderate: Requires basic macro, coding, and interoperability skills.

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

On This Page

SYMPTOMS

When you attempt to upsize your database, you may receive an error message similar to the following:
Server Error 134: The variable name '@Forms......' has already been declared. Variable names must be unique within a query batch or stored procedure.

Server Error 170: Line 7: Incorrect syntax near ')'.

CAUSE

This behavior can occur if queries in your database contain parameters that match through the first 30 characters. For example, the following query produces the error message:
   PARAMETERS [123456789012345678901234567890start] DateTime,    [123456789012345678901234567890end] DateTime;
   SELECT item, date
   FROM Table1
   WHERE date Between [123456789012345678901234567890start] And    [123456789012345678901234567890end];
				
Note that this query contains two parameters that match each other through the first 30 characters:
  • [123456789012345678901234567890start] DateTime
  • [123456789012345678901234567890end] DateTime

RESOLUTION

To resolve this issue, change the parameter names in such a way that they differ within the first 30 characters. For example, if your query contains the following two parameters
  • [123456789012345678901234567890start] DateTime
  • [123456789012345678901234567890end] DateTime
you can change the parameters to the following:
  • [start123456789012345678901234567890] DateTime
  • [end123456789012345678901234567890] DateTime
Note that the Upsizing Wizard accepts only the first 30 characters, so the resulting SQL query contains the following parameters:
  • (@start1234567890123456789012345) DateTime
  • (@end123456789012345678901234567) DateTime

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Steps to Reproduce the Problem

  1. Start the Registry Editor (Regedit.exe).
  2. Open the following registry key:
    HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Access\Wizards\Preferences\Upsizer\Quiet
  3. Set the value of this key to No, and then close the Registry Editor.
  4. Start Microsoft Access, and then create a new database, Db1.mdb.
  5. Create a new table in Db1.mdb:
       Table: Table1
       ----------------------
       Field Name: ID
       Data Type:  Text
       PrimaryKey: Yes
    
       Field Name: Date
       Data Type:  Date/Time
    
       Field Name: Item
       Data Type:  Text
    					
  6. In the Database window, click Queries, and then double-click Create a new query in design view.
  7. Click Close, and then click SQL on the Query Design toolbar.
  8. In the SQL Editor, enter the following query:
       PARAMETERS [123456789012345678901234567890start] DateTime,    [123456789012345678901234567890end] DateTime;
       SELECT item, date
       FROM Table1
       WHERE date Between [123456789012345678901234567890start] And    [123456789012345678901234567890end];
    					
  9. Save the query as qryLongParameters, and then close the SQL Editor.
  10. On the Tools menu, point to Database Utilities, and then click Upsizing Wizard.
  11. Upsize your database to SQL Server.

    You receive an error message similar to the one listed in the "Symptoms" section of this article.

REFERENCES

For more information about upsizing your database, click Microsoft Access Help on the Help menu, type upsize in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.


APPLIES TO
  • Microsoft Access 2002 Standard Edition
Keywords: 
kbbug kbnofix KB282390
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate