We help IT Professionals succeed at work.

Allow only 1 user at a time to modify Access DB.

Medium Priority
217 Views
Last Modified: 2012-05-06
Hi,
VB.Net 2005, Access 2000

I have a VB.Net App that uses an Access Database. There are a handful of users for this application. I need them to all be able to view the data from the database (via datagridview), but only one user at a time should be allowed to modify data in the database. There is not a login for this app, so I would like to set it up so the first user in would have modify rights. How can I accomplish this?

Thx,
Dave
Comment
Watch Question

Two options.
1. Add "Exclusive = 1" to your connection string. The OLEDB connection string looks like "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Exclusive=1;Uid=admin;Pwd=;"

 (Here's a great resource for connection strings: http://www.connectionstrings.com/access)
2. Change the Access file to use exclusive locks by default.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Commented:
CERTIFIED EXPERT

Commented:
Notice in the link I provided you can set the exclusive property in a simple desktop shorcut.

Author

Commented:
Thanks guys! I'm going to go with the exclusive locks option. There are several connection strings in the application code, so I'd rather not get into that unless I have to.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.