Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lock only one record

Status
Not open for further replies.

poliv

Programmer
Jun 3, 2000
48
US
I have a problem in locking records.
Example:

Table XPTO
Cod Name
Rec1 -> 1 AAAAAA
Rec2 -> 2 BBBBBBB
Rec3 -> 3 CCCCCCC

When the user A edit the Rec1, all the records are locked (except the Rec1 for the user A), and if the user B attempt to edit the Rec2 he can not do it because all the records are lock.
What I want is to lock only the record that is edited and not all the records in the table, to permit the two users to edit two different records at the same time.
I already try all the options in locking records (in the forms and in the tools/options menu), but without success.

Thanks
 
It doesn't work that way. Access locks records in what are called "Pages". A page is actually 2k worth of data. This could be 1 record, or it could be 5 records depending upon how wide your table is. When the record is locked, it locks ALL the records that are contained in that PAGE, thus rendering the records uneditable until the lock releases.

Hope this helps. Jim Lunde
compugeeks@hotmail.com
Custom Application Development
 
Access 2000 introduces record level locking. Keep in mind, though, that record level locking can create more overhead on the lock file and the network.

Here's a tricky alternative for small databases. Add Dummy text fields to your table, and fill them with spaces to make the record about 2000 bytes in size. Access will still lock pages, but now a page only holds one record. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top