gusucode.com > ASP+ACCESS在线教育系统设计(源代码+论文) > ASP+ACCESS在线教育系统设计(源代码+论文)\王智_在线教育系统\teacher\bulletin_insert.asp

    <%@  Language = "VBScript"  %>
<!-- #Include file="..\include\adovbs.inc" -->
<!-- #Include file="..\include\cod_ado.inc" -->
<%
	strTitle = Request.Form("title")
	strTitle = Trim(strTitle)
	strTitle = replace(strTitle,"'","''")
	
	strTitle = server.HTMLEncode(strTitle)
	'strTitle = replace(strTitle,"<","&lt;")
	'strTitle = replace(strTitle,">","&gt;")

	strflag_attention = Request.Form("flag_attention")
	if strflag_attention = "on" then
		flag_attention = 1
	else
		flag_attention = 0
	end if
	
	strText = Request.Form("detail")
	strText = replace(strText,"'","''")
	
	'strText = server.HTMLEncode(strText)
	'strText = replace(strText,chr(13)&chr(10),"<br>")
	'strText = replace(strText," ","&nbsp;")
	
	strText = replace(strText,"<","&lt;")
	strText = replace(strText,">","&gt;")
	
	dim objCnn,rs
	strDSN = Application("dsn")
	strSQL = "SELECT MAX(idnum) from board"
	cod_AdoOpen objCnn,rs,strDSN,strSQL

	if isnull(rs(0)) then
		idnum=1
	else
		idnum=rs(0)+1
	end if
	rs.close
	
	strSQL = "insert into board(IDNUM,title,flag_attention,detail) values (" &idnum &",'" &strTitle & "'," & flag_attention & ",'" & strText & "')"
	'Response.Write strSql
	objCnn.Execute(strSQL)  

	objCnn.close
	set objCnn = nothing
	
	response.redirect "bulletin.asp"		
%>