I cannot open my query in SQL view

  • Thread starter Thread starter MN
  • Start date Start date
But I can run it - MS Access 2K - Preminum
Thank you in advance.

More info please. What steps are you taking to open it in SQL view? Can you
describe the query? What do you see if you select View... SQL from the View
menu in query design mode?

John W. Vinson [MVP]
 
Thanks for reply,
When I select View...SQL from the view menu It's open a blank query (I mean
I see nothing in the query) But When I clicked 'Query -> ! Run' , it ran and
have result as I want.
- From SQL view (see nothing now) I clicked View -> Design View => I still
see nothing then I click "x" to close it MS ask "Do you want to saves change
to the design of query ' QryMyFirstquery' "?
I did not do anything change, so I clicked 'No'.
Hope this clear to you,
Regards, MN
 
That is strange. I was able to somewhat mimic what you are seeing in the SQL
view by putting a bunch of Enters (AKA line feeds) in front of the sql
statement to push it towards the bottom of the window then shrinking the SQL
view window. However even after saving when I reopened the query directly in
SQL view, the text showed up plus it made no difference in design view either
way. Therefore my knee-jerk reaction of corruption kicked in.

At times like this, nothing beats a good backup. In fact make a complete
backup of your database now and put it away for safe keeping.

Tony Toews has an excellent web page on database corruption.
http://www.granite.ab.ca/access/corruptmdbs.htm

Allen Brown also has excellent info on corruption.
http://allenbrowne.com/ser-47.html

I have a white paper in a Word document named Fix Corrupt Access Database
towards the bottom this page:
http://www.rogersaccesslibrary.com/OtherLibraries.asp
 
Thank you for remind me,
I did back up my database.
My application still running. Everything work well, except I can not modify
my query (It is a Select Query).
I tried your suggestion : Open Query in SQL mode - hit key "Home" on the key
board then hit a bunch of "Enter" then click "Query -> ! Run" It was pop-up
an error - " Invalid SQL statement; expect 'DELETE',
'INSERT','PROCEDURE','SELECT', or 'UPDATE' "
Then I design close it without saving it. Click "Query -> ! Run" It's run OK.
Weird ?
Thank for reply-MN
 
Thanks for reply,
When I select View...SQL from the view menu It's open a blank query (I mean
I see nothing in the query) But When I clicked 'Query -> ! Run' , it ran and
have result as I want.
- From SQL view (see nothing now) I clicked View -> Design View => I still
see nothing then I click "x" to close it MS ask "Do you want to saves change
to the design of query ' QryMyFirstquery' "?
I did not do anything change, so I clicked 'No'.
Hope this clear to you,
Regards, MN

Wierd!

Two things to try:

1. Create a new empty database. Use File... Get External Data... Import to
import this query into the new database. Can you see it then?

2. Type Ctrl-G to open the VBA editor and the Immediate window and type

Application.SaveAsText "queryname", "C:\My Documents\foldername\xyz.txt"

using your actual query name in place of queryname and some valid path to an
existing directory. Edit the xyz.txt file (you can use any name you like,
perhaps the name of the query, as the filename) in Notepad to see if it
contains the SQL (in addition to a bunch of other stuff).

John W. Vinson [MVP]
 
Sorry for reply late,
I tried the 1st methods it is working.-Thanks you for taking your time to
help me out,
Best Regards-MN
 
Sorry for repost this message :-(
This morning I follow method 1 then I can see the query. After I save then
re-open it, it is the same thing ==> See nothing :-(
- Using method 2: I got an error "Compiler error!-Argument not optional"
Please advices, Thank in advange.MN
 
Back
Top