<!--#include file="../../fy.Function.asp"-->
<%


echo GetFileds(fycms.s("table"))


function getType(num)
   getType=num
   select case num
     case "202" :
       getType="文本"
     case "203" :
       getType="备注"
     case "3" :
       getType="长整型"
     case "2" :
       getType="整型"
     case "17" :
       getType="字节,数字型"
     case "3" :
       getType="长整型"
     case "4" :
       getType="单精浮点"
     case "5" :
       getType="双精浮点"
     case "3" :
       getType="长整型"
     case "72" :
       getType="同步复制ID"
     case "131" :
       getType="小数"
     case "135" :
       getType="日期/时间"
     case "6" :
       getType="货币"
     case "11" :
       getType="是/否"
     case "205" :
       getType="OLE对象"
   end select
end function




Function GetFileds(TableName)
 If Trim(TableName)="" Then Exit Function 
Set rs = server.createobject("adodb.recordset") 
Dim SQL ,rs,i
SQL = "select * from " & TableName 
rs.Open SQL, conn, 1, 1 
Dim Cont,fcount,fstr
Cont = rs.Fields.Count 
fstr=fstr&"<div style=""margin-bottom:10px;padding:5px;border:1px #dddddd solid;background:#eeeeee"">"&vbcrlf 
fstr=fstr&"表 <font color=red><b>"&TableName&"</b></font> 中含有"&Cont&"个字段,具体如下:<a id=""PicUrls4"" class=""btn "" onClick=""javascript:GetFiled('http://www.fycms.com/GetFileds.asp?table="&TableName&"&f={fe}');""  href=""###""><font color=red>查看字段说明</font></a><br>"&vbcrlf 
For i = 0 To Cont - 1 
  dim filtype 
  filtype=getType(rs.fields(i).type)
  fcount=fcount&","&rs.fields(i).name
 fstr=fstr&" <label for="""&rs.fields(i).name&"s""  title="""&filtype&"""><input type=""checkbox"" name=""Fileds"" id="""&rs.fields(i).name&"s"" onclick=""CheckForm();"" value="""&rs.fields(i).name&""">"&rs.fields(i).name&"  <font color=#B9B9B9>["&filtype&"字段]</font></label>"
  'response.write "  <font color=red>"&i&"</font>--<font color=green><b>"&rs.fields(i).name&"</b></font>--"&filtype&rs.fields(i).type&";<br />"&vbcrlf 
Next 
fstr=fstr&"</div>"&vbcrlf 
echo rep(fstr,"{fe}",fcount)
rs.Close 
set rs=nothing 
End Function 









%>
