标题:ASP如何实现FORM多参写入数据库
取消只看楼主
ashimaxigo
Rank: 2
等 级:论坛游民
帖 子:29
专家分:17
注 册:2012-12-24
结帖率:75%
已结贴  问题点数:10 回复次数:3 
ASP如何实现FORM多参写入数据库
档位    AB    BC    CA    误差
1    变量    变量    变量    变量
…    变量    变量    变量    变量
n    变量    变量    变量    变量
自己搞定,还是谢谢hu9jj哥们对我的支持!


[ 本帖最后由 ashimaxigo 于 2013-1-17 23:01 编辑 ]
搜索更多相关主题的帖子: 数据库 如何 
2013-01-17 00:18
ashimaxigo
Rank: 2
等 级:论坛游民
帖 子:29
专家分:17
注 册:2012-12-24
得分:0 
能详细点吗老兄
2013-01-17 19:05
ashimaxigo
Rank: 2
等 级:论坛游民
帖 子:29
专家分:17
注 册:2012-12-24
得分:0 
我要是这样写,结果传入什么值,是不是只更新一行

<%@language=vbscript%>
<!--#include file="conn.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from zhizgy"
rs.open sql,conn,1,3
dim nMax,nMin,a,b,c,n,n1,n2,s,i
    if gdangw=request("gdangw1") then
        a=request("gya01")
    b=request("gyb01")
    c=request("gyc01")
       else
          gdangw=gdangw+1
        a=request("gya02")
    b=request("gyb02")
    c=request("gyc02")
       else
          gdangw=gdangw+2
        a=request("gya03")
    b=request("gyb03")
    c=request("gyc03")
       else
          gdangw=gdangw+3
        a=request("gya04")
    b=request("gyb04")
    c=request("gyc04")
       else
          gdangw=gdangw+4
        a=request("gya05")
    b=request("gyb05")
    c=request("gyc05")
       else
          gdangw=gdangw+5
        a=request("gya06")
    b=request("gyb06")
    c=request("gyc06")
       else
          gdangw=gdangw+6
        a=request("gya07")
    b=request("gyb07")
    c=request("gyc07")
       else
          gdangw=gdangw+7
        a=request("gya08")
    b=request("gyb08")
    c=request("gyc08")
       else
          gdangw=gdangw+8
    a=request("gya09")
    b=request("gyb09")
    c=request("gyc01")
       else
          gdangw=gdangw+9
        a=request("gya10")
    b=request("gyb10")
    c=request("gyc10")
       else
          gdangw=gdangw+10
        a=request("gya11")
    b=request("gyb11")
    c=request("gyc11")
       else
          gdangw=gdangw+11
        a=request("gya12")
    b=request("gyb12")
    c=request("gyc12")
       else
          gdangw=gdangw+12
        a=request("gya13")
    b=request("gyb13")
    c=request("gyc13")
       else
          gdangw=gdangw+13
        a=request("gya14")
    b=request("gyb14")
    c=request("gyc14")
       else
          gdangw=gdangw+14  
        a=request("gya15")
    b=request("gyb15")
    c=request("gyc15")
       else
          gdangw=gdangw+15
        a=request("gya16")
    b=request("gyb16")
    c=request("gyc16")
       else
          gdangw=gdangw+16   
        a=request("gya17")
    b=request("gyb17")
    c=request("gyc17")
       else
          gdangw=gdangw+17
        a=request("gya18")
    b=request("gyb18")
    c=request("gyc18")
       else
          gdangw=gdangw+18  
        a=request("gya19")
    b=request("gyb19")
    c=request("gyc19")
       end if
    nMax=a
    nMin=a     
       if (a>b) and (b>c)then
        nMax=a
        nMin=c
        end if
      
       if (a>c) and (c>b)then
        nMax=a
        nMin=b
       end if
      
       if (b>a) and (a>c)then
        nMax=b
        nMin=c
       end if
      
       if (b>c) and (c>a)then
        nMax=b
        nMin=a
       end if
      
       if (c>a) and (a>b)then
        nMax=c
        nMin=b
       end if
      
       if (c>b) and (b>a)then
        nMax=c
        nMin=a
       end if
      
       if (a=b) and (a>c)then
        nMax=a'也等于b
        nMin=c
       end if
       if (a=b) and (a<c)then
        nMax=c
        nMin=a
       end if
      
       if (b=c) and (b>a)then
        nMax=b'也等于c
        nMin=a
       end if
       if (b=c) and (b<a)then
        nMax=a
        nMin=b
       end if
      
       if (c=a) and (c>b)then
        nMax=c'也等于a
        nMin=b
       end if
       if (c=a) and (c<b)then
        nMax=b
        nMin=c
       end if
      
       if (a=b) and (b=c)then
        s=0
       end if
      s=((nMax-nMin)/nMin)
    rs.addnew
    rs("gya0")=a
    rs("gyb0")=b
    rs("gyc0")=c
    rs("gwuc")=s
 rs("gdangw")=gdangw
    rs.update
    rs.movenext
