Link to home
Start Free TrialLog in
Avatar of vbnetcoder
vbnetcoder

asked on

the database could not lock the "tablename" because it is in use by another person or process

This error started coming up when referring to the table in my code.  I can open up the table without any issues otherwise
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

close everything, then do a compact and repair

make sure that you close all recordset you open after you use them.

test your code again.
Avatar of vbnetcoder
vbnetcoder

ASKER

That didn't work



The image will show where the error happendsUser generated image
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it is throwing and error on that line now
if i get rid of this code it works:

'strSQL = "ALTER TABLE " & strTableName & " ALTER COLUMN id COUNTER (1, 1);"
'CurrentDb.Execute strSQL


but i need it
It turned out that somehow my form was referencing the table as a record source. not sure how that happened. I took it away and it was fixed