home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
windows
/
sqllink.zip
/
UTIL.PRG
< prev
next >
Wrap
Text File
|
1990-08-09
|
3KB
|
172 lines
SET PROCEDURE TO ssldemo
SET PROCEDURE TO util
DECLARE fld[5]
DO CASE
CASE menu_v=1
DO ed_sql
CASE menu_v=2
DO show_mem
CASE menu_v=3
DO mem_used
CASE menu_v=5
CASE menu_v=6
CASE menu_v=7
ENDCASE
RETURN
*----------------------------------------
PROCEDURE ed_sql
SELECT 1
USE Sysparms
xMax_rows=Max_rows
CREATE WINDOW "SQL Server Parameters" FROM 5,2 TO 12,77
CLEAR
TEXT
Default Logon Username: ----------
Default Logon Password:
Default Logon Server:
Default Logon Database:
Maximum Rows:
ENDTEXT
@ 1,24 GET U PICTURE REPLICATE("!",10)
@ 2,24 GET P PICTURE REPLICATE("!",10)
@ 3,24 GET S PICTURE REPLICATE("!",10)
@ 4,24 GET D PICTURE REPLICATE("!",10)
@ 5,24 GET Max_rows PICTURE "999"
READ
CLEAR GETS
IF xMax_rows<>Max_rows
error1=.T.
IF SENDDATA("Xstr1","16")
IF SENDDATA("Xstr2",ALLTRIM(STR(Max_rows,6,0)))
IF REQUEST("SetOpt")="T"
xconnect=.T.
error=.F.
error1=.F.
ENDIF
ENDIF
ENDIF
IF error1
Max_rows=xMax_rows
WARNING("","Cannot change Max Rows.",1)
ENDIF
ENDIF
USE
CLOSE WINDOW "SQL Server Parameters"
RETURN
*----------------------------------------
PROCEDURE mem_used
xswin="Server Database Memory (KB)"
CREATE WINDOW xswin FROM 8,25 TO 19,55
IF .NOT. fdbcmd("mem_used")
CLOSE WINDOW xswin
RETURN
ENDIF
IF .NOT. fresults("")
CLOSE WINDOW xswin
RETURN
ENDIF
xline=REQUEST("Row")
parse_row(5)
@ 1, 0 SAY "Total Pubs Database - "+TRANSFORM(1000*VAL(fld[1]),"9999999")
@ 2, 0 SAY "Currently Reserved - "+TRANSFORM(VAL(fld[2]),"9999999")
@ 3, 0 SAY " Data - "+TRANSFORM(VAL(fld[3]),"9999999")
@ 4, 0 SAY " Index - "+TRANSFORM(VAL(fld[4]),"9999999")
@ 5, 0 SAY " Total Used - "+TRANSFORM(VAL(fld[3])+VAL(fld[4]),"9999999")
@ 6, 0 SAY " % Used - "+;
TRANSFORM((VAL(fld[3])+VAL(fld[4]))/(10*VAL(fld[1])),"9999999%")
CREATE BUTTON "Continue" AT 9,11
WAIT ""
CLEAR GETS
CLOSE WINDOW xswin
RETURN
*----------------------------------------
PROCEDURE db_dump
IF .NOT. CONFIRM("Dump Pubs database?")
RETURN
ENDIF
fdbcmd("dump database Pubs to diskettedumpa")
IF REQUEST("Dbsqlexec")<>"T"
WARNING("","Pubs database NOT dumped.",1)
RETURN
ENDIF
IF .NOT. fresults("")
WARNING("","Pubs database NOT dumped.",1)
RETURN
ENDIF
fdbcmd("dump transaction Pubs with truncate_only")
IF .NOT. fresults("")
WARNING("","Transaction log could not be truncated.",1)
RETURN
ENDIF
fdbcmd("select count(*) from syslogs")
IF fresults("")
xline=REQUEST("Row")
parse_row(1)
ELSE
WARNING("","Could not get transaction log count.",1)
RETURN
ENDIF
WARNING("Message",ALLTRIM(xline)+" entries left in transaction log. "+;
"Pubs data successfully dumped.",3)
RETURN
*----------------------------------------
PROCEDURE db_load
IF .NOT. CONFIRM("Load Pubs database?")
RETURN
ENDIF
fdbcmd("load database Pubs from diskettedumpa")
IF .NOT. fresults("")
WARNING("","Pubs database NOT loaded.",1)
RETURN
ENDIF
RETURN
*----------------------------------------
PROCEDURE mast_dump
IF .NOT. CONFIRM("Dump Master database?")
RETURN
ENDIF
fdbcmd("dump database master to diskettedumpa")
IF .NOT. fresults("")
WARNING("","Master database NOT dumped.",1)
RETURN
ENDIF
RETURN