UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> i need some help with recording locking?    
 
   
dunn0s3
post Oct 21 2005, 06:02 AM
Post #1

UtterAccess Enthusiast
Posts: 77



Hi all im havin some trouble setting my record locking getting it excalty how i want it, first of all my database is split with the backend on a local server and front end on users pc, and the record locking options is set up as edited record and with the built in access security setup

my first question is how can i show which user has a record open/locked? i found a function on here which tells me weather the record is locked or not like this below. although this just tells me that the record is locked if it is being editeded

is there some way i can set some thing up so as soon as a record is opened it is locked? and when someone attemptes to open that record it tells them the recod is locked and which user it is locked by? (although still allow them to view the record)


Function RecordLocked(rst As Recordset) As Boolean
Dim blnLock As Boolean
On Error GoTo ErrorHandler
' Save current value of LockEdits property.
blnLock = rst.LockEdits
' Set pessimistic locking.
rst.LockEdits = True
' Try to edit the record. This generates error 3197 if the
' record is locked.
rst.Edit
RecordLocked = False
rst.CancelUpdate
' Restore original value of LockEdits property.
rst.LockEdits = blnLock
Exit Function
ErrorHandler:
Select Case Err
Case 3197
Resume Next
Case Else
RecordLocked = True
Resume Next
Exit Function
End Select
End Function


thanks
Go to the top of the page
 
+
HiTechCoach
post Oct 23 2005, 03:23 AM
Post #2

UtterAccess VIP
Posts: 18,396
From: Oklahoma City, Oklahoma



QUOTE
is there some way i can set some thing up so as soon as a record is opened it is locked?

Why do you need to do this?
How can a user just view a record without locking it?
Go to the top of the page
 
+
dunn0s3
post Oct 23 2005, 01:10 PM
Post #3

UtterAccess Enthusiast
Posts: 77



Hi

currently if a user opens a record and is just viewing the data ( hasnt changed anything) then the record remains unlocked another user can open the same record and start editing it while the other user is in the record

i was looking for a way of informing users that another user has the record open and tell them which user that is by showing the login name?
Go to the top of the page
 
+
HiTechCoach
post Oct 23 2005, 08:28 PM
Post #4

UtterAccess VIP
Posts: 18,396
From: Oklahoma City, Oklahoma



Welcome to the issues of creating a multiple user app.

It is possible to informing users that another user (<b>or multiple users viewing</b>) has the record open and tell them which user that is by showing the login name. It will probably add a lot of overhead to the form and really slow things done.

What benefit will informing users that another user has the record open and tell them which user that is by showing the login name?
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 07:36 PM