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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing into Access - Can I tell who has file locked

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
I am importing a file via DoCmd.TransferSpreadsheet. If the file is opened by someone else I get a 3051 error. Is there a way to tell who has the file opened so I can include their name in a message box explaining why the import did not work?

Thanks in advance for any help or suggestions!

Have a great day!
 
Try parsing the ldb file - it's readable in notepad & therefore can be opened & read using VBA. This gives a list of all users/PCs with the .mbd opened.

HTH

Cheers
Nikki
 
Hello Nikki,

Thanks for the response which engendered a couple more questions, if you would be so kind.

A. How do you reference the ldb file you mentioned? I've never done that before and didn't even know it existed.

B. Will the information in that file pertain to the Excel spreadsheet I am trying to import? I was not quite sure of that based on your response.

Thanks again for your helpfulness. I am usually on the Access forums but have recently spent more time here because of my current project. I have appreciated your contribution in other threads as well.

Have a great day!

 
Well, the ldb file tells all about the access file rather than the xl file - could you let me know which version of windows are you running under?

Cheers
Nikki
 
I'll do that on Monday when I get to the client site. I don't know it off the top of my head. Thanks!
 
Okay, here's a start anyway:

there's a API call GetUserName (not quite sure, but I've got full info atw ork - like you ;-)) which'll allow you to get a list of users accessing a file on NT & Win 2k

If you're using xl 2k or higher, you can use the Property UserStatus to find out which user(s) is(are) currently accessing a file. It's a property of the workbook

More 2morrow ...

Cheers
Nikki
 
PC O/S: Windows98
Office Suite: Office97
Lan: WinNT (I think)

Not sure how to tell on the LAN. I did a set statement in DOS to look at the environment variables and didn't see anything that looked significant in that regard. Since I am at a client site, I am not sure who to ask either.

Have a great day and thanks for the help!
 
I'm pretty sure the LAN is NT because they are getting ready to roll out Win2K and take away user access to local drives.

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top