This topic is locked

Shared Database Access

4/30/2003 5:18:37 PM
ASPRunnerPro General questions
author

ASPRunner has been suggested to me as a way to quickly and cheaply build a web based QA database for our organization.
A concern I have is that we could have several people attempting to view and/or update a record at the same time, which could lead to data corruption.
Though as I'm writing this, I'm realizing that it's only going to include the basic sql statements to get data out, and put data in, no special code to help ensure data integrity.

admin 5/1/2003

Hi,
there are several possible ways to implement shared database editing.

Here is what I can recommend:

  1. Add a field to your database table which will hold some unique value.

    It can be ReplicationID field in MS Access or Uniqueidentifier field in MS SQL.
    Your table structure can look like this:

    ID - int, primary key

    Name - varchar

    UniqueID - uniqueidentifier
  2. You read this field value on the edit page ( don't have to display it though )

    and use it in WHERE clause. The same time you update this field with new value. Here is the syntax for MS SQL.
    Update <table> set name='...', UniqueID = newid()

    where  id = ... and UniqueID = <old UniqueID>


This will prevent second person from updating this record without rereading data.
It sounds like you need to generate code with ASPRunner and make some adjustments.
Sergey Kornilov