Consultor Eletrônico



Kbase P107441: 4GL code to generate script for disconnecting all database users
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   21/11/2008
Status: Verified

GOAL:

4GL code to generate script for disconnecting all database users

FACT(s) (Environment):

Windows NT 32 Intel/Windows 2000
Progress 9.x
OpenEdge 10.x

FIX:

DEF VAR i AS INT INITIAL 400 LABEL "Max numbers of users to disconnect" .
DEF VAR sdb AS CHAR INITIAL "sports" LABEL "Database Name" .
DEF VAR sbat AS CHAR INITIAL "disconall.bat" LABEL "Batchfile to run" .
UPDATE i.
UPDATE sdb.
UPDATE sbat.
OUTPUT TO VALUE(sbat) .
DO WHILE i > 0 .
i = i - 1.
PUT UNFORMATTED "call proshut " sdb " -C disconnect " STRING(i) SKIP.
END.
OUTPUT CLOSE.
MESSAGE "Please run " sbat " from proenv to disconnect the users from DATABASE " sdb view-as alert-box.


/* -------------------------------------------------------------------------------------------------------------------------------

NOTE:

The User account disconnecting database users is restricted under the following conditions and the code must be run by the user with the appropriate permissions to accomplish the desired results:

1. If the database owner, the account that created the database, has administrator/root permissions it can disconnect other users
in Promon or using proshut.
2. The account that started the database can also disconnect other users.
3. The administrator account in Windows can disconnect other users.
4. Users can disconnect themselves only.
-----------------------------------------------------------------------------------------------------------------------------------*/