主题:退出程序问题
多用户退出程序:
DO WHILE TXNLEVEL()>0 &&脱离其他事务处理
ROLLBACK
ENDDO
SELECT tblOperator
LOCATE FOR ALLTRIM(opname)=cnowoperatorname
IF FOUND() &&操作员离线
REPLACE Onlinetime WITH DATETIME(),Isonline WITH "离线"
ENDIF
COUNT TO nOnline FOR IsOnline="在线"
IF nOnline=0 &&所有操作员都已经离线,开始清理数据库
CLOSE DATABASES ALL &&关闭所有数据库
*!* 重新以独占方式打开表,清理带有删除标记的记录
USE tblcby EXCLUSIVE
PACK
USE tbloperator EXCLUSIVE
PACK
USE tbljf EXCLUSIVE
PACK
USE tbluser EXCLUSIVE
PACK
USE tbluserye EXCLUSIVE
PACK
USE tblsysf EXCLUSIVE
PACK
USE tbldwmc EXCLUSIVE
PACK
USE tblsblr EXCLUSIVE
PACK
USE tblny EXCLUSIVE
PACK
USE tbldz EXCLUSIVE
PACK
ENDIF
CLEAR EVENTS
QUIT
运行时出现错误:在当前工作区中没有打开的表
DO WHILE TXNLEVEL()>0 &&脱离其他事务处理
ROLLBACK
ENDDO
SELECT tblOperator
LOCATE FOR ALLTRIM(opname)=cnowoperatorname
IF FOUND() &&操作员离线
REPLACE Onlinetime WITH DATETIME(),Isonline WITH "离线"
ENDIF
COUNT TO nOnline FOR IsOnline="在线"
IF nOnline=0 &&所有操作员都已经离线,开始清理数据库
CLOSE DATABASES ALL &&关闭所有数据库
*!* 重新以独占方式打开表,清理带有删除标记的记录
USE tblcby EXCLUSIVE
PACK
USE tbloperator EXCLUSIVE
PACK
USE tbljf EXCLUSIVE
PACK
USE tbluser EXCLUSIVE
PACK
USE tbluserye EXCLUSIVE
PACK
USE tblsysf EXCLUSIVE
PACK
USE tbldwmc EXCLUSIVE
PACK
USE tblsblr EXCLUSIVE
PACK
USE tblny EXCLUSIVE
PACK
USE tbldz EXCLUSIVE
PACK
ENDIF
CLEAR EVENTS
QUIT
运行时出现错误:在当前工作区中没有打开的表