(dbg_DB_Data, "DBMS",oSQLDB.Properties("DBMS Name") & " Ver: " & oSQLDB.Properties("DBMS Version")) : c( B% E0 j& j$ F: z+ o/ c* E- C! K
dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") & " Ver: " & oSQLDB.Properties("rovider Version")) + a" y1 F7 i$ ~' g2 S# ]1 r: TEnd Sub <>'*********************************************************** : Z7 [3 k& |" j# ^
'* PrintDatabaseInfo 5 `' o; R" B8 T- b d'*********************************************************** - f' Z9 `$ i! v; uPrivate Sub PrintDatabaseInfo(byval DivSetNo) " e( u1 X5 E1 V
dim tbl 8 \& o9 a8 J2 {7 U/ y% x: F7 U+ O
tbl = MakeTable(dbg_DB_Data) / k2 |+ L1 r# l0 h, m2 I tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) # g' ]! r: R1 a4 e4 X9 g' i Response.Write replace(tbl,"|", vbcrlf) # I( R5 H; D8 Y2 t- s- }8 w0 u$ ?End Sub </P><>'*********************************************************** " x2 Z3 A) a8 M
'* PrintCollection 1 X. f4 w: M( q8 i2 p# A0 Y
'*********************************************************** . J8 V) b7 Y+ SPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) @( g4 w$ N5 y! s Dim vItem, tbl, Temp 2 V5 D+ @0 Q7 G: W
For Each vItem In Collection ; x6 g, u* d! e% q8 S2 ` if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ' _7 \" o! c8 S' {4 H) T tbl = AddRow(tbl, vItem, "{object}") 4 E- b' }& W9 V1 e* Y. c/ J
elseif isnull(Collection(vItem)) then 5 d# Z" w& F; O( l. }0 D' r tbl = AddRow(tbl, vItem, "{null}") 8 z6 O0 _4 X% A ^0 [4 r elseif isarray(Collection(vItem)) then 5 o' O. S8 j0 G. u7 T) U tbl = AddRow(tbl, vItem, "{array}") * i$ n+ B0 m+ `" W" k& A
else ' {' U5 [$ T) l4 V/ E
if dbg_AllVars then 0 }, j' W" [1 l& v tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) r8 s( @3 B( t
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then . e. y0 S* ~3 m) p6 F
if Collection(vItem) <> "" then $ @! m6 G$ z0 r, ?1 |; U
tbl = AddRow(tbl, vItem, server.HTML ; A1 e; g% m1 L2 _6 ^# QEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") - h K+ l# I5 `5 m4 e K) B
else 1 ^& `% X. c: E8 C8 ?; Q- m2 W tbl = AddRow(tbl, vItem, "...") [7 J0 X3 ?& P1 ^$ m& p# C6 K3 r9 i# ^ end if & ]/ t2 [ _3 P2 K( V; [- ^# P Q
end if ! T, F# `) X* z! O* w2 _, n( o end if 9 _# Q9 w' y' {* M" k Next ( R( Z2 t% S% K. ~
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo + w0 b1 h% G* _4 F1 z. D6 ?+ `
tbl = MakeTable(tbl) 0 O2 @3 Q5 w! ?2 v
if Collection.count <= 0 then DivSetNo =2 * y" h, g+ _, j/ N& P5 C3 ]* V7 @+ E tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 3 s& q4 U1 {/ W" `+ z
tbl = replace(tbl,"#sectname#",replace(Name," ","")) & M$ v& N. g8 \
Response.Write replace(tbl,"|", vbcrlf) : y. _6 Z/ z/ D. G$ aEnd Sub 1 F" Y' {$ g4 o
! ~5 j! J& v8 C! ^ O3 B+ ^: v'*********************************************************** $ b9 A! c+ G, J+ z'* AddRow ! E) o9 k. {! {6 q
'*********************************************************** 3 H' v+ o! Z1 `3 G* GPrivate Function AddRow(byval t, byval var, byval val) 9 a5 U O& }6 N9 K
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 3 J1 d; l0 z; I
AddRow = t % M" Y& x7 H+ C& h; ]End Function </P><>'*********************************************************** 3 q; q( t4 w3 R: A/ z! x" d
'* MakeTable 9 J4 r0 h/ G( x% ]# W
'*********************************************************** : Q1 g* E* j2 Z1 sPrivate Function MakeTable(byval tdata) ( k9 A$ L9 _, h( X7 j& v; n
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" J0 g- u# n6 `4 P: F6 U. J
MakeTable = tdata 2 o( D5 j q. ]+ Y- G4 b9 [' Y
End Function </P><>'*********************************************************** 5 [8 Y* N6 B* y1 L) [& \; t''@SDESCRIPTION: Draws the Debug-panel 6 R; G% s1 y* P0 I
'*********************************************************** t" z7 O+ T- L5 }% ^7 j
Public Sub draw() % g' \4 n6 u+ x$ m5 J9 A
If dbg_Enabled Then - N& e; g" s$ C2 K- _3 h dbg_FinishTime = Now() % }. c; E- u- ^, x: S ; s9 b. l/ T; B0 j) Q1 s Dim DivSet, x 9 U# r# {5 E5 P& N! `7 O6 u8 S
DivSet = split(dbg_Show_default,",") 1 C2 i% W- O: x; l' p" \2 T8 w
dbg_Show = split(dbg_Show,",") + c# G4 X: @& l/ w' G R% T% x6 [
( D' i- c3 e/ Q( W
For x = 0 to ubound(dbg_Show) X7 t$ ~- x* O+ ]1 R divSet(x) = dbg_Show(x) 5 |' W- \' P, h0 j% j Next # f0 S) n# I0 k5 _
1 Z G0 d$ W; C/ W6 ` J/ t Response.Write "<BR><Table width=100% cellspacing=0 border=0 style=""font-family:arial;font-size:9pt;font-weight:normal;""><TR><TD><DIV style=""background:#005A9E;color:white;padding:4;font-size:12pt;font-weight:bold;"">Debugging-console:</DIV>" % T' W/ e' r! w Call PrintSummaryInfo(divSet(0)) . N. {$ h' [: M; T' { Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") * a5 g' O/ }" B. Q
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") # z& `: N/ y9 Q4 p& L Call PrintCollection("FORM", Request.Form(),divSet(3),"") ' r8 u `" n3 B8 Z Call PrintCookiesInfo(divSet(4)) - u/ A' O) r. y9 t, F2 P% ?$ |& }( ` Call PrintCollection("SESSION", Session.Contents(),divSet(5),AddRow(AddRow(AddRow("","Locale ID",Session.LCID & " (&H" & Hex(Session.LCID) & ")"),"Code Page",Session.CodePage),"Session ID",Session.SessionID)) . a, k6 x" [$ R: [
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 7 Z" o; Z ]9 E: S' L4 X Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 3 i8 k4 y3 K; q- a
Call PrintDatabaseInfo(divSet(8)) / A& X! J- }# u1 O$ f
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") / z1 x( n! Z8 y3 f2 t3 O( P! d1 A Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") % G( R& M9 j" E+ Y Response.Write "</Table>" 6 p2 m8 n; t5 Y& k, I6 t
End If 8 ^4 n! g K* _' S
End Sub </P><>'Destructor , n& r; x. i9 _. i: U3 F; Z+ g5 b
Private Sub Class_Terminate() , O" |: D" }; f7 Z3 E2 m& p' j: \
Set dbg_Data = Nothing 8 C2 J W8 f( }2 ~0 mEnd Sub </P><>End Class </P><>%> </P><>类的说明: </P><># G- ^# E9 x; V- g8 |# |9 `7 _
CLASS debuggingConsole . [2 d0 n6 ^" W6 A+ [% f1 i$ k z3 i/ r
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 0 Z3 s# g6 ~% e, j+ R4 I1 D/ r&n$ T4 ~' P' @4 d
bsp; 1 q+ H6 ~- r0 y7 u- d+ ~6 b3 `
Property Get Enabled===[bool] Gets the "enabled" value & W5 ? C7 I! \, O: L . R+ S0 ?8 |. p% x
Property Let Show(bNewValue)===[string] Sets the debugging panel. Where each digit in the string represents a debug information pane in order (11 of them). 1=open, 0=closed 9 e8 m( i4 [' _
) n( m" Y" q2 G; ?Property Get Show===[string] Gets the debugging panel. $ ^: C2 \5 Q5 N# F: r: L0 {
5 @% e9 z: s( Q* D" n9 V( s
Property Let AllVars(bNewValue)===[bool] Sets wheather all variables will be displayed or not. true/false </P><>roperty Get AllVars===[bool] Gets if all variables will be displayed. </P><>-------------------------------------------------------------------------------- 3 W ^6 I& g! Q
Public Methods </P><>public sub===Print (label, output) & P1 P& p8 T" K- D& k6 | Adds a variable to the debug-informations. </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 6 a, U2 e8 g- b" v
Adds the Database-connection object to the debug-instance. To display Database-information </P><>public sub===draw () ; \0 M6 O$ [; x: `) M: e `( f) H Draws the Debug-panel </P><>-------------------------------------------------------------------------------- ; a2 V4 T4 Y! p0 \- _$ W& V
Methods Detail ; k3 E# m% |# Q. i
0 ]" X, Z3 A1 npublic sub===Print (label, output) . ]/ k6 |4 t. m+ `' l9 yParameters: / g4 F" ]$ _. {2 W* r# y9 R9 s
- label [string]: Description of the variable & E& ?9 w4 [% C% K - output [variable]: The variable itself & w0 x1 [! E) k5 y. V7 w
+ F0 @! z1 J6 ?# K+ Z
public sub===GrabDatabaseInfo (byval oSQLDB) U5 j0 N# f$ X4 a9 H
Parameters: ' ^2 I' I# }! i# _
- oSQLDB [object]: connection-object</P>