User check if an record from a table is locked by other user ar run time

User check if an record from a table is locked by other user ar run time

Post by Adrian Tudorach » Thu, 26 Jul 2001 18:50:02



Hi,

I'm trying to find a dynamic solution for the following
problem:
- User A opens one record R from table T
- User A locks the record R (How?)
- User B opens records from table T without problem
- If User B tries to open the record R from table T, the
application sees that the record is locked and gives an
error message.

P.S. I know the solution with the extra flag, which is set
by the user A in the moment he opens the record. Im
interested in a solution that unlocks the record
automatically also in the case of database or application
crash.

Thank you in advance,
Ai Tudorache

 
 
 

User check if an record from a table is locked by other user ar run time

Post by Umachandar Jayachandra » Tue, 31 Jul 2001 02:20:38


    If you are on SQL 2000, you can use the new application locking system
procedures "sp_getapplock" & "sp_releaseapplock" to perform your own
locking. This uses the SQL Server locking mechanisms.

--
Umachandar Jayachandran
SQL Resources at http://www.umachandar.com/resources.htm
( Please reply only to newsgroup. )

 
 
 

1. Jet record locked by another user (only one user)

I'm using MFC DAO 3.5 with Visual C++. I'm getting a randomly occurring
error from Jet that says it "Couldn't update; currently locked by user
"admin" on machine "machine" " (error 3260).

How can the record be locked if I'm the only user, I only lock 1 record at a
time, and I only lock it for a fraction of a time?

I never leave any records in an editing state. The user makes their changes
at once to a local object not the recordset directly, then I call a Save
function of mine (not DAO). This Save calls Edit(), writes the entire
record, then calls Update() (if an exception is thrown I call CancelUpdate
instead). Any of my records are only in edit mode for a fraction of a second
by design.

Only one app is using the database at a time, sometimes the database is
opened exclusively.

Has anybody heard of this before? It sounds like a bug in Jet 3.5 to me.

Mike Hunsicker

2. Any other method to copy database? I am stuck!

3. Letting the user customize reports by filtering records and setting sorting/grouping levels at run time

4. Accessing Indexes with DAO

5. Using date format in Oracle??

6. How can I Lock a table to one user at the time

7. Question about the RecordCount property

8. Record user ID and time into table

9. 50 users running Access, am I crazy.

10. How to check access rights for an user to run stored procedure

11. Fonts in Crystal ar run time

12. pdox 3.5 forms app was single user, now want to run concurrent users