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

Posted on 2009-02-09
Last Modified: 2012-05-06
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?

Question by:coperations07
    LVL 24

    Accepted Solution

    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:
    2. Change the Access file to use exclusive locks by default.
    LVL 15

    Assisted Solution

    by:David L. Hansen
    LVL 15

    Expert Comment

    by:David L. Hansen
    Notice in the link I provided you can set the exclusive property in a simple desktop shorcut.

    Author Closing Comment

    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.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
    In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now