473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Record Locking Dilemma

110 100+
Hello once again -

I have a table - tblPurchaseOrders.

When I access/dirty a record from tblPurchaseOrders via my form, frmPurchaseOrers, MS Access is locking 5 or 6 records in the vicinity of the record being edited. (If I open the tables and use the keys to move through records, I am getting a circle with a line through it for six records -- I am the only user in the system when this is happening). Sometimes, 6 records are affected, sometimes only 2.

I'm using MS Access 2013. I have the form Record Locks set to 'Edited Record'

I'm attaching a snapshot of the advanced settings from the Access Options - Client Settings, Advanced screen.

This issue is wreaking unpredictable havoc in a system of mine - any assistance would be greatly appreciated.

Thank you.

Gunner

Attached Images
File Type: png Record Locks.png (17.1 KB, 9683 views)
Apr 17 '14 #1
13 17923
NeoPa
32,556 Expert Mod 16PB
Sorry Gunner. That's about as precise as you get I'm pretty sure. I certainly would have expected record locks to be single records with record level locking, but it seems to be not so from your description :-(
Apr 17 '14 #2
dgunner71
110 100+
NeoPa,

Thanks for your reply. I did read that the advanced settings screen above is only for newly created forms, but as I noted, this form is indeed set to Edited Record.

If I set the form to 'No Locks', this appears to alleviates the situation. I am using a field called [txtRecordOpenStatus] that is updated in the OnLoad Event to 'Open - UserID'. If a user tries to open the record, the user is informed that UserID has the record open. I guess I can fall back on this solution (i.e. No Locks) but I rather not - I've always read that it is bad.

Any additional advice on this or on using 'No Locks' would be greatly appreciated.

Kind regards.

Gunner
Apr 17 '14 #3
dgunner71
110 100+
As an update, msdn.microsoft notes the following:


Edited Record (2) Property Setting -

(Forms and queries only) A page of records is locked as soon as any user starts editing any field in the record and stays locked until the user moves to another record. Consequently, a record can be edited by only one user at a time. This is also called "pessimistic" locking.

Does anyone have any idea what a 'Page of Records' entails?

Thanks in advance for any insight.

Kind regards.

Gunner
Apr 17 '14 #4
dgunner71
110 100+
A few more pieces of this 'puzzle':

This is the exact issue I'm referring to - When I open a record, several of the neighboring records are locked along with the edited record. It seems like if I open a record in the middle of a table, 6 (seems to always be 6) records are locked. If I open the last record in the table, it seems like only 2 records are locked.
http://www.access-programmers.co.uk/...d.php?t=115666


Regarding the size of a page (this was related to SQL Server, but... from StackOverflow)

Page Lock

A page lock in SQL Server will lock 8K worth of data even when your query only needs 10 bytes from the page. So your query will lock additional data which you do not request in your query.

Have a good evening.

Gunner
Apr 17 '14 #5
zmbd
5,501 Expert Mod 4TB
----------
help access run faster (acc2007)
change the page-level or record-level locking setting
access locks a certain amount of data while you edit records. The amount of data that is locked depends on the locking setting that you choose. You can help improve performance by choosing page-level locking. However, page-level locking may decrease data availability, because more data is locked than with record-level locking.

Page-level locking access locks the page that contains the record (the page is the area of memory where the record is located). Editing a record with page-level locking enabled might also cause other records stored nearby in memory to be locked. However, performance is generally faster when you use page-level locking instead of record-level locking.
Record-level locking access locks only the record that is being edited. Other records are not affected.
Change the page-level or record-level locking setting

1.open the database that you want to adjust.
2.click the microsoft office button , and then click access options.
3.in the left pane, click advanced.
4.in the right pane, in the advanced section, select or clear the open databases by using record-level locking check box.
Choose an appropriate record-locking setting
access locks records while you edit them. The number of records that access locks and the amount of time those records are locked depends on the record-locking setting that you choose.

No locks access doesn't lock a record or page until a user saves changes to it, which results in data being more readily available. However, data conflicts (simultaneous changes being made to the same record) can occur if you use this setting. When a data conflict occurs, the user must decide which version of the data to keep. This is generally the fastest option, but data conflicts may outweigh the performance gain.
Edited record access locks a record as soon as a user begins to edit it. As a result, records are locked for longer periods of time, but data conflicts are less likely.
All records access locks all the records in a table while any form or datasheet that uses that table is open. This can improve performance for the user who is editing data in the table, but it restricts other users' ability to edit data more than the other options do.
Change the record-locking setting

1.open the database that you want to adjust.
2.click the microsoft office button , and then click access options.
3.in the left pane, click advanced.
4.in the right pane, in the advanced section, under default record locking, click the option that you want.
----------
Apr 17 '14 #6
NeoPa
32,556 Expert Mod 16PB
I guess you should now have a better understanding of all the issues Gunner.

Z's last post expresses exactly what I was thinking. I would have expected multiple records to be locked, when you choose to lock just the edited record, only when the DB is opened with record-level locking cleared. As your graphic indicates this not to be the case I'm frankly confused.

While queries and forms can make their own locking settings as far as All / None / Record is concerned, I'm not aware they can choose to use non record-level for a database where that is set - which appears to be indicated here from your description.
Apr 17 '14 #7
dgunner71
110 100+
Thanks for your replies, NeoPa and ZMBD.

That article was a great insight and, as NeoPa notes, highlights the crux of my dilemma. MS Access 2013 Record-level locking does not seem to be working (i.e. irrespective of the setting, multiple records are locked when editing a record).

I tried the following last night:
Unchecking record level locking. (same result)
Basing the form on a query. (same result)
Opening MS Access and navigating to the file and opening. (based on another article - same result)
Setting the form to 'No Locks'. (fixes issue but less than ideal solution)
Running the db on a different computer. (same result)

I'll keep searching for a solution and update this post if I find something.

Thanks again to all!

Gunner
Apr 17 '14 #8
NeoPa
32,556 Expert Mod 16PB
From the 2010 help page :
Access 2010 Help:

Open databases by using record-level locking

Makes record-level locking the default for the currently open database. Clearing this check box makes page-level locking the default for the open database. The choice you make applies to data in forms, datasheets, and code that uses a recordset object to loop through records. This option does not apply to action queries or code that performs bulk operations by using SQL statements.
I believe this explains why some situations lock more records than expected, though in my testing I've still found multiple records locked even after closing and re-opening the database after this was set to True and dirtying a single record on a form.
Jan 7 '16 #9
NeoPa
32,556 Expert Mod 16PB
Actually, I think the following page (Jet 4.0 Row-Level Locking Is Not Available with DAO 3.60) explains the real problem better. It simply doesn't work in most cases.

The link also provides a work-around with some sample code if you believe it's important to have this for your project. It's what i'll be working on for one of my projects very shortly as it happens.
Jan 8 '16 #10
dgunner71
110 100+
I'm under the impression that setting this master-level function only applies to newly created objects and can simply be over-ridden in the properties.

I have given up on finding a solution to this and have chalked this up (as NeoPa notes) to a Jet issue (which exceeds my knowledge by leaps). I appreciate the feedback / insight, though.

Gunner
Jan 8 '16 #11
NeoPa
32,556 Expert Mod 16PB
DGunner71:
I'm under the impression that setting this master-level function only applies to newly created objects and can simply be over-ridden in the properties.
This is true for the Default record locking part certainly. Only that part though.
DGunner71:
I have given up on finding a solution to this and have chalked this up (as NeoPa notes) to a Jet issue
There is a solution, and I intend to work on one for my own project, but it couldn't be said to be straightforward. I may post something later to help others in similar positions but it certainly won't be for everyone.
Jan 9 '16 #12
CRSjim
1
Having only 10 people adding and updating data from an MsAccess 2003 (or 2007) form, we get record locks on not only new records but changing old records (that aren't near each other)!
Only solution found was to turn off Record Locking on the form properties and like magic - no more locked forms due to record locking! Hope that helps a few people out there (not ideal but Access does pop up a message on "real" same-record locking).
May 27 '16 #13
NeoPa
32,556 Expert Mod 16PB
According to the link from my post #10, Access 2007, which uses ACE instead of Jet, has the later version of DAO by reason of that being inbuilt in ACE.

According to that logic, I would expect Access 2007 to work as expected as long as the options are correctly set.

By following the advice in that article I was able to get working record-level locking in Access 2003 - even though it uses DAO 3.60. The work-around is explained in the article and uses ADODB. Checking is not too straightforward as whoever opens the database first sets the option for all others.

I suggest you read the linked article carefully before determining it isn't working for you. It certainly did for me when it was set up correctly and all circumstances were taken into consideration as explained in the article.
May 28 '16 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ryan | last post by:
I have a problem with record locking / blocking within an application. The app is quite straight forward. Written in Delphi 5 using BDE to access a SQL 7 database (Win2K server). Every so often...
0
by: Megan | last post by:
Hi- I have a question about the Microsoft Access Record-Locking Information Icon. Whenever I, or my friends, open my MS Access database, the Microsoft Access Record-Locking Information Icon...
0
by: ethanj /personal/ | last post by:
We are using Access 2000 database, with the following settings. Tool > Options > Advance > Default Record Locking = Edited Record Open databases using record level locking = True Form...
1
by: Simon | last post by:
Dear reader, In case I work with two Forms and using the same Table but with other fields in the Forms, I have the following experience. After I change in one of the two Forms a field I can't...
0
by: swapna_munukoti | last post by:
Hi all, I have seen in so many articles that record locking is not possible in MS-Access, but we can achieve it by making the size of each record to 1024 bytes(Let us say this is the record...
5
by: swapna_munukoti | last post by:
Hi all, Is there any tool to achieve record locking in MS Access 2000. Thanks, Swapna.
9
by: master | last post by:
Actually, it is not only the record locking, what I need, and nobody seems to descibe this. Imagine the following scenario. There is a database with, say 10000 records with some unvalidated...
0
by: Cindy Huyser | last post by:
I have an Access 2000 database behind a threaded Java application that that can have have concurrent access to the same table (but not the same record). The database is set up for shared access...
3
by: kstevens | last post by:
I have turned on record locking do to the fact that we are starting to have issues with the records not being locked. I have a button on a form that changes the recordsource of the form. When i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.