%>
2013-01-17 21:40
ashimaxigo
Rank: 2
等 级:论坛游民
帖 子:29
专家分:17
注 册:2012-12-24
得分:0 
编译不通过,改成这样了却提示溢出:
<%@language=vbscript%>
<!--#include file="conn.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from zhizgy"
rs.open sql,conn,1,3
dim nMax,nMin,a,b,c,n,n1,n2,s,i
       if gdangw=request("gdangw1") then
           a=request("gya01")
       b=request("gyb01")
       c=request("gyc01")
       end if
       if   gdangw=gdangw+1 then
              a=request("gya02")
       b=request("gyb02")
       c=request("gyc02")
       end if
       if  gdangw=gdangw+2  then
              a=request("gya03")
       b=request("gyb03")
       c=request("gyc03")
       end if
       if  gdangw=gdangw+3 then
              a=request("gya04")
       b=request("gyb04")
       c=request("gyc04")
       end if
       if gdangw=gdangw+4 then
              a=request("gya05")
       b=request("gyb05")
       c=request("gyc05")
       end if
       if  gdangw=gdangw+5 then
              a=request("gya06")
       b=request("gyb06")
       c=request("gyc06")
       end if
       if  gdangw=gdangw+6 then
              a=request("gya07")
       b=request("gyb07")
       c=request("gyc07")
       end if
       if  gdangw=gdangw+7 then
              a=request("gya08")
       b=request("gyb08")
       c=request("gyc08")
       end if
       if  gdangw=gdangw+8 then
       a=request("gya09")
       b=request("gyb09")
       c=request("gyc01")
       end if
       if  gdangw=gdangw+9 then
           a=request("gya10")
       b=request("gyb10")
       c=request("gyc10")
       end if
       if  gdangw=gdangw+10 then
           a=request("gya11")
       b=request("gyb11")
       c=request("gyc11")
       end if
       if  gdangw=gdangw+11 then
           a=request("gya12")
       b=request("gyb12")
       c=request("gyc12")
       end if
       if  gdangw=gdangw+12 then
           a=request("gya13")
       b=request("gyb13")
       c=request("gyc13")
       end if
       if  gdangw=gdangw+13 then
           a=request("gya14")
       b=request("gyb14")
       c=request("gyc14")
       end if
       if  gdangw=gdangw+14 then
           a=request("gya15")
       b=request("gyb15")
       c=request("gyc15")
       end if
       if  gdangw=gdangw+15  then
           a=request("gya16")
       b=request("gyb16")
       c=request("gyc16")
       end if
       if  gdangw=gdangw+16     then  
           a=request("gya17")
       b=request("gyb17")
       c=request("gyc17")
       end if
       if  gdangw=gdangw+17 then
           a=request("gya18")
       b=request("gyb18")
       c=request("gyc18")
       end if
       if  gdangw=gdangw+18 then
           a=request("gya19")
       b=request("gyb19")
       c=request("gyc19")
       end if
       nMax=a
       nMin=a           
       if (a>b) and (b>c)then
           nMax=a
           nMin=c
           end if
      
       if (a>c) and (c>b)then
           nMax=a
           nMin=b
       end if
      
       if (b>a) and (a>c)then
           nMax=b
           nMin=c
       end if
      
       if (b>c) and (c>a)then
           nMax=b
           nMin=a
       end if
      
       if (c>a) and (a>b)then
           nMax=c
           nMin=b
       end if
      
       if (c>b) and (b>a)then
           nMax=c
           nMin=a
       end if
      
       if (a=b) and (a>c)then
           nMax=a'也等于b
           nMin=c
       end if
       if (a=b) and (a<c)then
           nMax=c
           nMin=a
       end if
      
       if (b=c) and (b>a)then
           nMax=b'也等于c
           nMin=a
       end if
       if (b=c) and (b<a)then
           nMax=a
           nMin=b
       end if
      
       if (c=a) and (c>b)then
           nMax=c'也等于a
           nMin=b
       end if
       if (c=a) and (c<b)then
           nMax=b
           nMin=c
       end if
      
       if (a=b) and (b=c)then
           s=0
       end if
      s=((nMax-nMin)/nMin)
    rs.addnew
    rs("gya0")=a
    rs("gyb0")=b
    rs("gyc0")=c
    rs("gwuc")=s
    rs("gdangw")=gdangw
    rs.update
    rs.movenext
%>

2013-01-17 22:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-396835-1-1.html




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

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