<% LoginID=trim(session("LoginID")) if LoginID="" then response.end ClassID=trim(request("ClassID")) if ClassID="" then ClassID=1 if request("cmdUp")<>"" then FromID=trim(request("FromID")) FromName=trim(request("FromName")) body=trim(request("body")) Title=trim(request("Title")) ClassID=trim(request("ClassID")) if Title="" then response.write "主题不能为空。[返回]" oconn.close response.end end if 'set rs=server.createobject("adodb.recordset") 'sql="select * from tblwatch where department="& department &" and EndTime>'"& StartTime &"' and 'StartTime<'"& EndTime &"'" 'rs.open sql,oConn 'if not rs.eof then ' response.write "该部门这段时间内已经安排有人值班，请重新选择，谢谢！[返回]" ' oConn.close ' response.end 'else AddData() response.write "您录入的信息已经提交，谢谢！[返回]" oConn.close response.end 'end if end if %>

登陆用户： |
主题： |
内容描述 |

<% Function GetTableValue(TableName,Field,ValueField,Value) if TableName<>"" and Value<>"" then Set RsTmp = Server.Createobject("Adodb.recordset") strSql = "Select "& Field &" from "& TableName &" where "& ValueField &"='"& Value &"'" Rstmp.open strSql,oConn,1,1 If not Rstmp.eof then GetTableValue=trim(Rstmp(Field)) else GetTableValue="" end if Rstmp.close 'set RsTmp = Nothing else GetTableValue="" end if End Function Sub AddData() sql=" INSERT INTO tblinfo(FromID,ClassID,FromName,title,body) VALUES(" & FromID & _ ","& ClassId & _ ",'"& FromName & _ "','"& Title & _ "','"& body & _ "');" 'response.write sql oConn.execute (sql) end sub %>