frm_cyj_add_confirm.asp

来自「一套石油公司内部的运营管理系统」· ASP 代码 · 共 38 行

ASP
38
字号
<!--#include virtual="/include/DBCon.inc"-->
<%
syear=request.form("year")
text1=request.form("text1")
text2=request.form("text2")
text3=request.form("text3")
Set Rs = Server.CreateObject("ADODB.RecordSet")
SQL="select well_id from oil.oil_well where well_id='" &text1& "' and well_type='1'"
rs.open SQL,conn
if rs.eof then
	response.redirect "/profile/errorpage.asp?title=添加新的措施动态数据&msg=数据库里没有你添加的水井号!请确认井号是否是正确或者添加新井。" 
else
	rs.close
	SQL="select cyj_id from oil.oil_cyj"
	rs.open SQL,conn,1,1
	if rs.eof and rs.bof then
		maxId=0
		rs.close
	else
		rs.close
		SQL="select MAX(cyj_id) as maxId from oil.oil_cyj"
		rs.open SQL,conn,1,1
		maxId=rs("maxId")
		rs.close
	end if
	SQL="select * from oil.oil_cyj"
	rs.open SQL,conn,1,3
	rs.addnew
	rs("cyj_id")=cint(maxId)+1
	rs("cyj_well_id")=text1
	rs("cyj_date")=text2
	rs("cyj_yxsl")=text3
	rs.update
	rs.close
end if
response.redirect "frm_cyj.asp?year=" &syear
%>
<!--#include virtual="/include/DBClose.inc"-->

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?