日期:2011-01-07  浏览次数:21189 次

请大家在转载和使用的时候  保留这条信息
*/
/* dbcn.asp
   创建数据库连接的 公用程序
*/
<%
  function OpenConn()
     '创建数据库连接
     dim ConnStr
     dim uid
     dim pwd
     dim db
     uid="BBC"
     pwd="BBC"
     db="BBC"
     Softserver="Softdepserver"
     Set Conn = Server.CreateObject("ADODB.Connection")
     ConnStr="Provider=SQLOLEDB.1;UID=" & uid & ";PWD=" & pwd & ";database=" & db & ";server=" & Softserver & ""
     
     Conn.Open ConnStr
     
     set OpenConn=Conn
  end function
  
  function OpenRst()
     '创建数据库记录集
     set Rst=Server.CreateObject ("ADODB.Recordset")
     set OpenRst=Rst
  end function
%>
/*
  staticFunc
  统计程序所需要用到的函数库
*/
<!--#include file="dbcn.asp"-->
<%
   set conn=openConn()
   set rst=openRst()
   sub WriteDateTable(intStart,intEnd,strArray,ccount)
      '生成统计表
      %>
        <table border=1 width=100%>
           <%for i= intStart to intEnd%>
              <tr>
              <td width=30%><%=strArray(i)%></td>
              <td width=60%>
              <%
                 if rst.eof then
                    setbar 0,ccount
                 else
                    if rst(1)=i then
                       setbar rst(3),ccount
               if not rst.eof then rst.movenext
                    else
                       setbar 0,ccount
                    end if
                 end if
              %>
              </td>
          </tr>        
           <%