can't open 1 query

M

maryj

I have an Access 2000 database with many queries. I can open all of the
queries except 1. I can't even view it in design view. Everytime I try to
view the query, Access totally closes. The database is on a network drive. On
the network drive there is also an ldb file.
 
A

Allen Browne

It sounds like this query is probably corrupt.
Try these steps:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
For an explanation of why, see:
http://members.iinet.net.au/~allenbrowne/bug-03.html

2. Compact the database:
Tools | Database Utilities | Compact

3. Press Ctrl+G to open the immediate window. Type:
? CurrentDb.QueryDefs("MyQuery").SQL
and press Enter.

If Access crashes, you will have to delete the query, compact the database,
and figure out how build it again from scratch (or possibly import it from
an old backup copy of the database).

If Access does not crash, and prints the text of the query into the
immediate window, continue:

4. Copy the text of the query from the Immediate window, and paste it
somewhere (such as into Notepad).

5. Delete the problem query.

6. Compact the database again.

7. Create a new query with nothing in it.

8. Switch the query to SQL View (View menu), and paste in the text of the
query.

9. Switch the query to Design View (View menu), and arrange it so it looks
the way you want.

10. Save the query with the same name as the old one.
 
Top