Navigation:  Reference > Functions >

LockedUser()

Print this Topic Previous pageReturn to chapter overviewNext page

LOCKEDUSER(1)

PURPOSE

This function will return the Name of the user who has a file/record locked..

** NOTE : This Function will only work for Pervasive Version 8 or above.

PARTS

1. f/c/e Required: the File handle of the File that is locked.

 

RETURN TYPE -A

The Name of the User.

 

** NOTE: Error Code are Text and start with an ‘*’

*Invalid File Handle* = Indicate the file handle was not Valid

*File not open* = file not Open

*Not a Btrieve File* = the file was a CodeBase file.

*Requires New Version of Pervasive* = not Greater then or Equal to version 8

*File Not Locked* = File not locked.

*Error : XXX = Pervasive Error XXX

 

EXAMPLE

This Assumes that the file data_hndl with the key Field_two with record the number 50 is Locked by another user.

LockTestBtn.Click:

trap rlck gosub lock.test

findv m fnum data_hndl key FIELD_TWO value 50

trap rlck dflt

Ret

 

Lock.test:

if flerr(data_hndl)= 84 then Msg 'Record locked by User: '+ Lockeduser(data_hndl)

if flerr(data_hndl) = 85 then Msg 'file locked by User: '+ Lockeduser(data_hndl)

ret .false.

 


Page url: http://www.cassoftware.com/tas/manual/lockeduser.htm