DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

The database could not lock table 'tablename' because it is already in use by another

This is a discussion on The database could not lock table 'tablename' because it is already in use by another within the Microsoft Access forums, part of the Databases category; Can someone please help me with this issue? I have a database which I created and it’s being shared by ...

Go Back   DeveloperBarn Forums > Databases > Microsoft Access

  #1  
Old December 8th, 2009, 12:29 PM
Barn Regular
 
Join Date: Dec 2009
Posts: 55
Rep Power: 1
Colper is an unknown quantity at this point
Default The database could not lock table 'tablename' because it is already in use by another

Can someone please help me with this issue? I have a database which I created and it’s being shared by other users. When there is more than one (1) user using the database I get this error:


“The database could not lock table (tablename) because it is already in use by another person or process.”

Thank you in advance.
Reply With Quote
  #2  
Old December 8th, 2009, 02:17 PM
don94403's Avatar
Moderator
 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 146
Blog Entries: 8
Rep Power: 4
don94403 has a spectacular aura aboutdon94403 has a spectacular aura aboutdon94403 has a spectacular aura about
Default

What version of Access are you using? There were substantial changes in the multi-user features, between 2003 and 2007.
__________________
If work was really that good, the rich would own all of it and charge the rest of us to do it.
Reply With Quote
  #3  
Old December 8th, 2009, 03:34 PM
Barn Regular
 
Join Date: Dec 2009
Posts: 55
Rep Power: 1
Colper is an unknown quantity at this point
Default

Access 2003.
Reply With Quote
  #4  
Old December 8th, 2009, 08:34 PM
don94403's Avatar
Moderator
 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 146
Blog Entries: 8
Rep Power: 4
don94403 has a spectacular aura aboutdon94403 has a spectacular aura aboutdon94403 has a spectacular aura about
Default

And when do you get this error, immediately when someone else accesses the database, or only when the user tries to perform some operation? And if the latter, what operation triggers the error? Be as specific as you can be, such as showing code or SQL, if appropriate.
Reply With Quote
  #5  
Old December 9th, 2009, 09:24 AM
Barn Regular
 
Join Date: Dec 2009
Posts: 55
Rep Power: 1
Colper is an unknown quantity at this point
Default

It happens when more than one user tries to update/inputa data or tries to open any form in the database. I don't know what code to show, there is a lot of coding here so I have no idea where to find the corresponding code to show you.

Thank you.
Reply With Quote
  #6  
Old December 9th, 2009, 01:55 PM
don94403's Avatar
Moderator
 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 146
Blog Entries: 8
Rep Power: 4
don94403 has a spectacular aura aboutdon94403 has a spectacular aura aboutdon94403 has a spectacular aura about
Default

OK, I would need to know the following:

1. How is this database being shared? Is it a single .mdb file on a network drive, or is the database "split" into "front-end" and "back-end" .mdb's? If it is being used by multiple users, it definitely should be split. If it IS split, do each of the users have their own copy of the "front-end" .mdb? They should have.

2. Is the database "secured" with user-level security? This means that users must LOGIN with a password in order to access the database.

3. Do I understand that the database is fully accessible as long as only one user is trying to use it at the same time?
Reply With Quote
  #7  
Old December 9th, 2009, 03:38 PM
Barn Regular
 
Join Date: Dec 2009
Posts: 55
Rep Power: 1
Colper is an unknown quantity at this point
Default

1. The database is ina single .mdb file on a share drive. Users donot need a password, only username. I have created two other databases and have never heard or done anything with front or back end or split. They are on the same share drive different folders and they are working perfectly.

2. Yes, it's secure with user-level security. Username only no password.

3.Yes, only one user can edit or input data at one time.

Thanks....
Reply With Quote
  #8  
Old December 9th, 2009, 04:18 PM
don94403's Avatar
Moderator
 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 146
Blog Entries: 8
Rep Power: 4
don94403 has a spectacular aura aboutdon94403 has a spectacular aura aboutdon94403 has a spectacular aura about
Default

Quote:
Originally Posted by Colper View Post
1. The database is ina single .mdb file on a share drive. Users donot need a password, only username. I have created two other databases and have never heard or done anything with front or back end or split. They are on the same share drive different folders and they are working perfectly.

2. Yes, it's secure with user-level security. Username only no password.

3.Yes, only one user can edit or input data at one time.

Thanks....
OK, I would say that you have just been lucky up 'til now. Access databases should always be split when you need to have simultaneous use by multiple users on a network. Here's some information on this:

Using MS Access: Multiple users, joerg mayer, networked system
Multiuser Databases in Microsoft Access
Time To Link Your Microsoft Access Program To MS Access Data File | Daily Access Tips
http://www.ozgrid.com/forum/showthread.php?t=34665

Comments on this post
micky agrees: Thanked Post
Reply With Quote
The Following User Says Thank You to don94403 For This Useful Post:
micky (December 10th, 2009)
  #9  
Old December 9th, 2009, 10:54 PM
Barn Regular
 
Join Date: Dec 2009
Posts: 55
Rep Power: 1
Colper is an unknown quantity at this point
Default

I really appreciate your help. I read all of those links and that's great information. I will try to implement it as needed as possible.

Now, my thing is that the other two databases I created are working just fine without any problems and I never did the split. So I am curious as to why it has worked. Another thing to keep in mind is that this database I am talking about I did not created from scratch.

This database was already created by another user and all I did was redesigned it.

Thank you once again!
Reply With Quote
  #10  
Old December 10th, 2009, 10:18 PM
don94403's Avatar
Moderator
 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 146
Blog Entries: 8
Rep Power: 4
don94403 has a spectacular aura aboutdon94403 has a spectacular aura aboutdon94403 has a spectacular aura about
Default

As I said, you were lucky. The specific reasons for lock-ups are hard to determine, and are really unimportant, since the only way to avoid them is to split the database. To satisfy your curiosity, though, it involves how many tables are in the database, and what kind of relationships exist, how many records are in the tables, how many users are trying to access the same tables at exactly the same time, etc. etc. etc. etc.

The only safe rule to follow is: in every case where multiple users need to be able to access the data simultaneously on a network, SPLIT THE DATABASE. It's really pretty easy to do. There's even a Wizard for it, although I don't bother even using it. The whole point is to import all data (TABLES) from the "front-end" .mdb into a new "back-end" .mdb. That's the .mdb file that will be "linked" to by all the users' "front-end" copies. When you have done that, open the front-end .mdb and [gasp!] DELETE ALL THE TABLES. Then, using the Linked Table Manager, link all the tables back in (don't import them, link to them), they will appear in the Tables Tab of the Database Window with little arrows beside them. The application will then work as it did before. Now, make a copy of this "front-end" for each user and install it on their work station. You may need to repeat the Linked Table Manager function on each one, depending on how each one has mapped the shared drive on the network, but it's a 30-second operation.

One word of caution: whenever you do something like this, always make a backup copy of the file before you begin -- JUST IN CASE something goes wrong!
Reply With Quote
Reply

  DeveloperBarn Forums > Databases > Microsoft Access

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
"File sharing lock count exceeded…" Colper Microsoft Access 2 December 7th, 2009 10:44 PM
Delete selected information from database from table Arshan ASP Development 3 September 2nd, 2009 10:27 AM
Database table design Ziggy Database Design Help 17 February 16th, 2009 01:55 PM
Lock page/recordset? Rebelle ASP Development 37 October 30th, 2008 03:34 PM


All times are GMT -4. The time now is 10:51 AM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2