Click to See Complete Forum and Search --> : Preventing Multi-User Conflict in DBGrid


daneb
August 9th, 2001, 08:22 PM
Hi.

I have a DBGrid which displays data from an Access 97 table through a Data Control. Our app is a multi-user system, therefore, it is expected that data in this grid may be modified by more than one user. The problem is how to detect that a user is editing a particular record on the grid, so that overwriting doesn't occur in case another user edits and updates the same record. I noticed that once you "get out" of a particular row on the grid, whatever changes you made in the data in that row will be automatically saved in the database. So, what DBGrid event or Data Control event will I use to know if a row is being edited to prevent multi-user update conflict?

Thanks for the info in advance!

bill brave
August 10th, 2001, 02:53 AM
I understood that you would like to know how to lock record in Ms Access Database (to prevent other to make change) when you are editing record ?

I think about using DAO to lock DB when keypress on DBGrid and after updating, unlock record for other make change.

Let me know your idea.

daneb
August 10th, 2001, 03:26 AM
That exactly is my problem in using DBGrid -- how to detect when the database is being edited/updated by a user. As I've said, the moment you leave the current row you are in and go to another, whatever changes you made to that row will be saved automatically in the database. Unlike in other data entry forms where you have to click on a button (such as Add or Update to add or save your edited info) so that you will know when to lock/unlock your record, in the DBGrid, it's more complex. What DBGrid (or maybe Data Control) event will I use to precisely detect this action so that I will know when to lock/unlock records, or when is a particular record being edited or deleted? How can I also make sure that what is displayed on the DBGrid screen is always the latest data?