Microsoft KB Archive/295277

= ACC2002: Access Quits When Running a SQL Query =

Article ID: 295277

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q295277



Moderate: Requires basic macro, coding, and interoperability skills.

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



SYMPTOMS
In Microsoft Access, you may receive the following error message when you run a SQL query:

Microsoft Access has encountered a problem and needs to close. We are sorry for the inconvenience.



CAUSE
This behavior occurs with incorrectly written SELECT statements.



RESOLUTION
To work around this issue, use the design grid in query Design view to create queries. If you must write your own SQL query, test it first with a backup of your database. When you write SQL queries, avoid enclosing the items listed in the SELECT clause in parentheses.



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



MORE INFORMATION
This issue can occur when you write your own SQL queries -- for example, when you create a query that cannot be defined in Query Design view. To avoid any loss of data related to this issue, create a backup of your database before you work with any untested SQL syntax.

Steps to Reproduce the Problem
 Start Access and create a new database Db1.mdb.  Create the following new table in Db1.mdb:   Table: Table1 --  Field Name: A   Data Type:  Text

Field Name: B  Data Type: Text  Save the newly created table as Table1 and close it. In the Database window, click Queries.</li> Create a new query in Design view, and then close the Show Table dialog box without adding a table.</li> On the View menu, click SQL View, and then type the following SQL syntax:

SELECT (A,B) FROM Table1

Notice that this syntax is incorrect. Correct syntax should not enclose the items listed in the SELECT clause in parentheses.

</li> On the Query menu, click Run. Note that Access quits without sending a syntax error message. Instead, you receive the message described in the &quot;Symptoms&quot; section of this article.</li></ol>

Additional query words: pra shuts down

Keywords: kberrmsg kbbug kbnofix KB295277

-

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

© Microsoft Corporation. All rights reserved.