[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

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

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
0
coperations07
Asked:
coperations07
  • 2
2 Solutions
 
Jeff CertainCommented:
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.
0
 
David L. HansenProgrammer AnalystCommented:
0
 
David L. HansenProgrammer AnalystCommented:
Notice in the link I provided you can set the exclusive property in a simple desktop shorcut.
0
 
coperations07Author 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.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now