这个是删除文件:
<!--#include file="conn.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "delete * from stuinfo where 学号='"&a&"'"
rs.delete
rs.close
asconn.close
set asconn=nothing
response.redirect "shanchuchenggong.asp"
%>
这个是conn.asp:
<%
dim asconn
set asconn=server.createobject("adodb.connection")
asconn.open = "provider=SQLOLEDB.1;data source=LIXUN;"&_
"initial catalog=DB;user id=sa;password=sa;"
function encodestr(str)
str=trim(str)
str=replace(str,"<","<")
str=replace(str,">",">")
str=replace(str,"""","'")
str=replace(str,vbCrLf&vbCrlf,"</p><p>")
str=replace(str,vbCrLf,"<br>")
encodestr=replace(str," ","")
end function
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function '限制新闻标题的显示字数的函数,后面以...显示
function astext(vstrin) '字符编码
dim i,strreturn
strreturn = ""
for i = 1 to len(vstrin)
thischr = mid(vstrin,i,1)
if abs(asc(thischr)) < &hff then
strreturn = strreturn & thischr
else
innercode = asc(thischr)
if innercode < 0 then
innercode = innercode + &h10000
end if
hight8 = (innercode and &hff00)\ &hff
low8 = innercode and &hff
strreturn = strreturn & "%" & hex(hight8) & "%" & hex(low8)
end if
next
astext = strreturn
end function
%>
错误类型:
ADODB.Recordset (0x800A0E7D)
连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。
/bs/shanchu1.asp, 第 4 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
网页:
POST 42 ??? /bs/shanchu1.asp
POST Data:
textfield=%C0%EE%D1%AB&Submit=%C9%BE%B3%FD
时间:
2007年5月14日, 13:21:14
详细信息:
Microsoft 支持
老师在催着交作业,请各位帮我看看,错误出在哪里?谢谢!