dim con
dim rs
set con=createobject("adodb.connection")
con.open "你的连接"
set rs=createobject("adodb.recordset")
rs.open "select count(*) as cnt from tb",con,1,3if rs.fields("cnt").value>5000 then 
   'alert '弹出信息,这我不写了,你应该会写.'
   response.sendredirect ("首页.asp")
end ifrs.close
大概是这样..
没学过..以前看过一下.

解决方案 »

  1.   

    conn.asp<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <%
    set conn=Server.CreateObject("ADODB.connection")
    connStr="Driver={SQL Server};database=wxDB;uid=wx;pwd=wx;server=(local)"
    conn.open connStr
    conn.cursorlocation=3
    %>
      

  2.   

    login.asp<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head><body>
    <script language="javascript">
    function check()
    {
    if(document.form1.userName.value=="")
    {
    alert("请输入用户名!");
    document.form1.userName.focus();
    return false;
    }
    if(document.form1.password.value=="")
    {
    alert("请输入密码!");
    document.form1.password.focus();
    return false;
    }
    return true;
    }
    </script>
    <form id="form1" name="form1" method="post" action="loginAction.asp">
      <table width="214" border="1">
        <tr>
          <td width="49" align="center">用户名</td>
          <td width="149" align="center"><label>
            <input name="userName" type="text" id="userName" size="18" />
          </label></td>
        </tr>
        <tr>
          <td align="center">密 码</td>
          <td align="center"><label>
            <input name="password" type="password" id="password" size="20" />
          </label></td>
        </tr>
        <tr>
          <td colspan="2" align="center"><label>
            <input type="submit" name="button" id="button" value="提交" onclick="return check()" />
          </label></td>
        </tr>
      </table>
    </form>
    </body>
    </html>
      

  3.   


    <!--#include file=conn.asp-->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <%
    dim counts
    sql="Select count(*) as cou from table"
    set rs=conn.execute(sql)
    counts=rs("cou")
    if counts>=5000 then
    Response.Write("<script>alert('弹出信息!');location.href='转向页面.asp';</script>")
    end if%>
      

  4.   

    忘关闭结果集了,下面代码加在end if后rs.close
    set rs=nothing
    conn.close
    set conn=nothing