Asked by:
prevent table to update from other user on network

Question
-
Hi all
I want to develop application for LAN base. Some time I need to prevent other user to update table
thanks
jasvee
Friday, September 11, 2020 4:58 AM
All replies
-
Hi all
I want to develop application for LAN base. Some time I need to prevent other user to update table
thanks
jasvee
What you ask for is the very vintage way of pessimistic concurrency error preventing which was working with 4 or 5 users in a network although it was seldom happening.
Currently is used optimistic concurrency, it is based on that you save the data before the update and read it just before the update again and then test it before the update. Be aware it has to be done on the Server side and integrated in the Data access provider.
However, doing what you ask is easy. It is based on the Transaction, which locks everything at the start until an end transaction is given. The backside of it, mostly becomes your database then a mostly closed box.
https://docs.microsoft.com/en-us/dotnet/api/system.transactions.transaction?view=netcore-3.1
Success
CorFriday, September 11, 2020 8:06 AM -
If you use SQL, then consider DENY and GRANT statements. (In this case you can also visit https://docs.microsoft.com/en-us/answers/products/sql-server).
Which kind of tables do you have?
- Edited by Viorel_MVP Friday, September 11, 2020 8:09 AM
Friday, September 11, 2020 8:09 AM -
Hi
I am using Ms Access
thanks
Saturday, September 12, 2020 9:01 AM -
Hi
I am using Ms Access
thanks
Saturday, September 12, 2020 9:40 AM -
Hi
I am using Ms Access
thanks
If that is the case consider password protecting your database and in app.config encrypt the connection string with the password, see the following class which has this functionality.
Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
NuGet BaseConnectionLibrary for database connections.
Saturday, September 12, 2020 11:51 AM