Click here to Skip to main content
15,886,873 members

Locking concept when multiple users access .mdb file using winforms

Member 12296654 asked:

Open original thread
Hello,

I have table in .mdb file (say TVehicle) where it contains 'ID', 'make', 'model', 'series' columns with around 50-100 records. There is a Winform tool which fetches these data and show the rows in UI. Now one user (say U1) access these records & selects a vehicle (row from grid) and tries to edit the veihcle. Now when another user U2 tries to edit same vehicle, the user must get notification that user U1 is already engaged with the vehicle you selected so please wait until U1 releases. I need some good logic for locking the rows when a specific user edits the row. (I open a new winform dialog when user double clicks the row in grid for edit). Please help me on this.

What I have tried:

I created another table TUser, when U1 edits the row, the data like Vehicle-ID, user-ID will be inserted into TUser table and the vehicle is locked. When user finishes edit & saves the record, the entry in TUser will be deleted.
Tags: C#, Microsoft Access

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900