%
'==============================================================
' TableEditoR 0.81 Beta
' http://www.2enetworx.com/dev/projects/tableeditor.asp
'--------------------------------------------------------------
' File: te_queryinfo.asp
' Description: Displays query information
' Initiated By Hakan Eskici on Nov 07, 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 22, 2000 by Hakan Eskici
' Renamed the file from te_tableinfo.asp (which is replaced by
' te_tableedit.asp) to te_queryinfo.asp
' Removed listing of indexes
'==============================================================
%>
<%
lConnID = request("cid")
sTableName = request("tablename")
sType = request("type")
OpenRS arrConn(lConnID)
set adox = server.createobject("adox.catalog")
set cmd = server.createobject("adodb.command")
adox.ActiveConnection = conn
select case sType
case "query"
response.write "
Query :
"
response.write "
"
%>
|
|
|
<%
rs.Open "SELECT * FROM [" & sTableName & "]", , ,adCmdTable
for each fld in rs.fields
sAttributes = ""
sFieldType = ""
select case fld.Type
case adSmallInt : sFieldType = "integer"
case adInteger : sFieldType = "long"
case adBoolean : sFieldType = "boolean"
case adDate : sFieldType = "date"
case adCurrency : sFieldType = "currency"
case adVarWChar : sFieldType = "text"
case adLongVarWChar : sFieldType = "memo"
case adLongVarBinary : sFieldType = "ole"
case adGUID : sFieldType = "guid"
case adUnsignedTinyInt : sFieldType = "byte"
case else : sFieldType = fld.type
end select
if fld.properties("IsAutoIncrement") = true then
sAttributes = sAttributes & "(auto increment)"
end if
'Actually this won't work, any recommendations are welcome
if (fld.attributes and adFldKeyColumn) = adFldKeyColumn then
sAttributes = sAttributes & " (primary key)"
end if
if (fld.attributes and adFldUpdatable) = adFldUpdatable then
sAttributes = sAttributes & " (updatable)"
end if
if (fld.attributes and adFldIsNullable) = adFldIsNullable then
sAttributes = sAttributes & " (nullable)"
end if
if (fld.attributes and adFldFixed) = adFldFixed then
sAttributes = sAttributes & " (fixed)"
end if
'if (fld.attributes and adFldMayBeNull) = adFldMayBeNull then
' sAttributes = sAttributes & " (may be null)"
'end if
if (fld.attributes and adFldLong) = adFldLong then
sAttributes = sAttributes & " (long)"
end if
if (fld.attributes and adFldRowID) = adFldRowID then
sAttributes = sAttributes & " (row id)"
end if
if (fld.attributes and adFldIsRowURL) = adFldIsRowURL then
sAttributes = sAttributes & " (url)"
end if
%>
|
<%=fld.name%> |
<%=sFieldType%> |
<%=fld.definedsize%> |
<%=sAttributes%> |
|
<%
next
response.write "
"
CloseRS
case "proc"
response.write "
Procedure :
"
response.write "
"
end select
%>