Given that neither DAO nor ADO coding has fully addressed the need that I have of when a user can go into edit mode, I have decided to use ADO coding with the Optimitic setting on it, and setup a central table to keep track of when users goes into edit mode on what records of what tables. However, this gets into concurrent user issues and one of such issues that I'm having to deal with is how to account for when the client side of the connection loses it's connection. I don't want to have a record be kept locked out due to a situation like that.
Here's the general steps that I would have the code do:
When user enters the form, an ADO recordset is created. On a timed based, the recordset is updated given the best cursor type that I can use is Keyset, and that doesn't allow for viewing new records, so the recordset would need to be refreshed either on a timed basis or when the user types in the ID number of the record, which I will probably go with the later option the majority of the time. At this point, the user is still in Read Only mode (at least, this is how I would like to have it setup as), but the moment the user starts changing information on the form other than the ID number of the record, that's when I would like to allow the user go into Edit mode provided the following 2 requirements are met:
User has the permission to edit the record
There are no other users currently editing the record.
Purpose for this:
I would like to allow 2 or more users that DOES have the permission to change such records to also be able to at least view the records, but only 1 of them to only be able to edit the record, ideally the one that begins to edit the record first. Under the current ADO coding, the first person to get to the record is the one that has the edit mode locked if the recordset is NOT set as Read Only, when in theory, the first user may only be viewing the information at that point of time, and then a second user also looks up the record, finds that it needs an adjustment, and would like to change it, but if it attempts to, under ADO coding, the second user can't unless the recordset is set to Optimistic, but then other issues can be presented.
The issue I'm faced with is how I'm going to have the code control who gets the edit mode, most of which I have already addressed in the planning stage, but the connection issue, I would like to allow for the program to determine when a user that's in edit or add new record mode has lost the connected unexpectedly without first completing the transaction, so as to remove the lock on the record that's being edited or to remove the new record entry. How can this be best achieved or how can one tell when a user has lost it's connection to the BE DB?
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
When the going gets tough, the tough gets going.
Here's the general steps that I would have the code do:
When user enters the form, an ADO recordset is created. On a timed based, the recordset is updated given the best cursor type that I can use is Keyset, and that doesn't allow for viewing new records, so the recordset would need to be refreshed either on a timed basis or when the user types in the ID number of the record, which I will probably go with the later option the majority of the time. At this point, the user is still in Read Only mode (at least, this is how I would like to have it setup as), but the moment the user starts changing information on the form other than the ID number of the record, that's when I would like to allow the user go into Edit mode provided the following 2 requirements are met:
User has the permission to edit the record
There are no other users currently editing the record.
Purpose for this:
I would like to allow 2 or more users that DOES have the permission to change such records to also be able to at least view the records, but only 1 of them to only be able to edit the record, ideally the one that begins to edit the record first. Under the current ADO coding, the first person to get to the record is the one that has the edit mode locked if the recordset is NOT set as Read Only, when in theory, the first user may only be viewing the information at that point of time, and then a second user also looks up the record, finds that it needs an adjustment, and would like to change it, but if it attempts to, under ADO coding, the second user can't unless the recordset is set to Optimistic, but then other issues can be presented.
The issue I'm faced with is how I'm going to have the code control who gets the edit mode, most of which I have already addressed in the planning stage, but the connection issue, I would like to allow for the program to determine when a user that's in edit or add new record mode has lost the connected unexpectedly without first completing the transaction, so as to remove the lock on the record that's being edited or to remove the new record entry. How can this be best achieved or how can one tell when a user has lost it's connection to the BE DB?
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
When the going gets tough, the tough gets going.