我的一个小程序老是出错,请大家帮我找一下问题:
add.asp
Untitled Document
<%
name=request.form("name")
message=request.form("message")
if name="" then
response.write "请填写您的姓名,点击
这里返回"
elseif message="" then
response.write "请填写更新内容,点击
这里返回"
else
Set Rs = Server.CreateObject("ADODB.Recordset")
Set Rs.ActiveConnection=conn
Rs.open "select * from sakurasky",sql,conn,3,2
Rs.addnew
Rs("name")=name
Rs("time")=now
Rs("message")=message
Rs.update
Rs.close
set Rs = nothing
conn.close
set conn = nothing
Response.redirect "new.asp"
Response.End
end if
%>
<%
Set Rs = Server.CreateObject("ADODB.Recordset")
Set Rs.ActiveConnection=conn
Rs.open "select * from sakurasky",sql,conn,3,2
Rs.close
set Rs = nothing
%>
new.asp
语言分类leftmargin="5" background="b-begin.gif" bgproperties="fixed">
<%
sql="select top 1 id from sakurasky order by id"
set rs=conn.execute(sql)
if not rs.eof then
delid=rs("id")
else
delid=0
end if
do while not EOF
i = i + 1
if i > 10 then
dol = "delete from sakurasky where id="&delid
on error resume next
conn.execute (dol)
exit do
end if%>
<%=Rs("time")%> |
<%=Rs("name")%> |
更新内容: |
<%=Rs("message")%> |
<%
Rs.movenext
loop
Rs.close
set Rs = nothing
%>
我输入add.asp的连接时页面显示:
-----------------------------------------------------------------------------------------------
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: 'Rs.ActiveConnection'
/ice/gb/add.asp,行47
------------------------------------------------------------------------------------------------
请问这是怎么回事,我按生存方式朋友所说的方法好象也不行,
大家帮我看一下吧,就要交的了.另外如果还有错误之处请指教.
出错页:
http://www.sakurabbs.net/ice/gb/add.asp