Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Table In Use

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brad - 06 Dec 2005 22:36 GMT
Thanks for taking the time to read my question.

I have code that is running a docmd.runsql on a table (Append query). After
I run the query I want to delete the table.  I can't becuause the table is
still in use.

Error: 3211, DB could not lock table 'table1' because it is already in use
by another user.

How do I release this table so that I can delete it?

Thanks,

Brad
Graham R Seach - 07 Dec 2005 00:32 GMT
Brad,

Am I missing something? You want to delete a table just after adding data to
it? That's like making a sandwich, and throwing it away before eating.

I don't know how you're deleting the table, but the following construct
might help you on your way.
   On Error Resume Next
   Do
       DBEngine(0)(0).TableDefs.Delete "tblMyTable"
       DoEvents
   Loop Until (Err <> 3211)

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

> Thanks for taking the time to read my question.
>
[quoted text clipped - 11 lines]
>
> Brad
Brad - 07 Dec 2005 21:25 GMT
Hi Graham,

I forgot one word; "Source" table.  I want to delete the source table after
appending the data to another table.

I got it figured out.  I put the code in a different sub that gets fired
after the sub that I was in, is done.

Thanks for your help,

Have a great day,

Brad

> Brad,
>
[quoted text clipped - 29 lines]
> >
> > Brad
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.