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

    Unanswered: Lock Table Syntax in C# ASP.NET

    Hello,

    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]
    WITH (TABLOCK)

    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.

    Greets

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

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    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
    Posts
    50
    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 - ConnectionStrings.com

    Hope this helps

    Jim

Posting Permissions

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