我是新手,打家帮帮忙啊
<head><meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>CMO FAB4 Report System</title>
<!--link REL="stylesheet" TYPE="text/css" HREF="../../Style/Report.css"-->
<script language="VBScript" src="../../Objects/print.vbs"></script>
</head>
<body>
<%
'----------------------------------------------------------------------
G_FAC=Request("G_FAC")
set conn = Server.CreateObject("ADODB.Connection")
conn.Open Application("LCMDB")
'----------------------------------------------------------------------
table_name1= "HM"&G_FAC&"SDEF_EQP_TACTIME"
table_name2= "HM"&G_FAC&"SHIS_IPMS"
table_name3= "HM"&G_FAC&"SHIS_EQPS"
%>
<BODY>
<center>
<table border="1" width="80%">
<tr bgcolor="pink" >
<span style="font-family:Comic Sans MS; font-size: 10pt; font-weight: bold; color:darkblue" >
<td>Acct_month</td>
<td>Prod_nbr </td>
<td>Equip_nbr</td>
<td>Tact_time</td>
<td>UPH達成率</td>
<td>Modify</td>
</span>
</tr>
<%
Server.ScriptTimeout = 360
acct_month = Request("acct_month")
vprod = Request("vprod")
eq_nbr = Request("eq_nbr")
tar=Request("tar")
tact_uph=Request("tact_uph")
'判別是否從EntityStaTactTimeMod2 來的
StrSql_w2 = " and acct_month='" & rtrim(ltrim(acct_month)) & "' "
if Instr(1,vprod, "ALL" )>0 or vprod = "()" or vprod = "" or vprod = "('')" then
else
StrSql_w = " and substr(part_nbr,1,5) in " & vprod
StrSql_w2 = StrSql_w2 & " and prod_nbr in " & vprod
end if
if Instr(1,eq_nbr, "ALL" )>0 or eq_nbr = "()" or eq_nbr = "" or eq_nbr = "('')" then
else
StrSql_w1 = " and equip_nbr in " & eq_nbr
end if
SQL = "Select fac_id,PROD_NBR,EQUIP_NBR,acct_month,TACT_TIME ,nvl(tact_uph,0) tact_uph From "&table_name1&" Where Fac_ID= '" & G_FAC &"'"& StrSql_w1 & StrSql_w2
response.Write "<br>sql:"&Sql
Set rs = Server.CreateObject("ADODB.Recordset")
if cint(tar)<>2 then
strSQL3 = "Select Distinct substr(part_nbr,1,5) SOption From "&table_name2&" Where Fac_ID='" & G_FAC &"'"& StrSql_w
response.Write "<br>strSQL3:"&strSQL3
Set oRs3 = Server.CreateObject("ADODB.Recordset")
oRs3.Open StrSQL3,Conn,3,3
tmp=""
prodnbr=""
Do While Not oRs3.EOF and Err = 0
prodnbr=prodnbr & tmp & trim(oRs3("soption"))
tmp=","
oRs3.MoveNext
Loop
oRs3.Close
Set oRs3 = Nothing
ArrTit1 = Split(prodnbr,",")
'strSQL3 = "Select distinct equip_nbr from "&table_name3&" where (equip_nbr like 'AOLB%') " & StrSql_w1 ' urey 2007.8.20
strSQL3 = "Select distinct equip_nbr from "&table_name3&" where ( equip_nbr like 'AOLB%' or equip_nbr like 'APCB%' or equip_nbr like 'ACOG%' or equip_nbr like 'AOPS%' or equip_nbr like 'ASSY%' or equip_nbr like 'CKEN%' or equip_nbr like 'DKEN%' or equip_nbr like 'PACK%') " & StrSql_w1
response.Write "<br>strSQL31:"&strSQL3
Set oRs3 = Server.CreateObject("ADODB.Recordset")
oRs3.Open StrSQL3,Conn,3,3
tmp=""
equip_nbr=""
Do While Not oRs3.EOF and Err = 0
equip_nbr=equip_nbr & tmp & trim(oRs3("equip_nbr"))
tmp=","
oRs3.MoveNext
Loop
oRs3.Close
Set oRs3 = Nothing
ArrTit2 = Split(equip_nbr,",")
i=UBound(ArrTit1)+1
j=UBound(ArrTit2)+1
redim ss(i,j)
redim suph(i,j)
RS.OPEN sql,CONN,1,3
RCount = rs.RecordCount
Do While Not Rs.EOF and Err = 0
For i = 0 to UBound(ArrTit1)
For j = 0 to UBound(ArrTit2)
if trim(rs("prod_nbr")) = trim(arrtit1(i)) and trim(rs("equip_nbr")) = trim(arrtit2(j)) then
ss(i,j)= cdbl(rs("tact_time"))
suph(i,j)= cdbl(rs("tact_uph"))
end if
next
Next
rs.movenext
loop
if Rcount>0 then
SQL1="delete from "&table_name1&" Where Fac_ID='" & G_FAC &"'"& StrSql_w1 & StrSql_w2
conn.Execute SQL1
end if
For i = 0 to UBound(ArrTit1)
For j = 0 to UBound(ArrTit2)
rs.AddNew
rs("FAC_ID") =G_FAC
rs("acct_month") = rtrim(ltrim(acct_month))
rs("prod_nbr") = trim(arrtit1(i))
rs("equip_nbr") = trim(arrtit2(j))
if cdbl(ss(i,j))=0 then
rs("tact_time") = 25
else
rs("tact_time") = cdbl(ss(i,j))
'if cdbl(suph(i,j))=0 then
'rs("tact_uph")=cdbl(suph(i,j))
end if
rs.Update
next
Next
rs.close
end if
RS.OPEN sql,CONN,3,3
RCount = rs.RecordCount
i=0
Do While Not rs.EOF and Err = 0
i=i+1
M_acct_MONTH = rs.Fields("acct_MONTH").Value
M_PROD_NBR= rs.Fields("PROD_NBR").Value
M_equip_nbr = rs.Fields("equip_nbr").Value
M_tact_time = rs.Fields("tact_time").Value
M_tact_uph = rs.Fields("tact_uph").Value%>
<tr><form method="POST" action="EntityStaTactTimeMod1.asp" name="frm">
<td bgcolor="#99FFCC"><input type="text" name="acct_month" style="font-family:Comic Sans MS; font-size: 10pt; font-weight: bold; color:darkblue" readonly value="<%=M_acct_MONTH%>"></td>
<td bgcolor="#99FFCC"><input type="text" name="PROD_NBR" size="20" maxlength=3 value="<%=M_PROD_NBR%>" style="font-family:Comic Sans MS; font-size: 10pt; font-weight: bold" readonly></td>
<td bgcolor="#99FFCC"><input type="text" name="equip_nbr" style="font-family:Comic Sans MS; font-size: 10pt; font-weight: bold; color:darkblue" readonly value="<%=M_equip_nbr%>"></td>
<td bgcolor="#99FFCC"><input type="text" name="tact_time" size="20" maxlength=6 value="<%=M_tact_time%>" style="font-family:Comic Sans MS; font-size: 10pt; font-weight: bold" readonly></td>
<td bgcolor="#99FFCC"><input type="text" name="tact_uph" size="20" maxlength=6 value="<%=M_tact_uph%>" style="font-family:Comic Sans MS; font-size: 10pt; font-weight: bold" readonly></td>
<td bgcolor="#99FFCC"><input type="submit" value="修改" name="upd<%=i%>" style="font-family:Tahoma; font-size: 9pt; color:#fac896;BACKGROUND-COLOR: #3264c8"></td>
<input type="hidden" name="RCount" value="<%=RCount%>">
<input type="hidden" name="eq_nbr" value="<%=eq_nbr%>">
<input type="hidden" name="vprod" value="<%=vprod%>">
<input type="hidden" name="PROD_NBRLIST" value="<%=PRODNBR%>">
<input type="hidden" name="G_FAC" value=<%=G_FAC%>>
</form>
</tr>
<%Rs.MoveNext
Loop
rs.close
set conn =nothing
%>
</table>
</body>
</HTML>
这个程序执行了,uph这个栏位修改了当时可以显示,但是刷新一下又不见了,变成初始值了,是怎么回事 啊,其他两个tact_time修改了都可以保存