to perform some operations the administrator needs exclusivity, so you should check if a user is online and / or the archives are open.
Does anyone have any idea how to go about doing these checks
Pls, a small sample to init
METHOD PC_erfassen() CLASS TAllgemein
local lapped := .t.
*----------------------------------------------------------
//hier werden alle WINHOTEL.exen registriert
if file( Setup():Daten() + "dataallg\PCS.dbf" )= .F.
DbCreate( Setup():Daten() + "dataallg\PCS.dbf",;
{{"SERIALNR" , "C", 20, 0} ,;
{"BIOSDATE" , "C", 10, 0} ,;
{"COMPUTER" , "C", 5, 0} ,;
{"SPERRE" , "C", 20, 0} ,;
{"APPPATH" , "C", 20, 0} ,;
{"DATENVERZ" , "C", 20, 0} ,;
{"DATUM" , "D", 8, 0} ,;
{"ZEIT" , "C", 10, 0} })
endif
use ( Setup():Daten() + "dataallg\" + "PCS") NEW
go top
do while .not. eof()
if (Upper(ALLTRIM(PCS->SERIALNR)) = Setup():cSerialHD) .and. (PCS->BiosDate = Setup():cBiosDate) .and.;
( Upper(ALLTRIM(PCS->AppPath)) = Upper(ALLTRIM( Setup():AppPath )) )
lapped := .f.
exit
endif
select PCS
skip
enddo
if lapped = .t.
select PCS
append_blank()
endif
if len(ALLTRIM(PCS->sperre)) > 0
MetroMsgInfo( "Infobox","Arbeitsstation gesperrt wg. " + PCS->sperre )
return (.F.)
endif
IF rlock()
PCS->SERIALNR := Setup():cSerialHD
PCS->computer := Setup():cComputerNr
PCS->BiosDate := Setup():cBiosDate
PCS->AppPath := Setup():AppPath
PCS->datenverz := Setup():DATEN
PCS->DATUM := date()
PCS->zeit := time()
// commit
else
return (.F.)
endif
select PCS
use
RETURN (.T.)
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Marc Venken, nageswaragunupudi and 65 guests