Locking problems altering a table ?? (1 Viewer)

ksor

Registered User.
Local time
Today, 10:56
Joined
Feb 8, 2018
Messages
70
I use these lines to delete the records from a temporary table and reset ID automumbering to start from 1 again:

DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [INFOs midlertidig]"
DoCmd.RunSQL "ALTER TABLE [INFOs midlertidig] ALTER COLUMN [Id] COUNTER(1,1);"
DoCmd.SetWarnings True

But the "Alter table" fails with "Runtime error 3211" = "Table can't be locked" because some 'other' user or process uses the table' - but no one else is on the DB - and I can't see what process could be running ! :banghead:

How can I cure that problem ?
 

isladogs

MVP / VIP
Local time
Today, 17:56
Joined
Jan 14, 2017
Messages
18,186
@ksor
The cross posting etiquette exists for a good reason which you really should be aware of. You've already had answers from June and ssanfu at the other site.

The fact is that somewhere that table is in use so you can't alter its design.
Try closing all objects and then run the code. Or restart the app and do so.

If you want help again don't bite the hand that feeds you.
 

ksor

Registered User.
Local time
Today, 10:56
Joined
Feb 8, 2018
Messages
70
Biting the hand that feeds you is no good - that's right !


But if you go to a store asking for something they don't have - you go to the next store :D - that's how life is !
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:56
Joined
Sep 21, 2011
Messages
14,045
Biting the hand that feeds you is no good - that's right !
But if you go to a store asking for something they don't have - you go to the next store :D - that's how life is !

You do not go to multiple stores asking each store to order the item for you.?

That is pretty much what you are doing here, using your analogy.?
 

isladogs

MVP / VIP
Local time
Today, 17:56
Joined
Jan 14, 2017
Messages
18,186
And on both sites you seem to have completely ignored the advice given.
You certainly haven't acknowledged what was written.

You also did that in a previous thread I was involved with recently.
Carry on doing so and you'll find help will dry up
 

bob fitz

AWF VIP
Local time
Today, 17:56
Joined
May 23, 2011
Messages
4,717
Biting the hand that feeds you is no good - that's right !


But if you go to a store asking for something they don't have - you go to the next store :D - that's how life is !
I would recommend you to read the following link: https://www.excelguru.ca/content.php?184

This forum is not a store. We do charge for the knowledge and advice given. If one was running a charity shop and insulted their donors they would end up with no items to sell. Beware of putting your self in a position where nobody wants to help for free or you may end up having to pay dearly at the store. :)

Good luck with your project.
 

Users who are viewing this thread

Top Bottom