How to implement ASP to add multiple records at the same time

Source: Internet
Author: User

Hello everyone, my form is like this, I also want to input three data, after completing one,

I click Continue to add, again appears an empty, let me continue to add,

I'm so anxious, I hope you can help,

The code is as follows

<!--#include file= "Common.inc"-->
<%
self= "Inputzqgl.asp"
Tabname= "Tab_2007_5"
tabcap= "The Operation table of the key steam injection boiler in Liaohe oilfield [data entry]"
%>
<%if session ("Manager") <>1 then Dw=session ("DW")%>
<!--#include file= "mouse1.asp"-->
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<title><%=tabcap%></title>
<style>
<!--
TD {Font-size:9pt; Text-align=center}
Input {font-size:9pt}
-->
</style>
<body background= "D_102702.gif" leftmargin=0>
<%
If Request.ServerVariables ("request_method") = "Get" Then
%>
<script language=vbscript>
<!--
Sub Message (STR)
F1.t.value=str
End Sub
Sub Check ()
Yn=msgbox ("Do you really want to submit?", 36, "hint")
If yn=6 Then
F1.submit
End If
End Sub
-->
</SCRIPT>
<script language=javascript>
function Jym (obj)
{
if (isNaN (Obj.value))
{
Alert ("The date contains illegal characters!");
Obj.focus ();
Obj.select ();
}
Else
{
Str=obj.value;
Str1=str.substring (0,4);
Str2=str.substring (4,8);
OBJ.VALUE=STR2;

if ((str1>9999) | | (str1<1) | | (str2<1) | | (str2>12) | | (str.length<8))
{
Alert ("Incorrect date!")
Obj.focus ();
Obj.select ();
}
}

}
function Jy (obj,f)
{
if (isNaN (Obj.value))
{
Alert (Please enter a number.) ");
Obj.focus ();
Obj.select ();
}
else if (obj.value>f)
{
Alert ("The input number is out of range.") ");
Obj.focus ();
Obj.select ();
}
}

function JZ (obj)
{
if (isNaN (Obj.value))
{
Alert (Please enter a number.) ");
Obj.focus ();
Obj.select ();
}

}
</script>
<form name= "F1" action= "<%=self%>" method= "POST" >
<table width= "105%" cellspacing= "0" cellpadding= "0" >
<caption>
</caption>
&LT;TR&GT;&LT;TD colspan= "3" >
&LT;TD align= "center" width= "30%" ><input type= "text" name= "T" size= "the" readonly style= "Text-align:center" > &LT;/TD&GT;&LT;TD align=center width= "16%" ></td>
<table border= "1" width= "100%" cellspacing= "0" bordercolordark= #FFFFFF bordercolorlight= #000000 >
<tr>
&LT;TD width= "6%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Date </font></td >
&LT;TD width= "9%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Oil field &LT;/FONT&GT;&LT;/TD >
&LT;TD width= "11%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Category 1</font></ Td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Category 2</font></ Td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Station No. </font></ Td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Boiler model </font></ Td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Fuel species </font></ Td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Fuel consumption <br> (T) < /font></td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Period steam Injection <br> (t) < /font></td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Average displacement <br> (t/d) </font></td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Average degree of dryness <br> (%) </ Font></td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Period run time <br> (hours) </font></td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Effective run rate <br> (%) </font></td>
&LT;TD width= "5%" rowspan= "2" align= "center" nowrap bgcolor= "#FFCC99" ><font size= "2" > Remarks </font></td >
</tr>
<tr align=center>
<% if session ("Manager") =1 Then
Set Orasession=createobject ("Oracleinprocserver.xorasession")
Set oradatabase = orasession.createdatabase (orahost,orauser& "/" &orapasswd,0)
Set Oradynaset = Oradatabase.createdynaset ("Select Danwei from Yonghu where manager<> ' 1 ' and include= ' 1 '", 0)
Dwstr= ""
Todo
dwstr=dwstr& "<option value=" "&oradynaset (0) &" ">" & Mid (Oradynaset (0), 2) & "</option > "
Oradynaset.movenext
Loop until oradynaset.eof
Oradynaset.close
Oradatabase.close
dwstr=dwstr& "</SELECT>"
End If
function Dwoutput (stemp)
If session ("Manager") <>1 Then
Response.Write Mid (dw,2) & "<input type=" "Hidden" "name=" "" &stemp& "DW" "value=" "&dw&" ">"
Else
Response.Write "<select name=" &stemp& "dw>" &dwstr
End If
End Function
%>

<tr align=right>
<TD nowrap align= "center" height= "Width=" >

