⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 一个测试数据库连接的函数.htm

📁 较为详细的介绍了asp自定义的各种函数,方便asp的各种开发.
💻 HTM
📖 第 1 页 / 共 2 页
字号:
        <TR bgColor=#3366ff>
          <TD height=2></TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD>
    <TD class=p2 width=102></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
  <TBODY>
  <TR>
    <TD height=1></TD></TR>
  <TR bgColor=#ffcc00>
    <TD align=right height=23 width=355>
      <CENTER></CENTER>
      <P align=center>中国动感资源交流,网络动感资源荟萃</P></TD>
    <TD align=middle>
      <P align=center><A href="http://www.moonet.com/edu/">教育网</A>&nbsp; 
    英文版</P></TD></TR></TBODY></TABLE>
<CENTER>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
  <TBODY>
  <TR vAlign=top>
    <TD bgColor=#297dff width=1> </TD>
    <TD width=753></TD>
    <TD bgColor=#297dff width=1> </TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
  <TBODY>
  <TR vAlign=top>
    <TD bgColor=#297dff width=1> </TD>
    <TD width=753>
      <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
        <TBODY>
        <TR>
          <TD bgColor=#297dff colSpan=2 height=20><FONT color=#ceffff>&nbsp;→ 
            <A href="http://www.aspsky.net/article/index.asp?classid=2"><FONT 
            color=#ceffff>ASP技术</FONT></A> &gt;&gt; <A 
            href="http://www.aspsky.net/article/index.asp?classid=2&amp;Nclassid=10"><FONT 
            color=#ceffff>数据库相关</FONT></A> &gt;&gt; 《一个测试数据库连接的函数》</FONT></TD></TR>
        <TR>
          <TD bgColor=#586011 colSpan=2 height=1><SPACER type="block" 
            width="1"></TD></TR>
        <TR>
          <TD colSpan=2 height=7></TD></TR>
        <TR>
          <TD align=middle class=p4 
            colSpan=2><B>一个测试数据库连接的函数</B></FONT><BR>2002-5-31&nbsp;&nbsp;动网先锋 
        </TD></TR>
        <TR>
          <TD class=p4 colSpan=2>
            <BLOCKQUOTE><BR>以前一直困扰我的一个问题,如何判断数据库连接是否成功(比如sql没有启动,数据库不存在等),实现友好的错误处理,但vbscript的错误处理机制实在太差,只有on 
              error resume nex/go 
              to,但往往使用ADO的错误陷阱后,等待你的将是脚本超时,这个函数将改变这一状况(连接超时长短可以自己根据实际情况控制)
              <P></P>
              <P>'入口参数:连接字符串strconn<BR>'返回值:TestConnection=true,false</P>
              <P>Function TestConnection(strconn)<BR>On Error Resume Next<BR>set 
              conn=server.createobject("adodb.connection")<BR>'这里设定连接超时为10秒<BR>conn.ConnectionTimeout=10<BR>conn.Open 
              strconn<BR>If conn.Errors.Count = 0 Then<BR>TestConnection = 
              True<BR>conn.close<BR>Else<BR>TestConnection = False<BR>End 
              If<BR>set conn=nothing<BR>End 
          Function<BR><BR><BR></P></BLOCKQUOTE></TD></TR>
        <TR>
          <TD class=p4 vAlign=top width="50%">
            <BLOCKQUOTE>原作者:seal<BR>来 源:开发者俱乐部<BR>共有5107位读者阅读过此文<BR>【<A 
              href="http://bbs.aspsky.net/list.asp?boardid=1">发表评论</A>】 
            </BLOCKQUOTE></TD>
          <TD class=p4 vAlign=top width="50%">
            <P>
            <LI><FONT color=#0772b1>上篇文章</FONT>:<A 
            href="http://www.aspsky.net/article/list.asp?id=2732">js的单元格颜色间隔</A> 
            <BR>
            <LI><FONT color=#0772b1>下篇文章</FONT>:<A 
            href="http://www.aspsky.net/article/list.asp?id=2734">清空iis log 
            中自己登录ip的vbs</A> </LI></TD></TR>
        <TR>
          <TD bgColor=#297dff class=p4 height=20 width="50%"><FONT 
            color=#ceffff>&nbsp;→ 本周热门</FONT></TD>
          <TD bgColor=#297dff class=p4 width="50%"><FONT color=#ceffff>&nbsp;→ 
            相关文章</FONT></TD></TR>
        <TR>
          <TD bgColor=#586011 colSpan=2 height=1><SPACER type="block" 
            width="1"></TD></TR>
        <TR>
          <TD colSpan=2 height=7></TD></TR>
        <TR>
          <TD class=p4 vAlign=top width="50%">
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1510" 
            target=_top title="SQL Server 7.0 入门(一)">SQL Server 7.0 
            入门(...</A>[<FONT color=red>7239</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1540" 
            target=_top title=PHP4实际应用经验篇(1)>PHP4实际应用经验篇(1)</A>[<FONT 
            color=red>7135</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1536" 
            target=_top 
            title=无组件文件上传代码实例(支持多文件上传及文件和input域混合上传)>无组件文件上传代码实例(支持多文件上...</A>[<FONT 
            color=red>6029</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=2557" 
            target=_top title=树型结构在ASP中的简单解决>树型结构在ASP中的简单解决</A>[<FONT 
            color=red>5757</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1545" 
            target=_top title=PHP4实际应用经验篇(6)>PHP4实际应用经验篇(6)</A>[<FONT 
            color=red>5599</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=2563" 
            target=_top title=一个老个写的无组件上传>一个老个写的无组件上传</A>[<FONT 
            color=red>5013</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1542" 
            target=_top title=PHP4实际应用经验篇(3)>PHP4实际应用经验篇(3)</A>[<FONT 
            color=red>4731</FONT>]<BR></LI></TD>
          <TD class=p4 vAlign=top width="50%">
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=2733">一个测试数据库连接的函数</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=2490">ADO连接数据库字符串大全(VP,Excel,文本,Sybase,.NET等)</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=1945">在config.web中保存数据库连接串</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=1470">asp+中是如何连接数据库ado+的</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=848">PHP4连接Oracle 
            8i的方法(转译)</A><BR></LI></TD></TR>
        <TR>
          <TD colSpan=2 height=7></TD></TR></TBODY></TABLE>
    <TD bgColor=#297dff width=1> </TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
  <TBODY>
  <TR>
    <TD bgColor=#297dff height=1><SPACER type="block" 
width="1"></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
  <TBODY>
  <TR>
    <TD align=middle height=30></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
  <TBODY>
  <TR>
    <TD align=middle class=p2 width="100%">
      <TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
        <TBODY>
        <TR>
          <TD align=middle class=p2 width="100%">
            <P align=center><A 
            href="http://www.aspsky.net/produce/index.asp">客户服务</A> -- <A 
            href="http://www.aspsky.net/aspads.asp">广告合作</A> -- <A 
            href="http://www.aspsky.net/about.asp">关于本站</A> -- <A 
            href="http://www.aspsky.net/tell.asp">联系方法</A><BR><BR>动网先锋版权所有 <FONT 
            face=Verdana, size=1 Arial, Helvetica, sans-serif>Copyright &copy; 
            2000-2001 <B>AspSky<FONT color=#cc0000>.Net</FONT></B>, All Rights 
            Reserved .</FONT> 
</P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></CENTER></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -