Microsoft KB Archive/264961

= ACC2000: &quot;ADO Error: Line 1 : Incorrect Syntax Near '-'.&quot; Error Message When You Save a View =

Article ID: 264961

Article Last Modified on 1/26/2005

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



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.



Steps to Reproduce Behavior
 Create a new project to the Microsoft Data Engine (MSDE) or the Microsoft SQL Server 7.0 sample database Northwind. Create a new user named Day-Mgr. To do so, follow these steps:  On the Tools menu, point to Security, and then click Database Security. The SQL Server Security dialog box appears. On the Server Logins tab, click Add. In the SQL Server Login Properties dialog box, type a new user name of Day-Mgr .</li> Click SQL Server authentication, and leave the password blank. Select the database Northwind from the drop-down list.</li> 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.</li> Click OK twice to close the SQL Server security dialog boxes.</li></ol> </li> On the File menu, click Connection.</li> 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.</li> Create a new view. Add all the fields from the Categories table.</li> Try to save the new view. Note that you receive the error mentioned in the &quot;Symptoms&quot; section of this article.</li></ol>

Additional query words: pra ADO error Line 1 Incorrect syntax near -

Keywords: kberrmsg kbbug kbnofix kbclientserver KB264961

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.