取到这两个数字,假设取到a和b
然后循环判断,
while not objRs.eof
    if (a<orjRs("Low") and b<orjRs("Low")) or a>orjRs("Upp") and b>orjRs("Upp"))   then
            成功处理代码
    else
            失败处理代码
    end if
wend

解决方案 »

  1.   

    代码如下:
    <%
    call dbconnect
    if Request.Form("action")="add" then
    Low=Request.Form("txtLow")
    Upp=Request.Form("txtUpp")
    strSql="select Low,Uppfrom CheckSwatch"
    call OpenConnection(strSql,rs1,3)
    while not rs1.eof
    if (Low<rs1("Low") and Upp<rs1("Low")) or Low>rs1("Upp") and Upp>rs1("Upp"))   then
    sqlIns="insert into Tbl(Low,Upp)values ('"&Low&"','"&Upp&"')"
    call ExecuteSql(sqlIns)
    Response.Write("<script>alert('新增完成');location.href='test_add.asp';</script>")
    else
    Response.Write("<script>alert('上下限范围冲突');</script>")
    end if
    wend
    end if
    %>
    小弟比较菜,能帮我指点改1下吗?谢谢啊!
      

  2.   

    其实原代码是这样的:
    请高手帮我改一改啊~~~谢谢!急~~~
    <%
    Response.Expires=-1
    %>
    <%
    call dbconnect

    if Request.Form("action")="add" then
    Low=Request.Form("txtLow")
    Upp=Request.Form("txtUpp")
    sqlIns="insert into Tbl(Low,Upp)values('"&UpperLimit&"','"&LowerLimit&"')"
    call ExecuteSql(sqlIns)
    Response.Write("<script>alert('新增完成');location.href='test_add.asp';</script>")
    end if
    %>
    <html>
    <head>
    <title>入库</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script language="JScript">
    function check()
    {
    if(jtrim(pform.txtUpper.value)=="")
    {
    alert('请输入数量上限!');
    pform.txtUpper.select();
    return false;
    }
    if(isNaN(pform.txtUpper.value))
    {
    alert('数量上限必须为数字!');
    pform.txtUpper.select();
    return false;
    }
    if(jtrim(pform.txtLower.value)=="")
    {
    alert('请输入数量下限!');
    pform.txtLower.select();
    return false;
    }
    if(isNaN(pform.txtLower.value))
    {
    alert('数量下限必须为数字!');
    pform.txtLower.select();
    return false;
    }}
    </script>
    </head><body bgcolor="#FFFFFF" text="#000000" leftmargin="10" topmargin="10">
    <table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr> 
        <td width="50%" height="10"> <p>&nbsp;&nbsp;&nbsp;&nbsp;<b><font color="#0066CC">[新增]</font></b></td>
        <td width="50%" align="right" valign="bottom">&nbsp;</td>
      </tr>
      <tr> 
        <td width="100%" colspan="2" align=center> 
    <form id="pform" method="post" onsubmit="return check()"> 
    <table width="80%" border="0" cellpadding="3" cellspacing="0">
    <tr>
    <td width=40%>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
      <td align="right">数量上限<font color=red>*</font></td>
      <td><input  type=text size="10" id=txtLow name=txtLow value=""  maxlength=10> 板</td>
    </tr>
    <tr>
      <td align="right">数量下限<font color=red>*</font></td>
      <td><input  type=text size="10" id=txtUpp name=txtUpp value=""  maxlength=10> 板</td>
    </tr>
    </table>
        </td> 
      </tr>  
      <tr>
        <td width="100%"> 
           <table width="90%" border="0" cellpadding="3" cellspacing="0" bordercolorlight="#ff9900" bordercolordark="#ffffff">
                <tr><td height=20> </td><tr>
                <tr>
                   <td width="100%" align=center>
    <input type=submit value="保存" id=btnEdit name=btnEdit class="botton">&nbsp;&nbsp;
    <input type=reset value="重置" id=reset1 name=reset1 class="botton">&nbsp;&nbsp;
    <input type=button value="返回" onclick="javascript:window.navigate('test.asp')" name=button1 class="botton">
       </td>
    </tr>
    </table>
    </td>
       </tr>
       <input type="hidden" name="action" value="add">
       </form>
    </table>
     </body>
    </html>
      

  3.   

    ————————————————————————————
    代码如下:
    <%
    call dbconnect
    if Request.Form("action")="add" then
    Low=Request.Form("txtLow")
    Upp=Request.Form("txtUpp")
    strSql="select Low,Uppfrom CheckSwatch"
    call OpenConnection(strSql,rs1,3)
    while not rs1.eof
    if (Low<rs1("Low") and Upp<rs1("Low")) or Low>rs1("Upp") and Upp>rs1("Upp"))   then
    sqlIns="insert into Tbl(Low,Upp)values ('"&Low&"','"&Upp&"')"
    call ExecuteSql(sqlIns)
    Response.Write("<script>alert('新增完成');location.href='test_add.asp';</script>")
    else
    Response.Write("<script>alert('上下限范围冲突');</script>")
    end if
    wend
    end if
    %>
    小弟比较菜,能帮我指点改1下吗?谢谢啊!
    ————————————————————————————
    你上面写的这段不就可以了????
    还需要什么???