query loses its contents!

D

David Gartrell

Hi,

I don't know if anyone can help me or not with this one but....

I have queries saved in Access 2000, and very very occasionally a query will
completely lose its its contents and i'll have to re-write it (although the
query still appears in the queries list). For small queries its only a
minor inconvenience but if a large query should get cleared down then that
would prove to be a real pain in the a**e!

Has anybody else had this before? Don't know if its relevent or not but all
of my databases are held on an NT4.0 Server and are accessed through our
network by users in the company.

Thanks in advance

David
 
G

Guest

Humm.... Queries don't have contents as such. Queries ask questions of the
tables which hold the contents in the form of records and fields. Possibly
you have a hard coded criteria that moves such as a range of dates and the
data is removed from the tables? In that case a parameter query might serve
you needs better.

Now if you are say that you open up the query and stuff is missing such as
the tables or fields, then there is a worry. Could someone be renaming the
tables or fields?

It could be a corruption problem. Does doing a compact and repair help? Any
other strangeness observed such as messages to repair the database?

If you happen the have one of the bad queries, open it in design view and
describe what you see. Next while still in design view, open it in SQL view
and copy and paste the contents here. Also describe any error messages while
trying to do this.
 
D

David Gartrell

Hi Jerry,

Thanks for you reply.

Somehow I don't think i made myself very clear.

Lets imagine I have a query with the usual SQL code:

select bla bla bla
from bla bla bla
where bla bla bla
and bla bla bla

etc etc etc.

Its a very average query. but what happened earlier today is that the query
wouldn't run as it had actually been emptied of code i.e. the SQL code had
actually disappeared and the SQL window was blank!. Because of the type of
users who access the database, I know the code couldn't have been deleted
manually.

This is only the second time in 5 years that this has happened to me so is
rare but i was wondering if it has also happened to anyone else.

Thanks

David
 
G

Guest

Hi David,

That's what I was afraid of as that points to database corruption. Make sure
that you have a good backup!

Try this: Create a new database and first import any of the tables used in
the query to the new database. Next import in the problem query. If it won't
come in, there's definitely a corruption problem. If it does import; however,
is still blank, there could be other problems.

Back in Access 95 ( shudder - a chill from a repress memory just ran through
me ) things would often disappear. Doing a Decompile and Recompile would
magically bring them back. Might be worth a problem with your troubles. Do a
Google on decompile and Access. There's plenty of info out there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top