Locking DB for a short time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe

    Locking DB for a short time

    I am sure this is an old issue for ASP veterans, but I come from a
    Cold Fusion background, in which what I will ask below can be easily
    done.

    Let's say I have two tables named "Companies" and "Users"
    respectively.

    In the Companies DB, the column with the unique ID and primary key is
    called "CompID",
    and is Auto Number.

    Many users can be linked to a single company. This link is determined
    by a column
    called also CompID in the Users table.

    Now, sometimes a user will specify a new company that's not in the
    table Companies,
    which means that I have to insert a new record in the Company table,
    creating thus a new CompID which I then have to read -Max(CompID)- and
    update the Users.CompID with this value.

    Between the insertion of the new record and the update other users of
    the database must be
    prevented from making changes. How does one do that? I've heard stuff
    about using
    Application.Loc k, but doesn't that work only with Application
    variables? Or can one just go and use code like below:

    <%
    Application.Loc k

    SQL stuff ...
    other SQL stuff ..

    Application.Unl ock
    %>

    Please, help. Thanks in advance.








  • Ray Costanzo [MVP]

    #2
    Re: Locking DB for a short time



    Ray at work

    "Joe" <innerlab@sympa tico.ca> wrote in message
    news:00L%c.2332 8$lP4.1380964@n ews20.bellgloba l.com...


    Comment

    Working...