<input type= "text" name= "T0" size=10 maxlength=10 value= "<%=date%>" style= "font-size:12px" ></td>
&LT;TD nowrap align= "center" height= "width=" "WU" ><%dwoutput ("")%></td>
&LT;TD width= "5%" nowrap>
<select name= "Select" >
<option value= "Fuel structure adjustment" > Fuel structure Adjustment </option>
<option value= "Exploration Bureau and External Team Service" > Exploration Bureau and External Team Services </option>
<option value= "key blocks or major pilot projects" > key blocks or major pilot projects </option>
</select>
</td>
&LT;TD width= "5%" nowrap>
<select name= "Select2" >
<option value= "QI 40 block Steam Drive" > Qi 40 Steam Drive </option>
<option value= "du 84 block Sagd" > du 84 block sagd</option>
</select>
</td>
&LT;TD width= "5%" nowrap><input type= "text" Name=<%=line%>t5 size= "8" maxlength= "8" value= "0" onFocus= " Message (' Numeric field, 99999.99 ') "onblur=" Javascript:jy (this,99999.9999) "> </td>
&LT;TD width= "5%" nowrap>
<select name= "Select3" >
<option value= "Yzf50-17-p" >YZF50-17-P</option>
<option value= "Yzf9-21-p" >YZF9-21-P</option>
<option value= "Yzf20-17-p" >YZF20-17-P</option>
<option value= "Yzf20-17-p" >YZF20-17-P</option>
<option value= "Yzf20-17-p" >YZF20-17-P</option>
<option value= "Yzf23-17-p" >YZF23-17-P</option>
<option value= "Yzf11-21-p" >YZF11-21-P</option>
<option value= "Sf-9.2/17.9-yq" >SF-9.2/17.9-YQ</option>
</select>
</td>
&LT;TD width= "5%" nowrap>&nbsp;
<select name= "Select4" >
<option value= "Oil" > Oil </option>
<option value= "Gas" > Gas </option>
<option value= "residue oil" > Residue </option>
<option value= "Mixed oil" > Mixed oil </option>
<option value= "Hot gas" > Hot gas </option>
<option value= "Water coke slurry" > Water Coke Slurry </option>
<option value= "Gas" > Gas </option>
</select>
</td>
&LT;TD width= "5%" nowrap><input type= "text" Name=<%=line%>t6 size= "8" maxlength= "8" value= "0" onFocus= " Message (' Numeric field, 99999.99 ') "onblur=" Javascript:jy (this,99999.9999) "> </td>
&LT;TD width= "5%" nowrap><input type= "text" Name=<%=line%>t7 size= "8" maxlength= "8" value= "0" onFocus= " Message (' Numeric field, 99999.99 ') "onblur=" Javascript:jy (this,99999.9999) "> </td>
&LT;TD width= "6%" nowrap><input type= "text" Name=<%=line%>t8 size= "8" maxlength= "8" value= "0" onFocus= " Message (' Numeric field, 99999.99 ') "onblur=" Javascript:jy (this,99999.9999) "> </td>
&LT;TD width= "5%" nowrap><input type= "text" Name=<%=line%>t9 size= "8" maxlength= "8" value= "0" onFocus= " Message (' Numeric field, 99999.99 ') "onblur=" Javascript:jy (this,99999.9999) "> </td>
&LT;TD width= "6%" nowrap><input type= "text" name=<%=line%>t10 size= "8" maxlength= "8" value= "0" onFocus= " Message (' Numeric field, 99999.99 ') "onblur=" Javascript:jy (this,99999.9999) "> </td>
&LT;TD width= "5%" nowrap><input type= "text" name=<%=line%>t11 size= "8" maxlength= "8" value= "0" onFocus= " Message (' Numeric field, 99999.99 ') "onblur=" Javascript:jy (this,99999.9999) "> </td>
&LT;TD width= "5%" nowrap><input type= "text" name=<%=line%>t12 size= "M" > </td>

</tr>
</table>
</td>
</tr>
<tr><center>
&LT;TD colspan=3 align= "center" ><br><input type= "button" value= "Submit" onclick= "Check ()" >&nbsp; &nbsp;&nbsp;&nbsp;<input type= "reset" value= "Recovery" >&nbsp;&nbsp;&nbsp;&nbsp;< Input type= "button" value= "continue adding" onclick= "check ()" ></td></center>
</tr>
</table>

</form>
<%elseif Request.ServerVariables ("request_method") = "POST" then%>
<%
Dim T (30)
For J=1 to 30
T (j) =null
Next

Ga=request ("T0")
T (1) =cdate (Request ("T0"))
T (2) =CSTR (Request ("DW")
T (3) =request ("select")
T (4) =request ("Select2")
T (5) =request ("T5")
T (6) =request ("Select3")
T (7) =request ("Select4")
T (8) =request ("T6")
T (9) =request ("T7")
T (=request) ("T8")
T (one) =request ("T9")
T (=request) ("T10")
T (=request) ("T11")
T (=request) ("T12")
Rq=cdate (t (1)) & "-" & Month (T (1)) & "-" & Day (T (1))

' Rq1=dateadd ("M", 1,RQ)
Set Orasession=createobject ("Oracleinprocserver.xorasession")
Set oradatabase = orasession.createdatabase (orahost,orauser& "/" &orapasswd,0)
Set Oradynaset = Oradatabase.createdynaset ("SELECT * from" &tabname& "where dw= '" & T (2) & "and To_char ( RQ, ' yyyymmdd ') = ' "& Datestr (RQ) &" ", 0)

If Oradynaset.bof and oradynaset.eof then
Oradynaset.dbaddnew
For J=1 to 14
Oradynaset.fields (j-1). Value=t (j)
Next
Oradynaset.dbupdate
%>
<p align= "center" ><strong><font face= "song Body" size= "4" color= "#FF0000" > Submitted successfully. </font></strong></p>
<%else%>
<p align= "center" ><strong><font face= "song Body" size= "4" color= "#FF0000" > Submission was unsuccessful and data already exists. </font></strong></p>
<%end if
%>
<%
Oradynaset.close
Oradatabase.close
%>

<%end if%>
<font size= "2" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><a href= "jsnblr.asp" target= "_top" ><font size= "2" ></font></a><font size= "2 ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.