-
Notifications
You must be signed in to change notification settings - Fork 0
/
te_admin.asp
185 lines (180 loc) · 5.88 KB
/
te_admin.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<%
'==============================================================
' TableEditoR 0.81 Beta
' http://www.2enetworx.com/dev/projects/tableeditor.asp
'--------------------------------------------------------------
' File: te_admin.asp
' Description: Lists defined connections
' Initiated By Hakan Eskici on Nov 01, 2000
'--------------------------------------------------------------
' Copyright (c) 2002, 2eNetWorX/dev.
'
' TableEditoR is distributed with General Public License.
' Any derivatives of this software must remain OpenSource and
' must be distributed at no charge.
' (See license.txt for additional information)
'
' See Credits.txt for the list of contributors.
'
' Change Log:
'--------------------------------------------------------------
' # Mar 26, 2001 by Hakan Eskici
' Added displaying table, view and procedure counts
' # April 18, 2002 by Rami Kattan
' Dynamic configurations, highlighting and more.
'==============================================================
%>
<!--#include file="te_config.asp"-->
<!--#include file="te_header.asp"-->
<%
sub GetDBDetails (sConnStr, ByRef sTableCount, ByRef sViewCount, ByRef sProcCount)
on error resume next
conn.Open sConnStr
Set adox = Server.CreateObject("ADOX.Catalog")
adox.ActiveConnection = conn
sTableCount = adox.tables.count
sViewCount = adox.views.count
if err <> 0 then sViewCount = "n/a"
sProcCount = adox.procedures.count
conn.close
end sub
%>
<script language="JavaScript" type="text/javascript">
<!--
function openWindow(url) {
popupWin = window.open(url,'new_page','width=540,height=600,resizable=yes')
}
//-->
</script>
<table border=0 cellspacing=1 cellpadding=3 bgcolor="#ffe4b5" width="100%">
<tr>
<td class="smallertext">
<a href="index.asp">Home</a> » Connections
</td>
<td class="smallerheader" width=130 align=right>
<%
if bProtected then
if session("teLastAccess") <> "" then
response.write "<span title=""User last access was on '" & formatdatetime(session("teLastAccess"), 1) & "'" & vbCrLf & "at '"& formatdatetime(session("teLastAccess"), 3) & "'"">"
else
response.write "<span title=""First time access, Welcome."">"
end if
response.write session("teFullName") & "</span>"
response.write " (<a href=""te_logout.asp"">logout</a>)"
end if
%>
</td>
</tr>
</table>
<noscript>
<div align="center"><h2><font color="#FF0000"><i>Highly</i> Recommended having <b><u>JavaScript</u></b> enabled</font></h2></div>
</noscript>
<p class="smallerheader">
Select a connection <nobr>
<% if bAdmin then %>
<script language="JavaScript" type="text/javascript">
<!--
function goto_admin(){
var URL = GetObject("AdminWhat").options[GetObject("AdminWhat").selectedIndex].value;
if (URL != "") location.href = URL;
}
//-->
</script>
<% if bJSEnable and bPopUps then %>
or <select id="AdminWhat" name="AdminWhat" onchange="goto_admin()" class="smallbutton">
<option value="">--- Select ---</option>
<option value="<% =TableViewerCompat %>?cid=0&tablename=Users">Administer Table Editor Users</option>
<option value="te_dynamic_config.asp">Change Table Editor Configurations</option>
<option value="<% =TableViewerCompat %>?cid=0&tablename=Databases">Administer Database Connections</option>
<% if bUserLogging then %>
<option value="<% =TableViewerCompat %>?cid=0&tablename=Logging">View Login Logs</option>
<% end if
if bActiveUsers then %>
<option value="te_view_active_users.asp">View Active Users</option>
<% end if
if bBulkCompact then %>
<option value="">--------------------</option>
<option value="te_compactall.asp?onlybackup=true">Backup All Databases</option>
<option value="te_compactall.asp">Compact All Databases</option>
<% end if %>
</select><input type="button" name="AdminWhatGo" value="»" onclick="goto_admin()" class="smallbutton">
<% else ' if JS enabled %>
or <a href="te_admin_options.asp">Configure Table Editor</a>
<% end if ' if JS enabled %>
<% end if ' if bAdmin %>
</p>
<table border=0 cellspacing=1 cellpadding=2 bgcolor = "#ffe4b5" width="100%"<% if bTableHighlight then response.write " style=""behavior:url(tablehl.htc);"" slcolor='#ffffcc' hlcolor='#bec5de'"%>>
<thead>
<tr>
<td class="smallerheader" bgcolor="#ffe4b5" width=10>»</td>
<td bgcolor="#ffe4b5" class="smallerheader">Connections</td>
</tr>
<tr>
<td class="smallerheader" bgcolor="#fffaf0" width=10></td>
<td class="smallerheader" bgcolor="#fffaf0">Database Name</td>
<%
if bShowConnDetails = True then
%>
<td class="smallerheader" bgcolor="#fffaf0" width="60">Tables</td>
<td class="smallerheader" bgcolor="#fffaf0" width="60">Views</td>
<td class="smallerheader" bgcolor="#fffaf0" width="60">Procs</td>
<%
end if
%>
<td class="smallerheader" bgcolor="#fffaf0" width="100">Type</td>
<td bgcolor="#fffaf0" width=160 align="right" class="smallerheader">Action</td>
<td bgcolor="#fffaf0" width=10></td>
</tr>
</thead>
<tbody>
<%
for i = 1 to ubound(arrConn)
select case arrType(i)
case tedbAccess
sConnType = "Access"
case tedbSQLServer
sConnType = "SQL Server"
case tedbDsn
sConnType = "DSN"
case tedbConnStr
sConnType = "ConnStr"
end select
%>
<tr bgcolor="#fffaf0">
<td></td>
<td>
<a href="te_listtables.asp?cid=<%=i%>"><%=arrDesc(i)%></a>
</td>
<%
if bShowConnDetails = True then
GetDBDetails arrConn(i), sTableCount, sViewCount, sProcCount
%>
<td class="smallertext"><%=sTableCount%></td>
<td class="smallertext"><%=sViewCount%></td>
<td class="smallertext"><%=sProcCount%></td>
<%
end if
%>
<td class="smallertext"><%=sConnType%></td>
<td width=160 align="right">
<%
if bTableEdit and arrType(i) = tedbAccess then
%>
<a href="te_compactdb.asp?cid=<%=i%>">compact</a>
<a href="te_compactdb.asp?cid=<%=i%>&onlybackup=true">backup</a>
<%
end if
if bAdmin then
%>
<a href="te_showschema.asp?cid=<%=i%>">schema</a>
<%
end if
%>
</td>
<td></td></tr>
<%
next
%>
</tbody>
</table>
<!--#include file="te_footer.asp"-->