| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1015 人关注过本帖
标题:请问如何使用网数据库后用SQL语句关闭?
只看楼主 加入收藏
向晓晓
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-12-25
收藏
 问题点数:0 回复次数:1 
请问如何使用网数据库后用SQL语句关闭?
我自己搞个了网站。昨天网络公司的把我的关了。他说我的网站占资源。[url]www.lanhua.name[/url] 空间商说我程序占资源首页调用的数据库太多,显示要半天 要我去改程序。要么就升级到单独虚拟服务器使用,就不会影响其它人网站了。 想请各位帮我看看
是程序不好。并没有说你的网站流量大,访问人数多。
比如打开了一个数据库,没有关闭,就一直在调用。
左左{IDC2001 11:12:55
由用户程序导致的耗资源。一般都是调用ACCESS数据库频繁或本身编写BUG导致。主要表现在:数据库长驻进程多,数据库调用完毕而没有相应的关闭语句,造成连接长期占用无法释放而形成错误、程序变量再调用完毕后结束时没有进行清理。我们建议您尽快修改程序升级成为基于客户/服务器结构的SQL数据库,或租用专门为高级客户量身定制的独享主机,由您独享一台服务器.以获得更高的系统资源。
左左{IDC2001 11:13:20
耗资源与大流量的区别。

(1)大流量客户:进行大量的图片下载、广告互换、聊天等工作,造成带宽严重占用。
(2)耗资源客户:运行自己网站程序,造成服务器负载急剧上升,造成服务器无法正常服务。
(3)区别在与大流量客户是网络带宽方面,而耗资源客户是对服务器正常运行方面。

我的首页程序代码为:

<%@ LANGUAGE = VBScript CodePage = 936 LCID=2052%>
<!--#include file="conn.asp"-->
<!--#include file="newsConvert.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="generator" content="武陵兰花网">
<meta name="Keywords" content="兰花网,春兰,春兰龙根苗,春剑,春剑龙根苗,寒兰,寒兰龙根苗,蕙兰,蕙兰龙根苗,兔耳兰,送春浓香, 豆瓣兰,台兰,下山兰,兰苗,野生兰,">
<meta name="Description" content="“武陵兰花网”地处武陵山区拥有丰富的兰花资源,是中国武陵山区最专业的兰花类商务网站,现面向全国诚征代理经销商!我们的口号是:让兰花早日进入千家万户,让兰花飘香四海!!!兰花,下山兰,兰苗,野生兰,春兰,春兰龙根苗,春剑,春剑龙根苗,寒兰,寒兰龙根苗,蕙兰,蕙兰龙根苗,兔耳兰,送春, 豆瓣兰,台兰">
<title>武陵兰花网--本站长期为您邮寄武陵山区下山国兰(国内免费特快专递)lanhua.
<link href="images/css.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
body {
    margin-top: 0px;
    margin-bottom: 0px;
}
.style21 {color: #FF0000}
.STYLE23 {color: #242424}
-->
</style>

<!-- Fireworks 4.0  Dreamweaver 4.0 target.  Created Thu Feb 21 00:31:30 GMT+0800 (?D1ú±ê×?ê±??) 2002-->
<script language="javaScript" type="text/javascript" SRC="001.js"></SCRIPT>

<script>

function openIT(theURL,W,H) {

    

    wname ="CHROMELESSWIN"



    windowCERRARa         = "image/close_a.gif"

    windowCERRARd         = "image/close_d.gif"

    windowCERRARo         = "image/close_o.gif"

    windowNONEgrf         = "image/none.gif"

    windowCLOCK        = "image/clock.gif"

    windowREALtit        = "&nbsp;武陵兰花网"

        windowTIT             = "<font face=宋体 size='0'></font>"

    windowBORDERCOLOR       = "#000000"

    windowBORDERCOLORsel    = "#000000"

    windowTITBGCOLOR        = "#DBD9D9"

    windowTITBGCOLORsel     = "#DBD9D9"

    openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel)

}

</script>
</head>

<body onMouseOver="window.status='【武陵兰花网】[url]http://lanhua.[/url] 如果您喜欢本站,别忘了把本站的网址告诉给您的兰友哦!谢谢您';return true">
<!--#include file="top.asp" -->
<table width="771" height="37" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="192" align="right" background="images/bar_bg1.gif" bgcolor="#c0c0c0" style="border-left: 1 solid #C0C0C0">中国武陵山区下山国兰交流<BR>
    QQ群:30842081</td>
    <td width="533" align="left" background="images/bar_bg1.gif" bgcolor="#c0c0c0">
    <p align="right">  [url]www.Lanhua.name[/url]  [url]www.Orchid.name[/url]  Lanhua.  [url]www.[/url]  [url]www.[/url]</td>
    <td width="38" bgcolor="#c0c0c0" background="images/bar_bg1.gif" style="border-right: 1 solid #C0C0C0">
      <img border="0" src="images/bar_bg_mid.gif" width="38" height="37"></td>
  </tr>
</table>
<table width="769" border="0" align="center" cellpadding="0" cellspacing="0" height="477">
  <tr>
    <td width="3" height="423" style="border-left: 1 solid #C0C0C0" rowspan="4">&nbsp;</td>
    <td width="192" height="34" style="border-right: 1 solid #C0C0C0"><table width="100%" border="0">
        <tr>
          <td><img border="0" src="images/gonggao.gif" width="192" height="34"></a></td>
        </tr>
        <tr>
          <td height="115"><MARQUEE direction=up height=115 onmouseout=this.start() onmouseover=this.stop() scrollAmount=1 scrollDelay=40 trueSpeed width=190 border="0"><FONT color=#006600>
            <% sql="select gonggao from company"
                                  res.open sql,con,1,1
                                  if not res.eof then response.write newsConvert(res("gonggao"))
                                  res.close
                               %>
            </FONT></MARQUEE></td>
        </tr>
      </table>
      <img border="0" src="images/title1.gif" width="192" height="34"></a></td>
    <td valign="top" height="423" width="572" rowspan="4"><table width="95%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="images/sfdsf.gif" width="14" height="8"></td>
      </tr>
    </table>
      <TABLE cellSpacing=6 cellPadding=0 width="92%" align=center
border=0 height="397">
        <TBODY>
          <TR vAlign=top>
            <TD height=391>
              <TABLE cellSpacing=0 cellPadding=0 width="511" border=0>
                <TBODY>
                  <TR>
                    <TD width="165" rowSpan=8> <DIV align=left>今日推荐下山艺兰 <img src="images/t.gif" width="9" height="17"><a href="yl.asp" target="_blank"><img border="0" src="images/TJ.jpg" width="120" height="143"></a>
                      </DIV></TD>
                    <TD height=20>1<a href="javascript:openIT('1.asp',550,440);">.什么是下山兰?</a></TD>
                    <TD>9.<a href="javascript:openIT('9.asp',550,440);"> 如何辩认兔耳兰?</a></TD>
                  </TR>
                  <TR>
                    <TD height=20>2.<a href="javascript:openIT('2.asp',550,440);">什么是龙根苗?</a></TD>
                    <TD height=20>10.<a href="javascript:openIT('10.asp',550,440);">如何辩认豆瓣兰?</a></TD>
                  </TR>
                  <TR>
                    <TD height=20>3.<a href="javascript:openIT('3.asp',550,440);">如何辩认春剑?</a></TD>
                    <TD height=20>11.<a href="javascript:openIT('11.asp',550,440);">如何辩认春兰的香</a></TD>
                  </TR>
                  <TR>
                    <TD height=20>4.<a href="javascript:openIT('4.asp',550,440);">如何辩认春兰?</a></TD>
                    <TD height=20>12.<a href="javascript:openIT('12.asp',550,440);">下山兰驯化与调理</a></TD>
                  </TR>
                  <TR>
                    <TD height=20>5.<a href="javascript:openIT('5.asp',550,440);">如何辩认寒兰?</a></TD>
                    <TD height=20>13.<a href="javascript:openIT('13.asp',550,440);">种养下山兰五不要</a></TD>
                  </TR>
                  <TR>
                    <TD height=20>6.<a href="javascript:openIT('6.asp',550,440);">如何辩认蕙兰?</a></TD>
                    <TD height=20>14.<a href="javascript:openIT('14.asp',550,440);">野生兰花采集技巧</a></TD>
                  </TR>
                  <TR>
                    <TD height=20>7.<a href="javascript:openIT('7.asp',550,440);">如何辩认送春?</a></TD>
                    <TD height=20>15.<a href="javascript:openIT('15.asp',550,440);">野生兰花果实贴图</a></TD>
                  </TR>
                  <TR>
                    <TD height=22>8.<a href="javascript:openIT('8.asp',550,440);">如何辩认台兰?</a></TD>
                    <TD height=22>16.<a href="javascript:openIT('16.asp',550,440);">武陵山区简介</a></TD>
                  </TR>
                </TBODY>
              </TABLE>
              <TABLE height=2 cellSpacing=0 cellPadding=0 width="100%"
                  align=center
                  background="images/txwm_line_1.gif"
                  border=0>
                <TBODY>
                  <TR>
                    <TD height=2><IMG height=2
                        src="images/dot.gif"
                    width=10></TD>
                  </TR>
                </TBODY>
              </TABLE>
              <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TBODY>
                  <TR>
                    <TD height=22 background="images/dot1.gif"><strong>专题栏目:</strong>野外采兰日记
                      <a href="20051228.htm" target="_blank"><strong>1</strong></a>
                      <a href="20051229.htm" target="_blank"><strong>2</strong></a>
                      <a href="20060127.htm" target="_blank"><strong>3</strong></a>
                      <a href="20060129.htm" target="_blank"><strong>4</strong></a>
                      <a href="20060308.htm" target="_blank"><strong>5</strong></a>
                      <a href="20060415.htm" target="_blank"><strong>6</strong></a>
              <a href="20060818.htm" target="_blank"><strong>7</strong></a>
              <a href="20060828.htm" target="_blank"><strong>8</strong></a>
              <a href="20061028.htm" target="_blank"><strong>9</strong></a>
                      <a href="20061114.htm" target="_blank"><strong>10</strong></a>
                      <a href="20070218.htm" target="_blank"><strong>11</strong></a>
                      <a href="20071129.htm" target="_blank"><strong>12</strong></a>
                      <a href="20071208.htm" target="_blank"><strong>13新</strong></a></TD>
                  </TR>
                </TBODY>
              </TABLE>
              <TABLE height=197 cellSpacing=0 cellPadding=0 width="100%"
                  align=center
                  border=0>
                <TBODY>
                  <TR>
                    <TD height=197>
                      <table width="100%" border="0">
                        <tr>
                          <td>最新上传</td>
                          <td>
                            <%
        dim keyword
        dim sort_id
        keyword=request("keyword")
        sort_id=request("sort_id")
        if sort_id<>"" then sqlwhere=sqlwhere &" and sort_id="&sort_id&""
        if keyword<>"" then sqlwhere=sqlwher &" and shop_name like '%"&keyword&"%'"
        Set rs=Server.CreateObject("ADODB.RecordSet")
        strsql="select * from Product where shop_id<>0 "&sqlwhere&" order by dateandtime desc"
        rs.Open strsql,con,1,1
    if rs.eof then
           response.write "<script language=javascript>alert('没有找到你搜索的产品');window.history.back();</script>"
    else
        rs.movefirst
        if not isempty(request("page")) then   
           pagecount=cint(request("page"))   
        else   
           pagecount=1   
        end if
        rs.pagesize=4
        if pagecount>rs.pagecount or pagecount<=0 then              
           pagecount=1              
        end if              
        rs.AbsolutePage=pagecount
      %>
                            <table width="50" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FF9900">
                              <%
          j=1
          do while not (rs.eof or err)
          if (j mod 4)=1 then
              response.write "<tr>"
          end if
        %>
                              <td align="center" valign="top"> <table width="100%" height="125" border="0" align="center" cellpadding="4" cellspacing="0">
                                  <tr>
                                      <td width="110" align="center" valign="middle">
                                        <table width="105" border="0" cellpadding="1" cellspacing="0" bgcolor="#CCCCCC">
                                          <tr>
                                          <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                                              <tr>
                                                  <td align="center" valign="middle">
                                                    <%If rs("Pic")<>"" then%>
                                                    <a href='List.asp?Shop_ID=<%=rs("Shop_ID")%>' target=_blank><img border='0' width='100' height='80' src="Pic/<%=rs("pic")%>" align='center'></a>
                                                    <%Else%>
                                                    <a href='List.asp?Shop_ID=<%=rs("Shop_ID")%>' target=_blank><img border='0' width='100' height='80' src='Pic/no.jpg' align='center'></a>
                                                    <%End If%>                                                  </td>
                                              </tr>
                                            </table></td>
                                        </tr>
                                      </table>
                                      <table width="100%" height="22"  border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tr>
                                          <td align="center"><a class=a4 href="List.asp?Shop_id=<%=rs("shop_id")%>" target=_blank><strong>[<%=left(rs("shop_name"),12)%>]</strong></a></td>
                                        </tr>
                                      </table></td>
                                      <td valign="middle">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td colspan="2" height="1" background="img/dot_02.gif">                                    </td>
                                  </tr>
                                </table></td>
                              <%  
          if (j mod 4)=0 then
             response.write "</tr>"
          end if
          j=j+1
          rs.moveNext
          if j>4 then exit do
          loop
    end if
       %>
                            </table></td>
                        </tr>
                        <tr>
                          <td>下山精品</td>
                          <td bordercolor="#CCCCCC"><iframe scrolling="no" width="500" height=102 marginwidth="0" marginheight="0" frameborder="0" align="center" src="index_tu.asp" ></iframe></td>
                        </tr>
                      </table>
                      <font color="#006600"><b>本站长期为您邮寄武陵山区下山国兰[国内免费特快专递]</b></font>
                      <p>本站地处武陵山区,拥有丰富的兰花资源,刚刚采挖下山的新鲜兰苗!<br>
                        叶形硬挺,花色艳丽,香气绝对纯正!<br>
                        选苗时:枯病弱草淘汰!叶形软薄细窄的淘汰!只留下强根壮苗为您邮寄!<br>
                        国内售价:<br>
                        春兰 2元/苗 (浓香) 春兰(龙根苗) 4元/苗 (浓香)<br>
                        蕙兰 2元/苗 (浓香) 蕙兰(龙根苗) 5元/苗 (浓香)[蕙兰龙根苗缺货]<br>
                        春剑 5元/苗 (浓香) 春剑(龙根苗) 8元/苗 (浓香)<br>
                        寒兰 5元/苗 (浓香) 寒兰(龙根苗) 8元/苗 (浓香)<br>
                        送春 3元/苗 (浓香)<br>
                        台兰 2元/苗 (无香)<br>
                        兔耳兰3元/苗(微香)<br>
                        豆瓣兰2元/苗(无香)<br>
                       
                        以上品种欢迎选购 <font color="#006600">最低邮购价:200元[含特快专递费]</font> 为保证下山兰苗的质量,我们一般不存货,收到您的汇款后,再根据要求马上组织山农进山现采鲜卖.正常情况下保证48小时内发货,若遇特别情况天气不好稍有迟后请能谅解.若订货数量较多,需先查询当前是否每一品种都方便供货.<br>
                        邮寄兰苗时:我们采用大量微润青苔保鲜,一般保鲜20天左右都不会有点问题,正常情况下您6天内便可收到兰苗,发货时可根据您对草形草质的爱好而尽量满足您的特别要求.我们将热情服务!<br>
                        <IMG height=20
                    src="images/dot.gif"
                    width=10></p>
                    </TD>
                  </TR>
                </TBODY>
            </TABLE></TD>
          </TR>
        </TBODY>
    </TABLE>
      <table width="95%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="images/sfdsf.gif" width="14" height="6"></td>
        </tr>
      </table></td>
    <td width="1" bgcolor="#c0c0c0" height="423" rowspan="4"></td>
  </tr>
  <tr>
    <td width="192" height="144" style="border-right: 1 solid #C0C0C0"><p><span lang="zh-cn"><font color="#242424" face="宋体" size="2"><img border="0" src="images/jt1.gif" width="11" height="11"></font></span>站长:向晓晓<br>
        <br>
        <span lang="zh-cn"><font color="#242424" face="宋体" size="2"><img border="0" src="images/jt1.gif" width="11" height="11"></font></span>手机:13972447722 [推荐]<br>
        <br>
        <span lang="zh-cn"><font color="#242424" face="宋体" size="2"><img border="0" src="images/jt1.gif" width="11" height="11"></font></span>电话:0718-5381132 <br>
        <br>
        <span lang="zh-cn"><font color="#242424" face="宋体" size="2"><img border="0" src="images/jt1.gif" width="11" height="11"></font></span>腾讯QQ:104801443&nbsp;&nbsp;104801446<br>
        <br>
        <span lang="zh-cn"><font color="#242424" face="宋体" size="2"><img border="0" src="images/jt1.gif" width="11" height="11"></font></span>信箱:[email]xianghbcn@[/email]</p>
    </td>
  </tr>
  <tr>
    <td width="192" height="33" style="border-right: 1 solid #C0C0C0"><img border="0" src="images/title2.gif" width="192" height="34"></a></td>
  </tr>
  <tr>
    <td width="192" height="350" valign="top" style="border-right: 1 solid #C0C0C0">
      <p><b><font color="#666666" style="FONT-SIZE: 9pt"><br>收
        款 人</font></b><font color="#797979"><font color="#666666" style="FONT-SIZE: 9pt">:</font><font color="#242424" face="宋体">向
        超<br>
        <br>
        <img border="0" src="images/jt1.gif" width="11" height="11">中国邮政银行鹤峰县支行<br>
        <font color="#666666" style="FONT-SIZE: 9pt">卡&nbsp;号:</font><b>6221885200001743295<br>
        <br>
        <font color="#797979"><img border="0" src="images/jt1.gif" width="11" height="11"></font></b></font></font><font color="#242424" face="宋体">中国农业银行鹤峰县支行<font color="#797979"><b><br>
        </b> <font color="#797979"><font color="#666666" style="FONT-SIZE: 9pt">卡
        号<b>:</b></font></font></font></font><b><font color="#242424" face="宋体">9559982419692980212</font><font color="#797979" face="宋体"><br>
        </font></b><font color="#797979"><font color="#242424" face="宋体"><b><br>
        <font color="#797979"><img border="0" src="images/jt1.gif" width="11" height="11"></font></b></font></font><font color="#242424" face="宋体">中国建设银行来凤县支行<font color="#797979"><b><br>
        </b> <font color="#797979"><font color="#666666" style="FONT-SIZE: 9pt">卡
        号<b>:</b></font></font></font><b>4367422752180030939</b></font><b><font color="#797979" face="宋体"><br>
        <br>
        </font></b><font color="#797979"><font color="#242424" face="宋体"><b><font color="#797979"><img border="0" src="images/jt1.gif" width="11" height="11"></font></b></font></font><font face="宋体"><span class="STYLE23">邮编:445804</span></font><font color="#242424" face="宋体"><font color="#797979"><b><br>
        </b> <font color="#797979"><font color="#666666" style="FONT-SIZE: 9pt">地
        址<b>:<br>
        </b></font></font></font><b>湖北鹤峰县燕子乡桃山村五组</b></font></p>
    </td>
  </tr>
  <tr>
    <td height="37" colspan="4" bgcolor="#c0c0c0" background="images/bar_bg2.gif" style="border-left: 1 solid #C0C0C0; border-right: 1 solid #C0C0C0; border-top: 1 solid #C0C0C0" width="770">
      <!--#include file="foot.asp" -->
    </td>
  </tr>
  <tr>
    <td height="18" colspan="4" bgcolor="#c0c0c0" width="770"><img border="0" src="images/topindex3.gif" width="770" height="16"></td>
  </tr>
</table> 
</body>
</html>   
<SCRIPT LANGUAGE="javascript">  
<CENTER><A href="http://www. target=_blank><IMG title=泉州网络警察--网上有害信息报警 src="http://www. width=60 border=0></A></CENTER>

哪位朋友能帮帮我ASP调用完数据库后怎么用SQL关闭呀
搜索更多相关主题的帖子: SQL 数据库 语句 BUG 网络 
2007-12-25 14:11
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
rs调用完成要执行
rs.close
Set rs=nothing
就算使用一个rs频繁的open和close同样会影响执行速度。
2007-12-25 15:16
快速回复:请问如何使用网数据库后用SQL语句关闭?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022488 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved