如何顯示數(shù)據(jù)庫(kù)的結(jié)構(gòu)
來(lái)源:易賢網(wǎng) 閱讀:828 次 日期:2014-08-09 15:20:33
溫馨提示:易賢網(wǎng)小編為您整理了“如何顯示數(shù)據(jù)庫(kù)的結(jié)構(gòu)”,方便廣大網(wǎng)友查閱!

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<body bgcolor="#CCCCCC" text="#000000">

<h2 align="center">星河影動(dòng)之查看數(shù)據(jù)庫(kù)結(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">

自動(dòng)編號(hào)

</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>

' 字段長(zhǎng)度.

<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>

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

' 是否為自動(dòng)編號(hào).

<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>

更多信息請(qǐng)查看IT技術(shù)專欄

更多信息請(qǐng)查看網(wǎng)絡(luò)編程
易賢網(wǎng)手機(jī)網(wǎng)站地址:如何顯示數(shù)據(jù)庫(kù)的結(jié)構(gòu)
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

2025國(guó)考·省考課程試聽(tīng)報(bào)名

  • 報(bào)班類型
  • 姓名
  • 手機(jī)號(hào)
  • 驗(yàn)證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 加入群交流 | 手機(jī)站點(diǎn) | 投訴建議
工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報(bào)警專用圖標(biāo)