Hi Bill,
That's indeed what i taught. As a matter of fact it is what i am doing =
now with the existing application made in VB6 and access as backend.
The concept is not more than a master-detail concept. The mastertabel =
already contains a field called "Status" with 3 possibilitys. Lets call =
it "N" means NEW_editing_allowed, "V" means =
DONE_no_further_editing_allowed, "X" means =
EDITING_in_progress_by_another. That way i can block the records that =
should be left alone. So when a "A" is opened by someone, the Status =
will be changed to "X" and updated in the dB so no one else can open the =
same record. Works ok.
The details are made with a Flexgrid from ComponentOne bound to a recset =
with LockType =3D adLockBatchOptimistic. This way i can clear the =
numeric cells when the row only contains a remark. Wich by the grid will =
automatically translated to the dB as vbNull in the numeric field.
What i am doing for learning VS2005, is started the same project from =
scratch and with sqlServer So far all readonly datasets and sqlcommands =
works perfect but that particular piece gives me some headache =
concerning the binding grid-dataset-databasetable.
This project will never be released however, just for trying VS NET
Regards,
Jerome
"William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> schreef in bericht =
news:uN0RA56EGHA.1032@TK2MSFTNGP11.phx.gbl...
Jerome,
This is an involved (but not particularly complex) problem that =
we've written about for decades. There are several approaches that you =
can take and ADO.NET supports most of them. What you're describing is =
creating a pessimistic lock on a specific invoice. This can be done by =
using transaction isolation. However, in my books I describe a number of =
scenarios that don't use this approach--they design the system to =
prevent collisions in the first place. This means we don't permit two =
clerks to have access to the same customer at once. I describe this in =
detail in my old Hitchhiker's Guide books and in ADO and ADO.NET =
Examples and Best Practices.=20
--=20
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no =
rights.
__________________________________
[quoted text, click to view] "Jerome" <Jommeke@fake.com> wrote in message =
news:_lOvf.90604$fs4.6033515@phobos.telenet-ops.be...
>=20
> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> schreef in bericht=20
> news:e60T$SxEGHA.1240@TK2MSFTNGP09.phx.gbl...
>> Jerome,
>>
>> In my opinion is the first thing you have to investigate the =
Connected=20
>> (Ado) versus the Disconnected way of use (AdoNet), which gives you =
direct=20
>> diferences between pessimistic and optimistic concurrency.
>>
>> As a sample in this
>>
>> =
http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/cpguid=
e/html/cpconoptimisticconcurrency.asp
[quoted text, click to view] >>
>> I hope that this gives some ideas
>>
>> Cor
>>
> Hi Cor,
> Thanks for the link but i was already aware of that issue about =
locks.
> That's just one of the points! The record wich is actually on edit =
schould=20
> be locked to others.
> If someone is making an invoice, i certainly do not want others to =
work on=20
> the same one. Wich is now the
> case in NET as everyone has a copy of the same data on his pc, not =
knowing=20
> that others are perhaps already doing the same.
> On the other hand, there is no need to check wether the fields in =
the dB are=20
> old or modified a few nanoseconds before; Update/Insert/Delete means =
> update/insert/delete, unconditionaly and then requery the dB to have =
the new=20
> data to confirm.
>=20
> Regards and thanks for the thinking
> Jerome
>=20