-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathte_includes.asp
More file actions
206 lines (190 loc) · 5.76 KB
/
te_includes.asp
File metadata and controls
206 lines (190 loc) · 5.76 KB
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<%
'==============================================================
' TableEditoR 0.81 Beta
' http://www.2enetworx.com/dev/projects/tableeditor.asp
'--------------------------------------------------------------
' File: te_includes.asp
' Description: Constants and Public Functions
' 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:
'--------------------------------------------------------------
' # Nov 15, 2000 by Hakan Eskici
' Added permission assignment for Field functions
' Added constants for fields
' # Nov 29, 2000 by Hakan Eskici
' Changed the file name check for protection which assumed that
' the file name is lower case
' # May 14, 2002 by Rami Kattan
' Extra OpenRS and CloseRS for other functions, sometimes caused
' problems closing and opening the same connection
'==============================================================
const bProtected = true
'If protection is on, make sure that user has logged in
if instr(lcase(request.servervariables("script_name")), "index.asp") = 0 then
if bProtected then
if session("teUserName") = "" then
response.redirect "index.asp?comebackto=" & request.servervariables("script_name") & "?" & server.urlencode(request.querystring)
end if
end if
end if
if bProtected then
'If protection is on, get permissions
'for the user from the session
bAdmin = session("rAdmin")
bRecAdd = session("rRecAdd")
bRecEdit = session("rRecEdit")
bRecDel = session("rRecDel")
bQueryExec = session("rQueryExec")
bSQLExec = session("rSQLExec")
bTableAdd = session("rTableAdd")
bTableEdit = session("rTableEdit")
bTableDel = session("rTableDel")
bFldAdd = session("rFldAdd")
bFldEdit = session("rFldEdit")
bFldDel = session("rFldDel")
bAllowExport = session("rAllowExport")
else
'Not protected, give Full control
bAdmin = True
bRecAdd = True
bRecEdit = True
bRecDel = True
bQueryExec = True
bSQLExec = True
bTableAdd = True
bTableEdit = True
bTableDel = True
bFldAdd = True
bFldEdit = True
bFldDel = True
bAllowExport = true
end if
'Pre-create connection and recordset objects
set conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
'Opens a given connection and initializes rs (For main TE)
sub OpenRS(sConn)
conn.open sConn
set rs.ActiveConnection = conn
rs.CursorType = adOpenStatic
end sub
'Closes open connections and releases objects (For main TE)
sub CloseRS()
rs.close
conn.close
set rs = nothing
set conn = nothing
end sub
set conn2 = Server.CreateObject("ADODB.Connection")
set rs2 = Server.CreateObject("ADODB.Recordset")
'Opens a given connection and initializes rs (For extra TE functions)
sub OpenRS2(sConn)
if (conn2 is nothing) then
set conn2 = Server.CreateObject("ADODB.Connection")
set rs2 = Server.CreateObject("ADODB.Recordset")
end if
conn2.open sConn
set rs2.ActiveConnection = conn2
rs2.CursorType = adOpenStatic
end sub
'Closes open connections and releases objects (For extra TE functions)
sub CloseRS2()
rs2.close
conn2.close
set rs2 = nothing
set conn2 = nothing
end sub
'---- CursorTypeEnum Values ----
' Const adOpenForwardOnly = 0
' Const adOpenKeyset = 1
' Const adOpenDynamic = 2
' Const adOpenStatic = 3
'---- CursorLocationEnum Values ----
' Const adUseServer = 2
' Const adUseClient = 3
'---- CommandTypeEnum Values ----
' Const adCmdUnknown = &H0008
' Const adCmdText = &H0001
' Const adCmdTable = &H0002
' Const adCmdStoredProc = &H0004
' Const adCmdFile = &H0100
' Const adCmdTableDirect = &H0200
'---- SchemaEnum Values ----
' Const adSchemaTables = 20
' Const adSchemaPrimaryKeys = 28
' Const adSchemaIndexes = 12
'const adSchemaViews = 23
' Const adSchemaForeignKeys = 27
' Const adSchemaProcedures = 16
'---- DataTypeEnum Values ----
' Const adEmpty = 0
' Const adTinyInt = 16
' Const adSmallInt = 2
' Const adInteger = 3
' Const adBigInt = 20
' Const adUnsignedTinyInt = 17
' Const adUnsignedSmallInt = 18
' Const adUnsignedInt = 19
' Const adUnsignedBigInt = 21
' Const adSingle = 4
' Const adDouble = 5
' Const adCurrency = 6
' Const adDecimal = 14
' Const adNumeric = 131
' Const adBoolean = 11
' Const adError = 10
' Const adUserDefined = 132
' Const adVariant = 12
' Const adIDispatch = 9
' Const adIUnknown = 13
' Const adGUID = 72
' Const adDate = 7
' Const adDBDate = 133
' Const adDBTime = 134
' Const adDBTimeStamp = 135
' Const adBSTR = 8
' Const adChar = 129
' Const adVarChar = 200
' Const adLongVarChar = 201
' Const adWChar = 130
' Const adVarWChar = 202
' Const adLongVarWChar = 203
' Const adBinary = 128
' Const adVarBinary = 204
' Const adLongVarBinary = 205
' Const adChapter = 136
' Const adFileTime = 64
' Const adPropVariant = 138
' Const adVarNumeric = 139
' Const adArray = &H2000
'---- FieldAttributeEnum Values ----
' Const adFldMayDefer = &H00000002
' Const adFldUpdatable = &H00000004
' Const adFldUnknownUpdatable = &H00000008
' Const adFldFixed = &H00000010
' Const adFldIsNullable = &H00000020
' Const adFldMayBeNull = &H00000040
' Const adFldLong = &H00000080
' Const adFldRowID = &H00000100
' Const adFldRowVersion = &H00000200
' Const adFldCacheDeferred = &H00001000
' Const adFldIsChapter = &H00002000
' Const adFldNegativeScale = &H00004000
' Const adFldKeyColumn = &H00008000
' Const adFldIsRowURL = &H00010000
' Const adFldIsDefaultStream = &H00020000
' Const adFldIsCollection = &H00040000
' Const adColFixed = 1
' Const adColNullable = 2
%>
<!--#include file="te_functions.asp"-->