<!-- #include file="cnn.asp" -->
<%
if session("admin")="" then
response.redirect "login.asp"
end if
%>
<%
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString,">",">")
fString = replace(fString,"<","<")
fstring = replace(fstring,"'","''")
//fString = Replace(fString,CHR(9)," ")
//fString = Replace(fString,CHR(39),"'")
//fString = Replace(fString,CHR(13),"")
//fString = Replace(fString,CHR(10) & CHR(10),"</P><P> ")
//fString = Replace(fString,CHR(10),"<BR> ")
fString = Replace(fString,CHR(32)," ")
HTMLEncode =fString
end if
end function
if request("oType")="insert" then
au=HTMLEncode(trim(request("author")))
fr=HTMLEncode(trim(request("from")))
ti=HTMLEncode(trim(request("title")))
ct=HTMLEncode(trim(request("content")))
tp=HTMLEncode(trim(request("type")))
if len(au)=0 then
au="无"
fr="无"
ti="无"
end if
sql="insert into news([title],[content],[author],[from],[type])values('"& ti&"','"& ct&"','"&au&"','"&fr&"','"&tp&"')"
set rs=cnn.execute(sql)
response.redirect"news_manage.asp?page=1"
else if request("oType")="del" then
id=trim(request("id"))
page=request("page")
sql="delete * from news where ID="&id
set rs1=cnn.execute(sql)
response.redirect"news_manage.asp?page="&page
end if
end if
%>
<%
cnn.close
%>
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] 操作必须使用一个可更新的查询。
/sssssssss/test/news_upload.asp, 第 34 行 即:set rs=cnn.execute(sql)