Error "Could not save; currently locked by another user."

F

fniles

One of our application uses VB6 and Access97 database. Another application
uses VB.NET 2005.
This morning for about 15 seconds when the application tries to read either
a query or a table from the database, in in both VB6 and VB.NET
applications, I got the error "The Microsoft Jet database engine cannot find
the input table or query 'myTable'. Make sure it exists and that its name
is spelled correctly." Also, I got the error "The Microsoft Jet database
engine cannot find the input table or query 'myQuery'. Make sure it exists
and that its name is spelled correctly." The error happens to all the tables
and all the queries.
Also, the VB.NET application (uses OLEDB) got an error when trying to open a
table "Could not save; currently locked by another user."
Then, after the 15 seconds or so, everything worked fine again.

What would cause the above errors ? Why couldn't it recognize the existing
tables and queries for about 15 seconds ?

Thank you.
 
M

Miro

Was anyone modifying the table itself - or had the table opend up in design
mode with access?
Access would lock the mdb file on you like that I believe.

Might be a good test - log everyone out - go into access and open up the
file, abnd a table and then try to run your program.
Someone may have inadvertantly run something thru microsoft word or
something against your table?
 
P

Paul Clement

¤ One of our application uses VB6 and Access97 database. Another application
¤ uses VB.NET 2005.
¤ This morning for about 15 seconds when the application tries to read either
¤ a query or a table from the database, in in both VB6 and VB.NET
¤ applications, I got the error "The Microsoft Jet database engine cannot find
¤ the input table or query 'myTable'. Make sure it exists and that its name
¤ is spelled correctly." Also, I got the error "The Microsoft Jet database
¤ engine cannot find the input table or query 'myQuery'. Make sure it exists
¤ and that its name is spelled correctly." The error happens to all the tables
¤ and all the queries.
¤ Also, the VB.NET application (uses OLEDB) got an error when trying to open a
¤ table "Could not save; currently locked by another user."
¤ Then, after the 15 seconds or so, everything worked fine again.
¤
¤ What would cause the above errors ? Why couldn't it recognize the existing
¤ tables and queries for about 15 seconds ?

Is this a multi-user database located on a network or is it a single user database on a local
machine?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
M

Miro

I beleive Microsoft word treats mdb files like excel when you start using
them as a data source for data.

It locks the file and makes a file.
just like if you had a pure excel file - and open it...it creates like a
2ndary file of it. Once you close excel the 2ndary temp file disappears.
But the whole file is locked until you do.

Someone could be running something on your file thru excel or word perhaps?

It is a file on the network - thus giving everyone full rights to the file,
and you are trusting the do not go to the file and hit 'delete' or
'whatever' to it.

I am assuming you are under the assumption that the users only use your
'program' to access the data.
That assumption may be incorrect. ( If my first assumption is true :) )

One easy idea might be to rename the mdb file to be something like
yourfilename.bla and let your program open the file.
That way if someone tries to look for mdb files to open with word, it
searches for *.mdb and it wont come up. They will have to know your 'bla'
file is an mdb file and change the search to *.* and select it. Of course -
then you are in the same boat, but it might help you find out if someone is
using an external program to access the access database.
If you change the file name...someone ( if inderectly using the access
table ) without knowing it... might ask a question like "my program stopped
working/ my word document / my excel"

Just a thought. But again - i could be totally off and I could be leading
you down the wrong path.

It may be something totally not related...but my first assumption would be
that someone did have that 'file' locked thru another program.
Perhaps ask the users what else they are running and see if something pops
up?
 
R

Ralph

fniles said:
One of our application uses VB6 and Access97 database. Another application
uses VB.NET 2005.
This morning for about 15 seconds when the application tries to read either
a query or a table from the database, in in both VB6 and VB.NET
applications, I got the error "The Microsoft Jet database engine cannot find
the input table or query 'myTable'. Make sure it exists and that its name
is spelled correctly." Also, I got the error "The Microsoft Jet database
engine cannot find the input table or query 'myQuery'. Make sure it exists
and that its name is spelled correctly." The error happens to all the tables
and all the queries.
Also, the VB.NET application (uses OLEDB) got an error when trying to open a
table "Could not save; currently locked by another user."
Then, after the 15 seconds or so, everything worked fine again.

What would cause the above errors ? Why couldn't it recognize the existing
tables and queries for about 15 seconds ?

Most likely a temporary 'dead-lock'.

There may be something useful in these articles:

"How to keep a Jet 4.0 database in top working condition"
http://support.microsoft.com/kb/303528/

"Introduction to .ldb files in Access 2000"
http://support.microsoft.com/kb/208778

-ralph
 
P

Paul Clement

¤ It's a multi user database located on a network.
¤

Do all users have full permissions to the folder where the database is located?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
P

Paul Clement

¤ "Full permissions" means permission to rename and delete the file ?
¤ I am not sure.

Delete and create on the folder would be required because of the associated .LDB file that is
created/deleted when the database is opened/closed.


Paul
~~~~
Microsoft MVP (Visual Basic)
 

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