Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2011

    Unanswered: Lock Table Syntax in C# ASP.NET


    I've been looking in the net but I can't find the syntax of locking a table in Access. My purpose is to lock the table so no one else during the transaction can have access to it. I have tried this query

    LOCK TABLE [document_numbers] IN EXCLUSIVE MODE

    and this

    SELECT *
    FROM [document_numbers]

    and ROWLOCK also but nothing works. The syntax I found is only about MS SQL, Oracle and some more but there is nothing about MS Access. Please if some one knows to post a replay, I will be really grateful.


    P.S. This have to be able to be programmed in C#.

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    P.S. This have to be able to be programmed in C#.
    probably best to ask this in the C# forum
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Dec 2009
    private static string constr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Mode=Share Exclusive;User Id=admin;Password=";

    In the connection string you want to use the "Mode=Share Exclusive;" parameter. This should allow you to do what you want.

    I got this from the google webs. Here's the url.

    Access Connection String Samples -

    Hope this helps


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts