一定給分

顺子 2004-08-05 08:57:53
為什麼,我存了testspl2里存不起去呀
<!--#include file="GetConnStr.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>樣品需求申請單</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<script language="javascript">
function checkfield(btn){
var form = document.form1;
btn.disabled = true;
form.submit();
}
</script>
<body>
<%
connstr = Get6204ConnStr()
Set conn = Server.CreateObject("ADODB.connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.open connstr
num=request("number")
date1=request("datereply")
if Request("stype") = "squery" then
sqla="select NUM from testspl1 where NUM='"&num&"'"
rs.open sqla,conn,3,3
if not rs.eof then
sqlb="update testspl1 set datereply='"&date1&"' where NUM='"&num&"'"
conn.execute sqlb
'ddate=cdate(date1)
'sdate1=year(ddate)&"/"& month(ddate)&"/"&day(ddate)
else
sql="insert into testspl1(NUM,DATEREPLY) VALUES('"&num&"','"&date1&"')"
conn.execute sql
end if
end if
if request.QueryString("ctype")="add" then
num=request.Form("number")
ser_no=request.Form("ser_no")
hisdate=request.Form("hisdate")
cond=request.Form("cond")
source1=request.Form("source")
condsta=request.Form("condsta")
solution=request.Form("solution")
sqlx="insert into TESTSPL2(NUM,SER_NO,HISDATE,COND,SOURCE,CONDSTA,SOLUTION) VALUES('"&num&"','"&ser_no&"','"&hisdate&"','"&cond&"','"&source1&"','"&condsta&"','"&solution&"')"
conn.execute(sqlx)
'sql="select * from testspl2 order by num desc"
'rs.open sql,conn,1,2
'rs.addnew
'rs("ser_no")=ser_no
'rs("hisdate")=hisdate
'rs("cond")=cond
'rs("source")=source1
'rs("condsta")=condsta
'rs("solution")=solution
'rs.update
'response.end
end if %>
<form name="form1" method="post" action="abc.asp">
<table width="100%" border="1" cellspacing="0">
<tr>
<td width="6%">樣品單號</td>
<td width="18%"><input name="number" type="text" size="10" value="<%=request("number")%>"></td>
<td width="25%"> </td>
<td width="17%"> </td>
<td width="18%"> </td>
<td width="16%"> </td>
</tr>
<tr>
<td>回覆時間</td>
<td >
<Div align="left" id="text_div"></DIV>
<div align="right">
<input type="button" value="新增" onclick="document.all.text_div.innerHTML='<input type=text name=datereply size=10 >'">
</div>
<td><div align="left"><input type="button" name="upinsert" value="按鈕" onClick="checkfield(this);">
<input name="stype" type="hidden" value="squery" size="8"> <!--<a href="aaa.asp?action=change">送出</a>--></div>
</td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="6">樣品制樣過程紀錄
<%
num=trim(request("number"))
sql="select ser_no,hisdate,cond,source,condsta,solution from testspl2 where num='"&num&"' "
set rsa=conn.execute(sql)
If not rsa.eof Then
ssql="select convert(int,isnull(MAX(SER_NO),0)) AS SNO from testspl1 a,testspl2 b where b.num='"&num&"' and a.num=b.num "
rs.open ssql,conn,3,3
tab1=rs("sno")
end if
if request.QueryString("tab")="" Then%>
<input type="button" name="新增紀錄" value="新增紀錄" onClick="javascript:window.location.href='abc.asp?tab=1'">
<% else %>
<input type="button" name="新增紀錄" value="新增紀錄" onClick="javascript:window.location.href='abc.asp?tab=<%=cint(request.QueryString("tab")+1) %>'">
<% End If %>
</tr>
</table>
<table width="100%" border="1" cellspacing="0">
<tr>
<td>項次</td>
<td>紀錄日期</td>
<td>狀況</td>
<td>訊息來源</td>
<td>狀況別</td>
<td>處理對策</td>
</tr>
</table>
<% do while not rsa.eof %>
<table width="100%" border="1" align="center" cellspacing="0">
<tr>
<td width="17%"><div align="center"><%= rsa("SER_NO") %></div></td>
<td width="17%"><div align="center"><%= rsa("HISDATE") %></div></td>
<td width="14%"><div align="center"><%= rsa("COND") %></div></td>
<td width="18%"><div align="center"><%= rsa("SOURCE") %></div></td>
<td width="17%"><div align="center"><%= rsa("CONDSTA") %></div></td>
<td width="17%" colspan="2"><div align="center"><%= rsa("SOLUTION") %></div></td>
</tr>
</table>
<% rsa.movenext
loop
if request.QueryString("tab")=""then
n=0
else
n=request.QueryString("tab")
end if
for i=1 to n
%>
<table width="100%" border="1" cellspacing="0">
<tr>
<td width="7%"><input name="ser_no" type="text" value="<%= right("00"&cint(tab1+i),2) %>" size="10"></td>
<td width="17%"><input name="hisdate" type="text" id="hisdate" size="10"></td>
<td width="17%"><input name="cond" type="text" id="cond" size="10"></td>
<td width="18%"><input name="source" type="text" id="source" size="10"></td>
<td width="16%"><input name="condsta" type="text" id="condsta" size="10"></td>
<td width="16%"><input name="solution" type="text" id="solution" size="10"></td>
<td width="9%"><input type="button" name="isert" value="存檔" onClick="checkfield(this);">
<input name="ctype" type="hidden" value="add" size="8">
<!-- <div align="center"> <a href="abc.asp?action=add&ser_no=<%'= right("00"&cint(tab1+i),2) %>" >存檔</a></div></td>-->
</tr>
</table>
<%next%>
<table width="100%" border="1" cellspacing="0">
<tr>
<td colspan="6">樣品室備泩:</td>
</tr>
</table>
</form>
</body>
</html>
...全文
99 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
顺子 2004-08-05
  • 打赏
  • 举报
回复
大哥幫個忙嘛
看看
jervis82 2004-08-05
  • 打赏
  • 举报
回复
最怕这种问题。

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