Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find out if table is in use

Status
Not open for further replies.

Reinier11

Technical User
Jun 19, 2003
22
ES
Hi,

I'd like to know how to check if a table is in use by another user or process. I've searched the forums but couldn't really find what I needed.
Anyone with a suggestion or references to 'how to' articles please help.

Gr,
Reinier
 
Try to open the table in Design View. If it fails, the table is probably locked by another user. (This will work even if the table is being displayed in a form with optimistic locking, for example.)

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Hi Reinier11 and RickSpr,

Until microsoft is forced to publish its API's I honestly don't think there's any way to test for this.

Trying to open a table in Design View will fail on:

Security
Linked
MDE

I spent a bit of time on this earlier. For once I thought I'd beat you to an answer RickSpr, so often I work on an question, when I'm ready, I do a quick Refresh, who's there before me, RickSpr.

Hope you know I'm only messing about.

Bill

 
Hi Bill,

Thanks for catching my gaffe. I knew there were some other reasons opening in Design View could fail (that's why I said "probably"), but I didn't stop to think how common they might be.

That "getting there before me" works both ways, you know. I'll bet we have very similar habits in how we browse the forums.

I still haven't succeeded in knocking you out of the top slot in the Experts list though, have I? :-D

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Hi Billpower and RickSpr,

Thank you both for your response. Decided I won't use this because the db is split and secured. I will just let it bounce on a general err.description,
or otherwise do have to force Microsoft myself.
Since this is a forum: can anyone tell me how this can be done in vba?
May the best man get there first.

Gr,
Reinier


 
Sorry, I'm not following what you're saying. What is it that you want to do in VBA?

(BTW, Bill turned off his email notification on this thread, so he may or may not be reading it any more.)

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Hi RickSpr,

Uhh, was meant as a joke. Mean't to say: use vba to force Microsoft to publish its API's as a reaction to Billpower.
Sorry, if my humor is a bit dull.
 
Not your fault. I'm the humorless one, at least when I'm at work.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top