ADO With Jet Provider, Multi User Hell, Please help 
Author Message
 ADO With Jet Provider, Multi User Hell, Please help

Please help before I go completely insane with this damn locking
issue:

I have been given the task of writing a simple multi user fault
logging application using the Jet engine OLEDB 4.0 provider for ADO
2.1.

The users have a VB6 client (running on NT4 SP5) which has a data
entry form where they can add and modify records. The users select
records from an ADO data grid, which is bound to an ADO data control,
also several textboxes are bound to this data control. The ADO data
controls record source is set in code to a client side ADO recordset.

My problem occurs when two or more users select the same record from
the data grid and modify data. If one user moves off the record (After
they have made their changes) the record is saved as expected. However
if another user also changes this record and saves it no error is
flagged to say the data has been changed (by the other user) and the
new changes are written to the database overwriting the original
changes! (most annoying)

Ideally what I would like to do is to exclusively lock the record when
the user selects it from the data grid, i.e. an error is raised when
someone else tries to modify it!

Looking at the MS VB help, it states that a client side Jet cursor
based recordset is opened as a keyset (ok) with optimistic locking
(not ok) Is there any way I can open a pessimistically locked cursor
using ADO with this provider?

Or does anyone have another solution I could try or an example multi
user MS Access DB with VB front end using ADO 2.1 which might be of
help?

Any information to point me in the right direction would be much
appreciated

Thanks


'Hotmail'

P.S. Don't ask me why my company wants to use ADO with Access, I'm
just a grunt and do what I'm told!



Wed, 11 Dec 2002 03:00:00 GMT  
 ADO With Jet Provider, Multi User Hell, Please help
Hi Jason, don't know if this will help. Rightly or wrongly, I get round this
problem by using an 'In Use By' field in the table. When the first user
selects the record, the field is filled with his name. When the second user
selects it, he is told that the record is in use (and by whom). It all only
takes a little extra code, and solves most of the problems you describe.
Quote:

>Please help before I go completely insane with this damn locking
>issue:

>I have been given the task of writing a simple multi user fault
>logging application using the Jet engine OLEDB 4.0 provider for ADO
>2.1.

>The users have a VB6 client (running on NT4 SP5) which has a data
>entry form where they can add and modify records. The users select
>records from an ADO data grid, which is bound to an ADO data control,
>also several textboxes are bound to this data control. The ADO data
>controls record source is set in code to a client side ADO recordset.

>My problem occurs when two or more users select the same record from
>the data grid and modify data. If one user moves off the record (After
>they have made their changes) the record is saved as expected. However
>if another user also changes this record and saves it no error is
>flagged to say the data has been changed (by the other user) and the
>new changes are written to the database overwriting the original
>changes! (most annoying)

>Ideally what I would like to do is to exclusively lock the record when
>the user selects it from the data grid, i.e. an error is raised when
>someone else tries to modify it!

>Looking at the MS VB help, it states that a client side Jet cursor
>based recordset is opened as a keyset (ok) with optimistic locking
>(not ok) Is there any way I can open a pessimistically locked cursor
>using ADO with this provider?

>Or does anyone have another solution I could try or an example multi
>user MS Access DB with VB front end using ADO 2.1 which might be of
>help?

>Any information to point me in the right direction would be much
>appreciated

>Thanks


>'Hotmail'

>P.S. Don't ask me why my company wants to use ADO with Access, I'm
>just a grunt and do what I'm told!



Wed, 11 Dec 2002 03:00:00 GMT  
 ADO With Jet Provider, Multi User Hell, Please help
in your ADO control's properties, change LockType to adLockPessimistic

Mr. X


Quote:
> Please help before I go completely insane with this damn locking
> issue:

> I have been given the task of writing a simple multi user fault
> logging application using the Jet engine OLEDB 4.0 provider for ADO
> 2.1.

> The users have a VB6 client (running on NT4 SP5) which has a data
> entry form where they can add and modify records. The users select
> records from an ADO data grid, which is bound to an ADO data control,
> also several textboxes are bound to this data control. The ADO data
> controls record source is set in code to a client side ADO recordset.

> My problem occurs when two or more users select the same record from
> the data grid and modify data. If one user moves off the record (After
> they have made their changes) the record is saved as expected. However
> if another user also changes this record and saves it no error is
> flagged to say the data has been changed (by the other user) and the
> new changes are written to the database overwriting the original
> changes! (most annoying)

> Ideally what I would like to do is to exclusively lock the record when
> the user selects it from the data grid, i.e. an error is raised when
> someone else tries to modify it!

> Looking at the MS VB help, it states that a client side Jet cursor
> based recordset is opened as a keyset (ok) with optimistic locking
> (not ok) Is there any way I can open a pessimistically locked cursor
> using ADO with this provider?

> Or does anyone have another solution I could try or an example multi
> user MS Access DB with VB front end using ADO 2.1 which might be of
> help?

> Any information to point me in the right direction would be much
> appreciated

> Thanks


> 'Hotmail'

> P.S. Don't ask me why my company wants to use ADO with Access, I'm
> just a grunt and do what I'm told!



Sun, 15 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Multi User database using MS Jet 4 and ADO

2. Multi User VB 6.0, ADO, Jet

3. ADO Provider Error ("Please Help")

4. Multi-user db access PLEASE HELP !

5. VB6 ADO, Jet "Error initializing provider"

6. VB6 ADO, Jet "Error initializing provider"

7. ADO Data Control fails to refresh with Jet 4.0 provider

8. Looking for Tables Relation using ADO with Jet provider

9. ADO 2.1, Jet 4.0 as a Provider ?

10. VB6 ADO, Jet "Error initializing provider"

11. DataGrid Control and ADO Jet 4.0 Provider

12. ADO using Jet provider for text files

 

 
Powered by phpBB® Forum Software