ACC2000: "ADO Error: Line 1 : Incorrect Syntax Near '-'." Error Message When You Save a View (264961)



The information in this article applies to:

  • Microsoft Access 2000

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

This article applies only to a Microsoft Access project (.adp).

SYMPTOMS

In an Access project, when you create view and then try to save it, you may receive the following error message:
ADO error: Line 1 : Incorrect syntax near '-'.

CAUSE

Your logon name contains a hyphen, for example Day-Mgr.

RESOLUTION

Remove the hyphen from the logon name.

STATUS

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

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new project to the Microsoft Data Engine (MSDE) or the Microsoft SQL Server 7.0 sample database Northwind.
  2. Create a new user named Day-Mgr. To do so, follow these steps:
    1. On the Tools menu, point to Security, and then click Database Security. The SQL Server Security dialog box appears.
    2. On the Server Logins tab, click Add.
    3. In the SQL Server Login Properties dialog box, type a new user name of Day-Mgr.
    4. Click SQL Server authentication, and leave the password blank. Select the database Northwind from the drop-down list.
    5. Click the Database Access tab, and click to select the Permit check box next to Northwind. Also click to select the Permit check box next to Public under Permit in database role. This gives the user permission to create objects in this database.
    6. Click OK twice to close the SQL Server security dialog boxes.
  3. On the File menu, click Connection.
  4. Click Use a specific user name and password, and then type the user name that you just created. Click OK to close the dialog box. This resets the connection of the project to the new user.

    NOTE: When the new user is active, the table name listing will include (dbo) after each table name.
  5. Create a new view. Add all the fields from the Categories table.
  6. Try to save the new view. Note that you receive the error mentioned in the "Symptoms" section of this article.

Modification Type:MinorLast Reviewed:1/26/2005
Keywords:kbbug KbClientServer kberrmsg kbnofix KB264961