statussave.asp
来自「asp的新闻网站」· ASP 代码 · 共 65 行
ASP
65 行
<%@ Language=VBScript %>
<!--#include file="../include/odbc.asp" -->
<!--#include file="../include/killStr.asp" -->
<!--#include file="../include/checkUser.asp" -->
<!--#include file="../include/checkServer.asp" -->
<%
'修改:潘树文
'时间:2001年2月9日
%>
<%
Dim statusName
statusName = trim(Request.Form("Name"))
%>
<%
Dim rs
Dim sql
Dim statusid,statusidNumber,i
if statusName="" then Response.Redirect "statuslist.asp"
Set rs=server.CreateObject("adodb.RecordSet")
rs.LockType = 3
rs.CursorType = 3
sql = "Select * From weather_status Where statusName = '" & statusName & "'"
rs.Open sql,conn
If rs.Eof Then
rs.close
sql = "Select * From weather_status order by statusId desc"
rs.Open sql,conn
'产生编号
If rs.Eof Then
statusId="0001"
Else
statusId=rs("statusId")
statusIdNumber=clng(statusId)+1
statusId=cstr(statusIdNumber)
lenstatusId=len(statusId)
For i=1 To 4-lenstatusId
statusId="0"&statusId
Next
End If
rs.AddNew
rs("statusName") = statusName
rs("statusID") = statusid
rs.Update
rs.close
Set rs = nothing
conn.close
Set conn = nothing
Response.redirect "statusList.asp"
Else
Response.Write("<script>alert('对不起,此天气状况已经存在,请重新输入!');history.go(-1)</script>")
Response.End
rs.Close
Set rs = nothing
conn.close
Set conn = nothing
END IF
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?