ACC2002: Access Quits When Running a SQL Query (295277)



The information in this article applies to:

  • Microsoft Access 2002

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

  1. Start Access and create a new database Db1.mdb.
  2. Create the following new table in Db1.mdb:
       Table: Table1
       ----------------------
       Field Name: A
       Data Type:  Text
    
       Field Name: B
       Data Type: Text
    					
  3. Save the newly created table as Table1 and close it.
  4. In the Database window, click Queries.
  5. Create a new query in Design view, and then close the Show Table dialog box without adding a table.
  6. 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.

  7. On the Query menu, click Run. Note that Access quits without sending a syntax error message. Instead, you receive the message described in the "Symptoms" section of this article.

Modification Type:MajorLast Reviewed:11/5/2003
Keywords:kbbug kberrmsg kbnofix KB295277