SIMULTANEOUSLY access to a table?!

J

Julia

Hi,

I have an access application installed on 3 machines
which add and updates rows from a table named "INVOICES"

and a server application which need to detect when changes occur in the
INVOICES
table and process some rows form it.


In order to do that we devise a way in which the access application will
add a row to a table Named "CHANGES"
with the id of the row from the INVOICES table

the CHANGES table look like this

id[AutoNumber]
Invoices.RowId[number,duplicates ok) indetify a row from the INVOICES table


when the client application want that the server will process the changes
it is notify it (somehow)

and The server do the following

1.First it get the Highest Id in the CHANGES table
2.Next he get all rows from the changes table with id less or equal to the
id it get in step 1
3.Next he process the rows from the INVOICES table
4.Finally the server delete all rows from the changes table which have an id
less or equal from
the id it get in step 1

I wonder if this method is ok,and if the client application will not have
problem adding new row
to the CHANGES table when the server do one of the steps below

If you have know other way or third party tools with which a server can
detect when changes occur in a table please
add it also to your answer

finally a basic question not relates to the above question

When two threads SIMULTANEOUSLY try to update the same row in the data base
assuming
will they both succeeded?


Thanks in advance
 
T

Tony Toews

Julia said:
I wonder if this method is ok,and if the client application will not have
problem adding new row
to the CHANGES table when the server do one of the steps below

Seems quite reasonable to me and a good way to detect the changes.
If you have know other way or third party tools with which a server can
detect when changes occur in a table please
add it also to your answer

You could get into instant notification such as using network
notification between the FEs and the server app. As to how all this
would work I don't know as I have yet to get into this.
When two threads SIMULTANEOUSLY try to update the same row in the data base
assuming
will they both succeeded?

No, this is basic to record locking. You will get errors which you
will have to handle within your code. You can test this yourself by
making a change to the record in one copy of Access on your system, so
that you see the pencil on the left hand side of the form, and try to
save a change to that same record in another copy of Access.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Top