Board index » delphi » How to use the optimistic locking in msaccess 97
David Ting
![]() Delphi Developer |
Thu, 08 Mar 2001 03:00:00 GMT
|
David Ting
![]() Delphi Developer |
Thu, 08 Mar 2001 03:00:00 GMT
How to use the optimistic locking in msaccess 97
Hello,
I am using the BDE5.0 and msaccess 97, but I found a problem: I have 2 workstations running the same application, when station 1 call the method: Table1.Edit, it will not lock the record (in paradox, it will), this makes the station 2 can also edit the same record, and then when Table1.Post is called, the BDE will not detect the record has been modified by another user, how can I prevent it? thank you very much! David Ting |
Team
![]() Delphi Developer |
Thu, 08 Mar 2001 03:00:00 GMT
Re:How to use the optimistic locking in msaccess 97The BDE has a problem dealing with Access' optimistic locking scheme which is cause by a problem in Microsoft's DAO. As you have discovered, the native driver does not give you an error if another user posts a change to the record you are editing before you post. The only solution I have found is to save the record in memory (I use a variant array) then reread the record when I am ready to post and see if it has changed. -- |
Ernie Dee
![]() Delphi Developer |
Fri, 09 Mar 2001 03:00:00 GMT
Re:How to use the optimistic locking in msaccess 97QuoteBill Todd (TeamB) wrote in message Quote>The BDE has a problem dealing with Access' optimistic locking case. -- Opportunistic locking on Windows NT fails to resolve caching Server: EnableOplocks REG_DWORD 0 or 1 Default: 1 (TRUE) Workstation: UseOpportunisticLocking REG_DWORD 0 or 1 Default: 1 (TRUE) PLEASE SET THESE VALUES TO 0 (FALSE). If this key does not exist, |
Brian Bushay Tea
![]() Delphi Developer |
Sat, 10 Mar 2001 03:00:00 GMT
Re:How to use the optimistic locking in msaccess 97Quote> I am using the BDE5.0 and msaccess 97, but I found a problem: edit it like a Paradox table does. That you do not get modified that the record has been changed is a short coming of the BDE Access driver. -- |
Grant Walke
![]() Delphi Developer |
Sun, 11 Mar 2001 03:00:00 GMT
Re:How to use the optimistic locking in msaccess 97Quote>> I am using the BDE5.0 and msaccess 97 records changed by another user. I don't have sample code on hand but I carefully verified this some time ago. You have to open the recordset with the appropriate flags (as per DAO35.HLP), but after two users edit an optimistically- locked recordset and modify the field values, the first one to update succeeds while the second *does* raise an exeption. The design of the BDE and/or VCL databound controls may make the native driver's locking problem difficult to resolve, but it's an Inprise issue *not* a limitation of DAO. Jet 3.5 isn't perfect but it's one of the most widely used and When it began as the Paradox Engine the BDE did a good job. If you want to use the BDE for a local or fileserver database then If you want to use Access 97 then get one of the BDE alternatives. It's hard to understand why Inprise didn't simply buy a product outright I wouldn't rely on a driver that has buggy behaviour on something so Good luck whatever you decide. |
1. Locking Record On Ms Access 97 In MSACCESS (DAO)
2. Locking problem woth MsAccess 97, Delphi5.01 and BDE 5.11
3. connect to an Access 97 database using the BDE and native MSACCESS
4. Conversion Problem MSAccess 97 -> MSAccess 2000
5. Error in using the ODBC driver of MSAccess 97 with Delphj 3 c/s
6. Problems distributing App using MSAccess 97 native drivers
7. Delphi 4 MsAccess 97 driver and Office 97 SR2
8. Dephi 3, Word 97, OLE & MSACCESS 97