I am rewriting my software using the database class in Fivewin and when testing
found that records were not unlocked.
Using a MDI environment - open job window enter new job and save ( leave this window open) ,
open an invoice window type in job that was just entered - using a valid clause th chcek that the user
enters a valid job returns an invalid job - but if after my save method I add and unlock it works properly.
eg oJb:save()
oJb:unlock()
- Code: Select all Expand view
METHOD Save() CLASS TDataBase
local n
local lLocked := .f.
if ::lBuffer
if ! ::Eof() .and. ! ::lReadOnly
if ::lShared
if ::IsRecLocked( ::RecNo() ) .or. ( lLocked := ::RecLock( ::RecNo() ) )
::SaveBuff()
if lLocked
::Commit()
::RecUnLock( ::RecNo() )
else
MsgInfo('not locked') ********
endif
else
if ! Empty( ::bNetError )
return Eval( ::bNetError, Self )
else
MsgAlert( "Record in use", "Please, retry" )
endif
endif
else
::SaveBuff()
endif
endif
endif
return nil
//----------------------------------------------------------------------------//
I am using FWH 9/12 , xHarbour 1.2.1 Rev 6406
Cheers
Colin