佳木斯湛栽影视文化发展公司

主頁 > 知識庫 > 如何顯示數(shù)據(jù)庫的結(jié)構(gòu)?

如何顯示數(shù)據(jù)庫的結(jié)構(gòu)?

熱門標(biāo)簽:呼叫中心市場需求 銀行業(yè)務(wù) 智能手機 檢查注冊表項 鐵路電話系統(tǒng) 網(wǎng)站文章發(fā)布 服務(wù)器配置 美圖手機

html>
head>
meta http-equiv="Content-Type" content="text/html; charset=gb2312">
/head>
body bgcolor="#CCCCCC" text="#000000">
h2 align="center">
星河影動之查看數(shù)據(jù)庫結(jié)構(gòu)/h2>
p>
%
on error resume next
table=request("table")
 ' 獲得表名.


if table>"" then
response.write "
數(shù)據(jù)表:"table
Set primary = con.OpenSchema(adSchemaPrimaryKeys, _
Array(empty, empty, table))
if primary("COLUMN_NAME")>"" then
primarykey=primary("COLUMN_NAME")
end if
primary.close
set primary=nothing
%>
/p>
center>
table width="650" border="1" cellpadding="0" cellspacing="0">
tr bgcolor="#CCCCCC">
th class="sundog" width="61">
div align="center">
字段/div>
/th>
th class="sundog" width="131">
div align="center">
類型/div>
/th>
th class="sundog" width="105">
div align="center">
設(shè)定大小/div>
/th>
th class="sundog" width="69">
div align="center">
允許空值/div>
/th>
th class="sundog" width="69">
自動編號
/th>
th class="sundog" width="81">
主鍵/th>
/tr>
%sql="select * from ["table"] "
set rs=con.execute(sql)
for i=0 to rs.fields.count-1
%>
tr bgcolor="#CCCCCC">
td class="sundog" height="2" width="61">
div align="center">%=rs(i).name%>/div>


----------------------------------------------------------------------------------------------------------------

 ' 字段名.

/td>
td class="sundog" height="2" width="131">
div align="center">
%
field_type=rs(i).type
select case field_type
case adEmpty
typ = "Empty"
case adTinyInt
typ = "TinyInt"
case adSmallInt
typ = "SmallInt"
case adInteger
typ = "Integer"
case adBigInt
typ = "BigInt"
case adUnsignedTinyInt
typ = "UnsignedTinyInt"
case adUnsignedSmallInt
typ = "UnsignedSmallInt"
case adUnsignedInt
typ = "UnsignedInt"
case adUnsignedBigInt
typ = "UnsignedBigInt"
case adSingle
typ = "Single"
case adDouble
typ = "Double"
case adCurrency
typ = "Currency"
case adDecimal
typ = "Decimal"
case adNumeric
typ = "Numeric"
case adBoolean
typ = "Boolean"
case adError
typ = "Error"
case adUserDefined
typ = "UserDefined"
case adVariant
typ = "Variant"
case adIDispatch
typ = "IDispatch"
case adIUnknown
typ = "IUnknown"
case adGUID
typ = "GUID"
case adDATE
typ = "DATE"
case adDBDate
typ = "DBDate"
case adDBTime
typ = "DBTime"
case adDBTimeStamp
typ = "DBTimeStamp"
case adBStr
typ = "BStr"
case adChar
typ = "Char"
case adVarChar
typ = "VarChar"
case adLongVarChar
typ = "LongVarChar"
case adWChar
typ = "WChar"
case adVarWChar
typ = "VarWChar"
case adLongVarWChar
typ = "LongVarWChar"
case adBinary
typ = "Binary"
case adVarBinary
typ = "VarBinary"
case adLongVarBinary
typ = "LongVarBinary"
case adChapter
typ = "Chapter"
case adPropVariant
typ = "PropVariant"
case else
typ = "Unknown"
----------------------------------------------------------------------------------------------------------------

 

end select
response.write typ%>
 ' 字段類型.
/div>
/td>
td class="sundog" height="2" width="105">
div align="center">%=rs(i).definedsize%>/div>
/td>
 ' 字段長度.

td class="sundog" height="2" width="69">
div align="center">
%
attrib=rs(i).attributes
if (attrib and adFldIsNullable)=0 then
response.write "No"
else
response.write "Yes"
end if
%>
/div>
/td>

----------------------------------------------------------------------------------------------------------------

 ' 是否允許空值.
td class="sundog" height="2" width="69">
div align="center">
%if rs(i).Properties("ISAUTOINCREMENT") = True then%>
input type="checkbox" name="autoincrement" value="checkbox" checked>
%else%>
input type="checkbox" name="autoincrement" value="checkbox">
%end if%>
/div>
/td>
----------------------------------------------------------------------------------------------------------------

 ' 是否為自動編號.
td class="sundog" height="2" width="81">
div align="center">
%if rs(i).name=primarykey then%>
input type="checkbox" name="primarykey" value="checkbox" checked>
%else%>
input type="checkbox" name="primarykey" value="checkbox">
%end if%>
/div>
/td>
----------------------------------------------------------------------------------------------------------------

 ' 主健.
/tr>
%next %>
/table>
/center>

[1]

標(biāo)簽:河南 長治 沈陽 新疆 樂山 滄州 上海 紅河

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《如何顯示數(shù)據(jù)庫的結(jié)構(gòu)?》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    景德镇市| 舒城县| 西丰县| 嘉禾县| 平果县| 安陆市| 长白| 盐城市| 长治市| 佛坪县| 兴宁市| 双辽市| 青海省| 南陵县| 余庆县| 赞皇县| 德钦县| 和顺县| 安吉县| 怀集县| 富顺县| 铜川市| 静安区| 兴文县| 武鸣县| 会同县| 息烽县| 万宁市| 神农架林区| 仙桃市| 黄大仙区| 江油市| 和龙市| 斗六市| 樟树市| 阳高县| 石城县| 江门市| 南阳市| 顺昌县| 婺源县|