E Obsolete Database Utilities
WRITE DBPASSWORD root file spec, maintenance word; string array variable
The string must contain at least 31 elements, with a dimensioned length of a least eight characters. The string in the first element becomes the password for user-class number 1; the second string becomes the password for user-class number 2; and so on. Passwords are between 0 through 8 characters and may be terminated by a space or semicolon. Longer strings are automatically truncated. If an element in the string array is null or if the first eight characters are blanks, the corresponding user-class number is not assigned a password.
Here is a program which lists, and then allows the user to change, passwords for a specified database:
10 OPTION BASE 1 20 ON HALT GOTO Exit 30 DIM Pass$(31)[8],File$[13],Maint$[8] 40 INTEGER Num,Unc 50 DISP " ",SPA(24); " EDIT DATABASE PASSWORD " 60 START: ! 70 ON ERROR GOTO Trapperr 80 CURSOR (1,20),UL(80),(1,21) !Draw prompt line. 90 INPUT "Enter root file name (and volume spec):";File$ 100 INPUT " Enter maintenance password:";Maint$[1;8] 110 CURSOR (1,21) 120 DISP " Reading passwords." 130 READ DBPASSWORD File$,Maint$;Pass$(*) 140 Disp_list: ! Display password list. 150 CURSOR (14,4) 160 DISP "User-class Numbers and Passwords on ";TRIM$(File$) ;"Database." 170 DISP 180 FOR num=1 TO 28 STEP 4 190 DISP SPA(6);Num;Pass$(Num),Num+1;Pass$(Num+1),Num+2, Pass$(Num+2),Num+3;Pass$(Num+3) 200 NEXT Num 210 DISP SPA(6);29;Pass$(29),30;Pass$(30),31;Pass$(31) 220 Edit: ! 230 CURSOR (1,21) 240 Ucn=0 250 INPUT " Enter password number to edit :";Ucn 260 IF NOT Ucn THEN Done ! Exit if no number entered. 270 IF (Ucn<1) OR (Ucn>31) THEN 240 ! Loop if ucn out of range. 280 EDIT "Edit password:",Pass$(Ucn)[1;8] 290 GOTO Disp_list ! Re-display passwordlist. 300 Done: ! Write passwords on root file. 310 CURSOR (1,21) 320 DISP "''Writing passwords." 330 WRITE PASSWORD File$,Maint$;Pass$(*) 340 Exit: ! 350 DISP " End of program." 360 STOP 370 Trapperr: ! 380 BEEP 390 CURSOR (1,19) ! Position cursor above line. 400 DISP "~" 410 SELECT ERRN 420 CASE 56 430 DISP "FILE NAME NOT FOUND. TRY AGAIN." 440 CASE 81 TO 99 450 DISP "FILE SYSTEM (DIRECTORY) PROBLEM";ERRN;"." 460 WAIT 2000 470 GOTO Exit 480 CASE 220 490 DISP "INCORRECT PASSWORD. TRY AGAIN." 500 CASE ELSE ! Display any other error here. 510 DISP ERRMS$ 520 WAIT 2000 530 GOTO Exit 540 END SELECT 550 WAIT 2000 560 DISP " " 570 GOTO Start 580 END