Board index » delphi » Locking records. D5 + Access2000

Locking records. D5 + Access2000

Hello,

I was hoping to find some information here about locking records in
Access2000. I have a multi-user application and so far all table
operations seem to be going okay. No fancy stuff just simple Ttable and
Tquery's using your every day SQL.

The application is not written using ADO (unfortunatly), and users can
add/update/retrieve and delete records from the GUI. I'm no database
guru and i barely managed to get this DB up and running, so please keep
that in mind here.

Ok here goes.. I've got a few questions about how to implement proper
locking :

- Access 2000 is page-locking right ? meaning if I lock anything I end
up locking not just 1 record but multiple? how many exaclty ?
- I assume that I can use .LOCK method as described in the Delphi Help
allthough the help only mentions Paradox and dBase ? If not, then how
would I be implementing locking ?
- How should I use locking ? at every database-read, or database-write
or just before deleting records ??
- I've read a few posts about locking and it looks to me there are a few
different types of locking, where can i find some information about that
?

Any pointers to locking records (in general) would be appreciated.

Cheers,
Tamerius Cohen.

 

Re:Locking records. D5 + Access2000


1. Locks are set on 1 Kb pages. Devide this by the record size and you get
the number of records locked simultatiously.
2/3/4. The MS Access database driver takes care of all record locks. You
don't need to do anything (just be aware that operations might fail due to
record locks set by other users).

"Tamerius Cohen" <t.co...@facburfdew.unimaas.nl> schreef in bericht
news:39168F6D.2EDAC2B6@facburfdew.unimaas.nl...

Quote
> Hello,

> I was hoping to find some information here about locking records in
> Access2000. I have a multi-user application and so far all table
> operations seem to be going okay. No fancy stuff just simple Ttable and
> Tquery's using your every day SQL.

> The application is not written using ADO (unfortunatly), and users can
> add/update/retrieve and delete records from the GUI. I'm no database
> guru and i barely managed to get this DB up and running, so please keep
> that in mind here.

> Ok here goes.. I've got a few questions about how to implement proper
> locking :

> - Access 2000 is page-locking right ? meaning if I lock anything I end
> up locking not just 1 record but multiple? how many exaclty ?
> - I assume that I can use .LOCK method as described in the Delphi Help
> allthough the help only mentions Paradox and dBase ? If not, then how
> would I be implementing locking ?
> - How should I use locking ? at every database-read, or database-write
> or just before deleting records ??
> - I've read a few posts about locking and it looks to me there are a few
> different types of locking, where can i find some information about that
> ?

> Any pointers to locking records (in general) would be appreciated.

> Cheers,
> Tamerius Cohen.

Re:Locking records. D5 + Access2000


Like all SQL databases, MS-Access does not allow you to lock individual
records; it does all locking operations for you, implicitly, based on
the SQL you issue and the transactions (and the transaction
isolation-level options you have specified). Transactions can be issued
implicitly or explicitly.

When Access does lock things, it does so on a "page" basis.  Every page
in an Access database is 2K in size and it has one or more records in
it.  

The JET Technical Reference, which is available in printed or electronic
form (for $$) from Microsoft, is actually a very well-written and
informative book.  It explains the locking in great detail; it also
spells out a lot of what the designers were thinking when they set out
to create a fully SQL-compliant fileserver based database-engine on a
rather small (16-bit) desktop machine... and did it.

Quote
>Tamerius Cohen wrote:

> Hello,

> I was hoping to find some information here about locking records in
> Access2000. I have a multi-user application and so far all table
> operations seem to be going okay. No fancy stuff just simple Ttable and
> Tquery's using your every day SQL.

> The application is not written using ADO (unfortunatly), and users can
> add/update/retrieve and delete records from the GUI. I'm no database
> guru and i barely managed to get this DB up and running, so please keep
> that in mind here.

> Ok here goes.. I've got a few questions about how to implement proper
> locking :

> - Access 2000 is page-locking right ? meaning if I lock anything I end
> up locking not just 1 record but multiple? how many exaclty ?
> - I assume that I can use .LOCK method as described in the Delphi Help
> allthough the help only mentions Paradox and dBase ? If not, then how
> would I be implementing locking ?
> - How should I use locking ? at every database-read, or database-write
> or just before deleting records ??
> - I've read a few posts about locking and it looks to me there are a few
> different types of locking, where can i find some information about that
> ?

------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
mailto:i...@sundialservices.com  (PGP public key available.)

- Show quoted text -

Quote
> Fast(!), automatic table-repair with two clicks of the mouse!
> ChimneySweep(R):  "Click click, it's fixed!" {tm}
> http://www.sundialservices.com/products/chimneysweep

Other Threads