zoukankan      html  css  js  c++  java
  • [导入]ASP访问Access数据表的一些属性

      每次设计的时候都要看数据库表,特别是做一些临时业务的时候。郁闷,写了个程序,简单明了的访问表的一些属性,再打印出来,还不错!

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
    <!--#include file="db_conn.asp"-->
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    <style type="text/css">
    <!--
    td {
     font-size: 10pt;
     border: 1px solid #000000;
    }
    -->
    </style>
    </head>
    <%
     set rs=Server.CreateObject("ADODB.Recordset")
     sql="select top 1 * from t_host"
     rs.open sql,conn,1,1
    ' if rs.eof then
    '  response.Write("数据库为空")
    '  Response.End()
    ' end if
    %>
    <body>
    <table width="500" border="0" cellpadding="4" cellspacing="0" bordercolor="#009999" bgcolor="#999999">
      <tr bgcolor="#FFFFFF">
        <td colspan="4">t_host</td>
      </tr>
      <tr align="center" bgcolor="eeeeee">
        <td width="127">字段名</td>
        <td width="102">数据类型</td>
        <td width="51">长度</td>
        <td width="188">说明</td>
      </tr>
      <%
     for each ss in rs.fields
      Response.Write("<tr  bgcolor='#ffffff'>")
      Response.write("<td>"&ss.name&"</td>")
      Response.write("<td>"&ss.Type&"</td>")
      Response.write("<td>"&ss.DefinedSize &"</td>")
      Response.write("<td> </td>")
      Response.Write("</tr>")
     next 
       %>
    </table>

    </body>
    <%
     CloseConn
    %>
    </html>


    文章来源:http://computer.mblogger.cn/wucountry/posts/26079.aspx
    ================================
      /\_/\                        
     (=^o^=)  Wu.Country@侠缘      
     (~)@(~)  一辈子,用心做一件事!
    --------------------------------
      学而不思则罔,思而不学则怠!  
    ================================
  • 相关阅读:
    第十四周课程总结&实验报告(简单记事本的实现)
    第十三周课程总结
    第十二周
    第十一周课程总结
    第十周课程总结
    第九周课程总结&实验报告(七)
    第八周课程总结&实验报告(六)
    第七周课程总结&实验报告(五)
    第六周&java实验报告四
    全局变量
  • 原文地址:https://www.cnblogs.com/WuCountry/p/305757.html
Copyright © 2011-2022 走看看