Microsoft Access Runtime Error 3211
help? Post your question and get tips & solutions from a community of 418,589 IT Pros & Developers. It's quick & easy. How run-time error '3211' the database engine could not lock table to clear lock on table if error 3211? P: n/a deko I'm trying the database engine could not lock table access 2013 to import an Excel Spreadsheet into an Access Table but sometimes things get buttered up if the spreadsheet does not database engine could not lock table because it is already in use by other have the right columns. So I want to drop the Access table and recreate it with a DDL query when that happens. The problem is I get an error when trying to drop the table - Error 3211: The database engine could not lock table 'tblExcelTx' because it is already in use by another person or process. Is there any way to clear the lock? All I want to do is blow away the table... Thanks in advance. Nov 13 '05 #1 Post Reply Share this Question 4 Replies P: n/a Salad deko wrote: I'm trying to import an Excel Spreadsheet into an Access Table but sometimes things get buttered up if the spreadsheet does not have the right columns. So I want to drop the Access table and recreate it with a DDL query when that happens. The problem is I get an error when trying to drop the table - Error 3211: The database engine could not lock table 'tblExcelTx' because it is already in use by another person or process. Is there any way to clear the lock? All I want to do is blow away the table... Thanks in advance. CurrentDb.TableDefs.Delete "tablename" But that still doesn't handle the problem since if the table is in use somewhere it can't be deleted. Have you opened a recordset on the table somewhere? If so, close the recordset first. Nov 13 '05 #2 P: n/a deko > CurrentDb.TableDefs.Delete "tablename" But that still doesn't handle the problem since if the table is in use somewhere it can't be deleted. Have you opened a recordset on the table somewhere? If so, close the recordset first. Thanks - I'll give it a shot. The reason the table is locked is because it gets assigned as the recordsource for a subform. I tr
Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rate Thread Display Modes 08-01-2005, 12:16 PM #1 Pan Registered User Join Date: Mar 2004 Posts: 21 Thanks: 0 Thanked 0 Times in 0 Posts Table lock - Run-time error 3211 ???? I have a form with a combo box that contains a list of customers. Select a customer from the combo box and the form fields populate with general customer info. The form has a subform on it with a combo box where you can select products. Select a product from the combo box and https://bytes.com/topic/access/answers/204233-how-clear-lock-table-if-error-3211-a the subform populates with customer-specific product info. If I open the main form and select a customer, then without doing anything else I select another customer, everything works ok. It’s when I select a product on the subform, and then try to select a different customer on the main form that I get “Run-time error 3211: The database engine could not lock table tblCustomer because it is in use by another person or process.” Can anybody shed some light http://www.access-programmers.co.uk/forums/showthread.php?t=91173 on this? I’ve been confounded by it for days. Pan View Public Profile Find More Posts by Pan 08-02-2005, 08:33 AM #2 quest4 Registered User Join Date: Oct 2004 Posts: 246 Thanks: 0 Thanked 0 Times in 0 Posts What is, very simply put, happening is you opened one record, via the Customer selection and you have not save it and closed it and then you are trying to open another. Is that kind of clear to you? A simple cure is to add a cmdButton to the form, cal it Save and then add a second cmdButton and call it New or Add. Use the wizard to build these and they should be close to what you need. As you get better at this there are some real cute ways to improve this, but I don't know how good you are at code. hth. quest4 View Public Profile Find More Posts by quest4 08-02-2005, 09:55 AM #3 Pan Registered User Join Date: Mar 2004 Posts: 21 Thanks: 0 Thanked 0 Times in 0 Posts I'm very thankful to you for replying. However, I knew I ran the risk of miscommunicating by way oversimplifying the issue. I can edit the current record on the main form as much as I want and still successfully select a different customer from the custom
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login https://www.experts-exchange.com/questions/23606755/Runtime-error-3211-using-Access-VBA.html Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Runtime error 3211 using Access VBA Want to Advertise Here? Solved Runtime error 3211 using Access VBA Posted on 2008-07-30 MS Access 1 Verified Solution 7 Comments 3,459 Views Last Modified: 2013-11-27 Hi experts, I encountered the run-time error 3211: The databse engine couldn't lock 'TempTable' because it is in use by another person or process. Currently, I built in database engine the function in MS Access using VBA such that each time I click on "Update" button, a table "TempTable" will be imported from Excel. Then information I need will be picked up from "TempTable" and copied to other tables that I have. After this, the "TempTable" will be deleted after the command: CurrentDb.Execute "DROP TABLE TempTable" This run-time error happens each time when I try to click on "Update" for the second time. If I close the program, database engine could restart it and click on "Update", it works fine. Can anyone help me explain the error? Any solutions on this? Thanks! 0 Question by:angie_angie Facebook Twitter LinkedIn Google LVL 16 Best Solution byRick_Rickards It's probably inside the code that's tapping the TempTable. Any Open Recordsets that may still be attached to it? Might help to see the code you're using when you Click Update. Go to Solution 7 Comments LVL 16 Overall: Level 16 MS Access 15 Message Accepted Solution by:Rick_Rickards2008-07-30 It's probably inside the code that's tapping the TempTable. Any Open Recordsets that may still be attached to it? Might help to see the code you're using when you Click Update. 0 LVL 65 Overall: Level 65 MS Access 42 Message Active today Expert Comment by:Jim Horn2008-07-30 {having a vague memory here} If you edit/delete a table in VBA code, you need to do a refresh of the database window before you can use that table again. With CurrentDb .Execute "DROP TABLE TempTable" Application.RefreshDatabaseWindow '<-- This has to happen here .Execute "SELECT stuff INTO TempTable FROM StuffBox" End With 0 LVL 16 Overall: Level 16 MS Access 15 Message Expert Comment by:Rick_Rickards2008-07-30 Actually to amplify Jim's statement if your'e code is not seeing the table you may also need to Refresh the Tabledefs collection. If you're using CurrentDb as your database object then that shouldn't b